Nested gridview or Grid inside gridview or Sub gridview
/////////////////////////////////////////////
/////////aspx
//////////////////////////////////////////////
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="KeyNumberReport.aspx.cs" Inherits="Universal.KeyNumberReport" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
function divexpandcollapse(divname) {
var div = document.getElementById(divname);
var img = document.getElementById('img' + divname);
if (div.style.display == "none") {
div.style.display = "inline";
img.src = "../images/minus.png";
} else {
div.style.display = "none";
img.src = "../images/plus sikmboil.jpg";
}
}
function divexpandcollapseChild(divname) {
var div1 = document.getElementById(divname);
var img = document.getElementById('img' + divname);
if (div1.style.display == "none") {
div1.style.display = "inline";
img.src = "../images/minus.png";
} else {
div1.style.display = "none";
img.src = "../images/plus sikmboil.jpg";;
}
}
</script>
<style type="text/css">
.InvisibleCol {
display: none;
}
</style>
<div>
<table style="width: 131%;">
<tr>
<td colspan="100%">
<div style="margin-left: 350px; background-color: #000000; margin-top: 5px; width: 237px;">
<br />
<asp:Label ID="lbldate" runat="server" Text="Date" Style="color: #FFFFFF; font-weight: 700" ForeColor="White"></asp:Label>
<asp:TextBox ID="txtdate" runat="server" TextMode="Date"></asp:TextBox><asp:Button ID="btnshow" runat="server" Text="Go" OnClick="btnshow_Click" Style="font-weight: 700"></asp:Button>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidatortxtdate" runat="server" ErrorMessage="Please Enter a valid Date" ControlToValidate="txtdate" Style="color: white; font-weight: 700"></asp:RequiredFieldValidator>
<br />
</div>
<br />
<asp:GridView ID="gvzoneDetails" runat="server" AutoGenerateColumns="false" Width="200%"
OnRowDataBound="gvzoneDetails_OnRowDataBound " ShowFooter="true" Style="font-family: Arial, Helvetica, sans-serif; background-color: #FFFFFF;">
<AlternatingRowStyle BackColor="#FFE4C4" />
<Columns>
<asp:TemplateField HeaderText="Zone">
<ItemTemplate>
<a href="javascript:divexpandcollapse('div<%# Eval("zonecode") %>');" style="padding-left: 2px;">
<img id="imgdiv<%# Eval("zonecode") %>" alt="" width="9px" border="0" src="images/plus sikmboil.jpg" />
</a>
<asp:Label ID="lblzonecode" Text='<%# Eval("ZoneCode") %>' Visible="true" runat="server"></asp:Label>
</ItemTemplate>
<ItemStyle VerticalAlign="Middle"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("zonename") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("zonename") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eq">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("mon_equitybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("mon_equitybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Curr">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("mon_currencybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("mon_currencybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Comm">
<EditItemTemplate>
<asp:TextBox ID="TextBox185" runat="server" Text='<%# Bind("mon_commbrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label185" runat="server" Text='<%# Bind("mon_commbrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField DataField="" HeaderText="Total" ItemStyle-HorizontalAlign="Right">
</asp:BoundField>
<asp:TemplateField HeaderText="Eq">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("day_equitybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("day_equitybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Curr">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("day_currencybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("day_currencybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Comm">
<EditItemTemplate>
<asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("day_commbrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("day_commbrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<div style="text-align: right;">
<asp:Label ID="lblday_commbrok" runat="server" Font-Bold="true" />
</div>
</FooterTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField DataField="" HeaderText="Total" ItemStyle-HorizontalAlign="Right">
</asp:BoundField>
<asp:TemplateField>
<HeaderStyle CssClass="InvisibleCol" />
<ItemStyle CssClass="InvisibleCol" />
<ItemTemplate>
<tr>
<td colspan="100%">
<div id="div<%# Eval("zonecode") %>" style="overflow: auto; display: none; position: relative; left: 25px; overflow: auto">
<asp:GridView ID="gv_regioncode" runat="server" Width="94%"
AutoGenerateColumns="false" DataKeyNames="zonecode"
OnRowDataBound="gv_regioncode_OnRowDataBound" BackColor="White">
<AlternatingRowStyle BackColor="#FFE0E4" />
<Columns>
<asp:TemplateField HeaderText="Region">
<ItemStyle Width="10%" />
<ItemTemplate>
<a href="javascript:divexpandcollapse('div1<%# Eval("regioncode") %>');" style="padding-left: 2px;">
<img id="imgdiv1<%# Eval("regioncode") %>" alt="" width="9px" border="0" src="images/plus sikmboil.jpg" />
</a>
<asp:Label ID="lblregioncode" Text='<%# Eval("regioncode") %>' Visible="true" runat="server"></asp:Label>
</ItemTemplate>
<ItemStyle Font-Size="14px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<EditItemTemplate>
<asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("regionname") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label11" runat="server" Text='<%# Bind("regionname") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="MTD Eq">
<EditItemTemplate>
<asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("mon_equitybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label12" runat="server" Text='<%# Bind("mon_equitybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="MTD Curr">
<EditItemTemplate>
<asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("mon_currencybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label13" runat="server" Text='<%# Bind("mon_currencybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Font-Size="14px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="MTD Comm">
<EditItemTemplate>
<asp:TextBox ID="TextBox17" runat="server" Text='<%# Bind("mon_commbrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label17" runat="server" Text='<%# Bind("mon_commbrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Today Eq">
<EditItemTemplate>
<asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("day_equitybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label14" runat="server" Text='<%# Bind("day_equitybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Font-Size="14px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Today Curr">
<EditItemTemplate>
<asp:TextBox ID="TextBox15" runat="server" Text='<%# Bind("day_currencybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label15" runat="server" Text='<%# Bind("day_currencybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Today Comm">
<EditItemTemplate>
<asp:TextBox ID="TextBox16" runat="server" Text='<%# Bind("day_commbrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label16" runat="server" Text='<%# Bind("day_commbrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Font-Size="14px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderStyle CssClass="InvisibleCol" />
<ItemStyle CssClass="InvisibleCol" />
<ItemTemplate>
<tr>
<td colspan="100%">
<div id="div1<%# Eval("regioncode") %>" style="overflow: auto; display: none; position: relative; left: 35px; overflow: auto">
<asp:GridView ID="gv_regioncodedetails" runat="server" Width="91%"
AutoGenerateColumns="false" BackColor="White">
<AlternatingRowStyle BackColor="#CECEFF" />
<Columns>
<asp:BoundField DataField="BusinessUnitCode" HeaderText="Branch" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
<asp:BoundField DataField="ShortName" HeaderText="Name"></asp:BoundField>
<asp:BoundField DataField="mon_equitybrok" HeaderText="MTD Eq" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="mon_currencybrok" HeaderText="MTD Curr" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="mon_commbrok" ItemStyle-HorizontalAlign="Right" HeaderText="MTD Comm" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="day_equitybrok" HeaderText="Today Eq" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="day_currencybrok" HeaderText="Today Curr" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="day_commbrok" HeaderText="Today Comm" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
</Columns>
<HeaderStyle BackColor="#6C6C47" HorizontalAlign="Center" ForeColor="White" />
</asp:GridView>
</div>
</td>
</tr>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#99ccff" HorizontalAlign="Center" ForeColor="White" />
</asp:GridView>
</div>
</td>
</tr>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#ccffcc" />
<HeaderStyle BackColor="Black" HorizontalAlign="Center" ForeColor="White" Font-Bold="true" />
</asp:GridView>
</td>
</tr>
</table>
</div>
</asp:Content>
/////////////////////////////////////////////////////////
//////////////////aspx.cs
//////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using DALC4NET;
using Universal.BAL;
using System.Data.SqlClient;
namespace Universal
{
public partial class KeyNumberReport : System.Web.UI.Page
{
int total12 = 0;
int total11 = 0;
int mon_equitybrok = 0;
int mon_currencybrok = 0;
int mon_commbrok = 0;
int day_equitybrok = 0;
int day_currencybrok = 0;
int day_commbrok = 0;
protected void Page_Load(object sender, EventArgs e)
{
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : btnshow_Click
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get ZoneCodeDetails Report
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
protected void btnshow_Click(object sender, EventArgs e)
{
try
{
DateTime toDate = DateTime.Parse(txtdate.Text.Trim());
string strtodate = toDate.ToString("dd-MMM-yyyy");
var monthStartDate = new DateTime(toDate.Year, toDate.Month, 1);
string strstartdate = monthStartDate.ToString("dd-MMM-yyyy");
showReportData(strstartdate, strtodate);
}
catch(Exception ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : showdata
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get the data from backend and display in gridview
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void showReportData(string strFromDate, string strToDate)
{
DBParameterCollection objlstParm = new DBParameterCollection();
objlstParm.Add(new DBParameter() { Value = strFromDate, Name = "@fromdate", Type = DbType.String });
objlstParm.Add(new DBParameter() { Value = strToDate, Name = "@todate", Type = DbType.String });
DataTable dtTradeDetails = KwynumberReportBLL.GetZonecodeDetails("proc_tradedetails", objlstParm, CommandType.StoredProcedure);
gvzoneDetails.DataSource = dtTradeDetails;
gvzoneDetails.DataBind();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : gvzoneDetails_OnRowDataBound
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get gridview zone aligment,footer,header,Total,font,formats,double header styles and
// gridview regioncode get the data from backend and display in gridview
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
protected void gvzoneDetails_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
//gridview regioncode get the data from backend and display in gridview
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblzonecode = (Label)e.Row.FindControl("lblzonecode");
GridView gv_regioncode = (GridView)e.Row.FindControl("gv_regioncode");
string strtxtzonecode = lblzonecode.Text;
DBParameterCollection objlstParm = new DBParameterCollection();
objlstParm.Add(new DBParameter() { Value = strtxtzonecode, Name = "@zonecode", Type = DbType.String });
DataTable dtRegiondetails = KwynumberReportBLL.GetRegioncodeDetails("proc_tradedetails2", objlstParm, CommandType.StoredProcedure);
gv_regioncode.DataSource = dtRegiondetails;
gv_regioncode.DataBind();
}
//summation rows
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[1].Font.Size = 9;
day_commbrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_commbrok"));
mon_commbrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_commbrok"));
mon_equitybrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_equitybrok"));
mon_currencybrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_currencybrok"));
day_equitybrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_equitybrok"));
day_currencybrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_currencybrok"));
int total = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_commbrok")) + Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_equitybrok")) + Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_currencybrok"));
e.Row.Cells[5].Text = total.ToString("N2");
int total1 = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_commbrok")) + Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_equitybrok")) + Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_currencybrok"));
e.Row.Cells[9].Text = total1.ToString("N2");
total11 += total;
total12 += total1;
}
//display total data in footer and formating
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[1].Text = "GrandTotal";
//e.Row.Cells[7].Text = day_commbrok.ToString("N2");
e.Row.Cells[8].Text = day_commbrok.ToString("N2");
e.Row.Cells[2].Text = mon_equitybrok.ToString("N2");
e.Row.Cells[3].Text = mon_currencybrok.ToString("N2");
e.Row.Cells[4].Text = mon_commbrok.ToString("N2");
e.Row.Cells[5].Text = total11.ToString("N2");
e.Row.Cells[6].Text = day_equitybrok.ToString("N2");
e.Row.Cells[7].Text = day_currencybrok.ToString("N2");
e.Row.Cells[9].Text = total12.ToString("N2");
e.Row.Cells[8].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[3].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[4].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[6].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[7].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[9].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[5].HorizontalAlign = HorizontalAlign.Right;
}
//double header creation and display on top headers of gridview
if (e.Row.RowType == DataControlRowType.Header)
{
GridView HeaderGrid = (GridView)sender;
GridViewRow HeaderGridRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);
TableCell HeaderCell = new TableCell();
HeaderCell.Text = "Names";
HeaderCell.ColumnSpan = 2;
HeaderGridRow.Cells.Add(HeaderCell);
HeaderCell = new TableCell();
HeaderCell.Text = "MTD Revenue(in Rupees)";
HeaderCell.ColumnSpan = 4;
HeaderGridRow.Cells.Add(HeaderCell);
HeaderCell = new TableCell();
HeaderCell.Text = "Today's Revenue(in Rupees)";
HeaderCell.ColumnSpan = 4;
HeaderGridRow.Cells.Add(HeaderCell);
gvzoneDetails.Controls[0].Controls.AddAt(0, HeaderGridRow);
}
}
catch(Exception ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : gv_regioncode_OnRowDataBound
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get the data from backend and display in gridview
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
protected void gv_regioncode_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblregioncode = (Label)e.Row.FindControl("lblregioncode");
GridView gv_regioncodedetails = (GridView)e.Row.FindControl("gv_regioncodedetails");
string strtxtregioncode = lblregioncode.Text;
DBParameterCollection objlstParm = new DBParameterCollection();
objlstParm.Add(new DBParameter() { Value = strtxtregioncode, Name = "@regioncode", Type = DbType.String });
DataTable dtRegioncodeSubDetails = KwynumberReportBLL.GetRegioncodeSubDetails("proc_tradedetails3", objlstParm, CommandType.StoredProcedure);
gv_regioncodedetails.DataSource = dtRegioncodeSubDetails;
gv_regioncodedetails.DataBind();
}
}
catch(Exception ex)
{
throw ex;
}
}
}
}
/////////////////////////////////////////////////////////
/////bal
//////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using Universal.DAL;
using DALC4NET;
namespace Universal.BAL
{
public class KwynumberReportBLL
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : GetZonecodeDetails
// Created on : 20MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get ZoneCodeDetails Report
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static DataTable GetZonecodeDetails(string commandText, DBParameterCollection paramCollection, CommandType commandType)
{
return GenericStatements.SelectSpAlchemyDBStatment(commandText, paramCollection, commandType);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : GetRegioncodeDetails
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for Get RegioncodeDetails Report
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static DataTable GetRegioncodeDetails(string commandText, DBParameterCollection paramCollection, CommandType commandType)
{
return GenericStatements.SelectSpAlchemyDBStatment(commandText, paramCollection, commandType);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : GetRegioncodeSubDetails
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for Get RegioncodeSubDetails Report
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static DataTable GetRegioncodeSubDetails(string commandText, DBParameterCollection paramCollection, CommandType commandType)
{
return GenericStatements.SelectSpAlchemyDBStatment(commandText, paramCollection, commandType);
}
}
}
/////////////////////////////////////////////////////////
/////dal
//////////////////////////////////
empty
///////////////////////////////////////////
//////common
//////////////////////////////////////////
public static DataTable SelectSqlSP(string commandText, DBParameterCollection paramCollection, CommandType commandType)
{
using (DBHelper objDBHelper = new DBHelper())
{
DataTable table = new DataTable();
var transaction = objDBHelper.BeginTransaction();
try
{
table = objDBHelper.ExecuteDataTable(commandText, paramCollection, commandType);
objDBHelper.CommitTransaction(transaction);
}
catch (Exception err)
{
objDBHelper.RollbackTransaction(transaction);
}
return table;
}
}
/////////aspx
//////////////////////////////////////////////
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="KeyNumberReport.aspx.cs" Inherits="Universal.KeyNumberReport" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
function divexpandcollapse(divname) {
var div = document.getElementById(divname);
var img = document.getElementById('img' + divname);
if (div.style.display == "none") {
div.style.display = "inline";
img.src = "../images/minus.png";
} else {
div.style.display = "none";
img.src = "../images/plus sikmboil.jpg";
}
}
function divexpandcollapseChild(divname) {
var div1 = document.getElementById(divname);
var img = document.getElementById('img' + divname);
if (div1.style.display == "none") {
div1.style.display = "inline";
img.src = "../images/minus.png";
} else {
div1.style.display = "none";
img.src = "../images/plus sikmboil.jpg";;
}
}
</script>
<style type="text/css">
.InvisibleCol {
display: none;
}
</style>
<div>
<table style="width: 131%;">
<tr>
<td colspan="100%">
<div style="margin-left: 350px; background-color: #000000; margin-top: 5px; width: 237px;">
<br />
<asp:Label ID="lbldate" runat="server" Text="Date" Style="color: #FFFFFF; font-weight: 700" ForeColor="White"></asp:Label>
<asp:TextBox ID="txtdate" runat="server" TextMode="Date"></asp:TextBox><asp:Button ID="btnshow" runat="server" Text="Go" OnClick="btnshow_Click" Style="font-weight: 700"></asp:Button>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidatortxtdate" runat="server" ErrorMessage="Please Enter a valid Date" ControlToValidate="txtdate" Style="color: white; font-weight: 700"></asp:RequiredFieldValidator>
<br />
</div>
<br />
<asp:GridView ID="gvzoneDetails" runat="server" AutoGenerateColumns="false" Width="200%"
OnRowDataBound="gvzoneDetails_OnRowDataBound " ShowFooter="true" Style="font-family: Arial, Helvetica, sans-serif; background-color: #FFFFFF;">
<AlternatingRowStyle BackColor="#FFE4C4" />
<Columns>
<asp:TemplateField HeaderText="Zone">
<ItemTemplate>
<a href="javascript:divexpandcollapse('div<%# Eval("zonecode") %>');" style="padding-left: 2px;">
<img id="imgdiv<%# Eval("zonecode") %>" alt="" width="9px" border="0" src="images/plus sikmboil.jpg" />
</a>
<asp:Label ID="lblzonecode" Text='<%# Eval("ZoneCode") %>' Visible="true" runat="server"></asp:Label>
</ItemTemplate>
<ItemStyle VerticalAlign="Middle"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("zonename") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("zonename") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eq">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("mon_equitybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("mon_equitybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Curr">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("mon_currencybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("mon_currencybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Comm">
<EditItemTemplate>
<asp:TextBox ID="TextBox185" runat="server" Text='<%# Bind("mon_commbrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label185" runat="server" Text='<%# Bind("mon_commbrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField DataField="" HeaderText="Total" ItemStyle-HorizontalAlign="Right">
</asp:BoundField>
<asp:TemplateField HeaderText="Eq">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("day_equitybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("day_equitybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Curr">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("day_currencybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("day_currencybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Comm">
<EditItemTemplate>
<asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("day_commbrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("day_commbrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<div style="text-align: right;">
<asp:Label ID="lblday_commbrok" runat="server" Font-Bold="true" />
</div>
</FooterTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField DataField="" HeaderText="Total" ItemStyle-HorizontalAlign="Right">
</asp:BoundField>
<asp:TemplateField>
<HeaderStyle CssClass="InvisibleCol" />
<ItemStyle CssClass="InvisibleCol" />
<ItemTemplate>
<tr>
<td colspan="100%">
<div id="div<%# Eval("zonecode") %>" style="overflow: auto; display: none; position: relative; left: 25px; overflow: auto">
<asp:GridView ID="gv_regioncode" runat="server" Width="94%"
AutoGenerateColumns="false" DataKeyNames="zonecode"
OnRowDataBound="gv_regioncode_OnRowDataBound" BackColor="White">
<AlternatingRowStyle BackColor="#FFE0E4" />
<Columns>
<asp:TemplateField HeaderText="Region">
<ItemStyle Width="10%" />
<ItemTemplate>
<a href="javascript:divexpandcollapse('div1<%# Eval("regioncode") %>');" style="padding-left: 2px;">
<img id="imgdiv1<%# Eval("regioncode") %>" alt="" width="9px" border="0" src="images/plus sikmboil.jpg" />
</a>
<asp:Label ID="lblregioncode" Text='<%# Eval("regioncode") %>' Visible="true" runat="server"></asp:Label>
</ItemTemplate>
<ItemStyle Font-Size="14px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<EditItemTemplate>
<asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("regionname") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label11" runat="server" Text='<%# Bind("regionname") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="MTD Eq">
<EditItemTemplate>
<asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("mon_equitybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label12" runat="server" Text='<%# Bind("mon_equitybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="MTD Curr">
<EditItemTemplate>
<asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("mon_currencybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label13" runat="server" Text='<%# Bind("mon_currencybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Font-Size="14px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="MTD Comm">
<EditItemTemplate>
<asp:TextBox ID="TextBox17" runat="server" Text='<%# Bind("mon_commbrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label17" runat="server" Text='<%# Bind("mon_commbrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Today Eq">
<EditItemTemplate>
<asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("day_equitybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label14" runat="server" Text='<%# Bind("day_equitybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Font-Size="14px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Today Curr">
<EditItemTemplate>
<asp:TextBox ID="TextBox15" runat="server" Text='<%# Bind("day_currencybrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label15" runat="server" Text='<%# Bind("day_currencybrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Today Comm">
<EditItemTemplate>
<asp:TextBox ID="TextBox16" runat="server" Text='<%# Bind("day_commbrok") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label16" runat="server" Text='<%# Bind("day_commbrok","{0:0,0.00}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Font-Size="14px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderStyle CssClass="InvisibleCol" />
<ItemStyle CssClass="InvisibleCol" />
<ItemTemplate>
<tr>
<td colspan="100%">
<div id="div1<%# Eval("regioncode") %>" style="overflow: auto; display: none; position: relative; left: 35px; overflow: auto">
<asp:GridView ID="gv_regioncodedetails" runat="server" Width="91%"
AutoGenerateColumns="false" BackColor="White">
<AlternatingRowStyle BackColor="#CECEFF" />
<Columns>
<asp:BoundField DataField="BusinessUnitCode" HeaderText="Branch" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
<asp:BoundField DataField="ShortName" HeaderText="Name"></asp:BoundField>
<asp:BoundField DataField="mon_equitybrok" HeaderText="MTD Eq" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="mon_currencybrok" HeaderText="MTD Curr" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="mon_commbrok" ItemStyle-HorizontalAlign="Right" HeaderText="MTD Comm" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="day_equitybrok" HeaderText="Today Eq" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="day_currencybrok" HeaderText="Today Curr" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
<asp:BoundField DataField="day_commbrok" HeaderText="Today Comm" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0.00}"></asp:BoundField>
</Columns>
<HeaderStyle BackColor="#6C6C47" HorizontalAlign="Center" ForeColor="White" />
</asp:GridView>
</div>
</td>
</tr>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#99ccff" HorizontalAlign="Center" ForeColor="White" />
</asp:GridView>
</div>
</td>
</tr>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#ccffcc" />
<HeaderStyle BackColor="Black" HorizontalAlign="Center" ForeColor="White" Font-Bold="true" />
</asp:GridView>
</td>
</tr>
</table>
</div>
</asp:Content>
/////////////////////////////////////////////////////////
//////////////////aspx.cs
//////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using DALC4NET;
using Universal.BAL;
using System.Data.SqlClient;
namespace Universal
{
public partial class KeyNumberReport : System.Web.UI.Page
{
int total12 = 0;
int total11 = 0;
int mon_equitybrok = 0;
int mon_currencybrok = 0;
int mon_commbrok = 0;
int day_equitybrok = 0;
int day_currencybrok = 0;
int day_commbrok = 0;
protected void Page_Load(object sender, EventArgs e)
{
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : btnshow_Click
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get ZoneCodeDetails Report
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
protected void btnshow_Click(object sender, EventArgs e)
{
try
{
DateTime toDate = DateTime.Parse(txtdate.Text.Trim());
string strtodate = toDate.ToString("dd-MMM-yyyy");
var monthStartDate = new DateTime(toDate.Year, toDate.Month, 1);
string strstartdate = monthStartDate.ToString("dd-MMM-yyyy");
showReportData(strstartdate, strtodate);
}
catch(Exception ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : showdata
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get the data from backend and display in gridview
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void showReportData(string strFromDate, string strToDate)
{
DBParameterCollection objlstParm = new DBParameterCollection();
objlstParm.Add(new DBParameter() { Value = strFromDate, Name = "@fromdate", Type = DbType.String });
objlstParm.Add(new DBParameter() { Value = strToDate, Name = "@todate", Type = DbType.String });
DataTable dtTradeDetails = KwynumberReportBLL.GetZonecodeDetails("proc_tradedetails", objlstParm, CommandType.StoredProcedure);
gvzoneDetails.DataSource = dtTradeDetails;
gvzoneDetails.DataBind();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : gvzoneDetails_OnRowDataBound
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get gridview zone aligment,footer,header,Total,font,formats,double header styles and
// gridview regioncode get the data from backend and display in gridview
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
protected void gvzoneDetails_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
//gridview regioncode get the data from backend and display in gridview
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblzonecode = (Label)e.Row.FindControl("lblzonecode");
GridView gv_regioncode = (GridView)e.Row.FindControl("gv_regioncode");
string strtxtzonecode = lblzonecode.Text;
DBParameterCollection objlstParm = new DBParameterCollection();
objlstParm.Add(new DBParameter() { Value = strtxtzonecode, Name = "@zonecode", Type = DbType.String });
DataTable dtRegiondetails = KwynumberReportBLL.GetRegioncodeDetails("proc_tradedetails2", objlstParm, CommandType.StoredProcedure);
gv_regioncode.DataSource = dtRegiondetails;
gv_regioncode.DataBind();
}
//summation rows
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[1].Font.Size = 9;
day_commbrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_commbrok"));
mon_commbrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_commbrok"));
mon_equitybrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_equitybrok"));
mon_currencybrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_currencybrok"));
day_equitybrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_equitybrok"));
day_currencybrok += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_currencybrok"));
int total = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_commbrok")) + Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_equitybrok")) + Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "mon_currencybrok"));
e.Row.Cells[5].Text = total.ToString("N2");
int total1 = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_commbrok")) + Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_equitybrok")) + Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "day_currencybrok"));
e.Row.Cells[9].Text = total1.ToString("N2");
total11 += total;
total12 += total1;
}
//display total data in footer and formating
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[1].Text = "GrandTotal";
//e.Row.Cells[7].Text = day_commbrok.ToString("N2");
e.Row.Cells[8].Text = day_commbrok.ToString("N2");
e.Row.Cells[2].Text = mon_equitybrok.ToString("N2");
e.Row.Cells[3].Text = mon_currencybrok.ToString("N2");
e.Row.Cells[4].Text = mon_commbrok.ToString("N2");
e.Row.Cells[5].Text = total11.ToString("N2");
e.Row.Cells[6].Text = day_equitybrok.ToString("N2");
e.Row.Cells[7].Text = day_currencybrok.ToString("N2");
e.Row.Cells[9].Text = total12.ToString("N2");
e.Row.Cells[8].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[3].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[4].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[6].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[7].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[9].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[5].HorizontalAlign = HorizontalAlign.Right;
}
//double header creation and display on top headers of gridview
if (e.Row.RowType == DataControlRowType.Header)
{
GridView HeaderGrid = (GridView)sender;
GridViewRow HeaderGridRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);
TableCell HeaderCell = new TableCell();
HeaderCell.Text = "Names";
HeaderCell.ColumnSpan = 2;
HeaderGridRow.Cells.Add(HeaderCell);
HeaderCell = new TableCell();
HeaderCell.Text = "MTD Revenue(in Rupees)";
HeaderCell.ColumnSpan = 4;
HeaderGridRow.Cells.Add(HeaderCell);
HeaderCell = new TableCell();
HeaderCell.Text = "Today's Revenue(in Rupees)";
HeaderCell.ColumnSpan = 4;
HeaderGridRow.Cells.Add(HeaderCell);
gvzoneDetails.Controls[0].Controls.AddAt(0, HeaderGridRow);
}
}
catch(Exception ex)
{
throw ex;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : gv_regioncode_OnRowDataBound
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get the data from backend and display in gridview
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
protected void gv_regioncode_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblregioncode = (Label)e.Row.FindControl("lblregioncode");
GridView gv_regioncodedetails = (GridView)e.Row.FindControl("gv_regioncodedetails");
string strtxtregioncode = lblregioncode.Text;
DBParameterCollection objlstParm = new DBParameterCollection();
objlstParm.Add(new DBParameter() { Value = strtxtregioncode, Name = "@regioncode", Type = DbType.String });
DataTable dtRegioncodeSubDetails = KwynumberReportBLL.GetRegioncodeSubDetails("proc_tradedetails3", objlstParm, CommandType.StoredProcedure);
gv_regioncodedetails.DataSource = dtRegioncodeSubDetails;
gv_regioncodedetails.DataBind();
}
}
catch(Exception ex)
{
throw ex;
}
}
}
}
/////////////////////////////////////////////////////////
/////bal
//////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using Universal.DAL;
using DALC4NET;
namespace Universal.BAL
{
public class KwynumberReportBLL
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : GetZonecodeDetails
// Created on : 20MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for get ZoneCodeDetails Report
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static DataTable GetZonecodeDetails(string commandText, DBParameterCollection paramCollection, CommandType commandType)
{
return GenericStatements.SelectSpAlchemyDBStatment(commandText, paramCollection, commandType);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : GetRegioncodeDetails
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for Get RegioncodeDetails Report
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static DataTable GetRegioncodeDetails(string commandText, DBParameterCollection paramCollection, CommandType commandType)
{
return GenericStatements.SelectSpAlchemyDBStatment(commandText, paramCollection, commandType);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function name : GetRegioncodeSubDetails
// Created on : 21MAYR2015
// Cretaed by: Sreenivasulu G
// Description : Code for Get RegioncodeSubDetails Report
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static DataTable GetRegioncodeSubDetails(string commandText, DBParameterCollection paramCollection, CommandType commandType)
{
return GenericStatements.SelectSpAlchemyDBStatment(commandText, paramCollection, commandType);
}
}
}
/////////////////////////////////////////////////////////
/////dal
//////////////////////////////////
empty
///////////////////////////////////////////
//////common
//////////////////////////////////////////
public static DataTable SelectSqlSP(string commandText, DBParameterCollection paramCollection, CommandType commandType)
{
using (DBHelper objDBHelper = new DBHelper())
{
DataTable table = new DataTable();
var transaction = objDBHelper.BeginTransaction();
try
{
table = objDBHelper.ExecuteDataTable(commandText, paramCollection, commandType);
objDBHelper.CommitTransaction(transaction);
}
catch (Exception err)
{
objDBHelper.RollbackTransaction(transaction);
}
return table;
}
}
Comments
Post a Comment