2/21/11

code geneator in sql

$%@ Page Language="C#" %#
$%@ Import Namespace="System.Data" %#
$!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"#


$script runat="server"#
//TODO:
// Create an Object of the DataTable You need class for
// Assign Connection string name from Web.config
// Assign Data Set Name
//public aspnetdb.ModulePermissionDataTable dt = new aspnetdb.ModulePermissionDataTable();
//dsProduction.TBL_PRODUCTION_PROCESS_DETAIL_MACHINEDataTable dt = new dsProduction.TBL_PRODUCTION_PROCESS_DETAIL_MACHINEDataTable();
DataSet1.BusinessPartCommissionMasterDataTable dt = new DataSet1.BusinessPartCommissionMasterDataTable();
//CodeGenerator.TBL_ITEMPROPERTIESDataTable dt = new CodeGenerator.TBL_ITEMPROPERTIESDataTable();
public string TableName
{
get
{
String tblName = dt.TableName.Replace("DataTable", "");
tblName = "cls"+tblName.Replace("TBL_", "")+"_CDO";
return tblName;
}
}
public string ConnectionStringName = "sdmsConnectionString";
public string DataSetName = "CodeGenerator";
public StringBuilder param = new StringBuilder();
$/script#
$html xmlns="http://www.w3.org/1999/xhtml" #
$head id="Head1" runat="server"#
$title#Untitled Page$/title#
$/head#
$body#
$form id="form1" runat="server"#
$div#
$pre#
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
/*
COMPANY NAME : DILIGENT INFOSYS, AHMEDABAD
PROJECT NAME : SALES AND DESTRUCTION MANAGEMENT SYSTEM
CREATE BY : MAULIK, MITESH, ANKIT, PARUL, TEJAS
CREATE DATE : $%= DateTime.Now %#
PURPOSE : FOR $%= dt.TableName%#
MODIFY BY :
MODIFY DATE :
MODIFY PURPOSE :
*/
namespace SDMClasslibrary.CDO.Master
{
public class $%=TableName%#
{
private void ClearText()
{
$%
foreach (DataColumn col in dt.Columns)
{
%#
txt$%=col.ColumnName%#.Text ="";
$%
}
%#
}
private void EnableDisableText(bool flg)
{
$%
foreach (DataColumn col1 in dt.Columns)
{
%#
txt$%=col1.ColumnName%#.Enable =flg;
$%
}
%#
}
private void EnableDisableText(bool flg)
{
$%
foreach (DataColumn col2 in dt.Columns)
{
%#
$%=TableName%#_CDO.$%=col2.ColumnName%# = txt$%=col2.ColumnName%#.Text.Tostring();
$%
}
%#
}
}
}
$/pre#
$/div#
$/form#
$/body#
$/html#

No comments:

Post a Comment