protected void btnSave_Click(object sender, EventArgs e) { try { if (ddlbank.SelectedValue == "0") { ShowMessage("Please Select Bank Name.", false); ddlbank.Focus(); return; } if (ViewState["grdData"] == null) { ShowMessage("Please Click Add Button For Add Checque Series.", false); txtChequefrom.Focus(); return; } objChkseries = new ChequeSeriesModel(); objChkseries.Ind = 1; objChkseries.OrgID = GlobalSession.OrgID; objChkseries.BrID = GlobalSession.BrID; objChkseries.BankCode = Convert.ToInt32(ddlbank.SelectedValue); if (VSItemsData.Columns.Contains("ID")) { VSItemsData.Columns.Remove("ID"); } objChkseries.DtChkSeries = VSItemsData; string uri = string.Format("ChequeSeries/SaveChkSerices"); DataTable dtSaveChkList = CommonCls.ApiPostDataTable(uri, objChkseries); if (dtSaveChkList.Rows.Count > 0) { ShowMessage("Data Save Sucessfully.", true); ddlbank.Enabled = true; // pnlSectionGrid.Visible = false; ClearAll(); } else { ShowMessage("Data Not Save Sucessfully.", false); return; } } catch (Exception ex) { ShowMessage(ex.Message, false); } }
internal DataTable SaveChkSericesDetail(ChequeSeriesModel ObjChkSeriesModel) { try { ClsCon.cmd = new SqlCommand(); ClsCon.cmd.CommandType = CommandType.StoredProcedure; ClsCon.cmd.CommandText = "SPChequeSeries"; ClsCon.cmd.CommandTimeout = 0; ClsCon.cmd.Parameters.AddWithValue("@Ind", ObjChkSeriesModel.Ind); ClsCon.cmd.Parameters.AddWithValue("@OrgID", ObjChkSeriesModel.OrgID); ClsCon.cmd.Parameters.AddWithValue("@BrID", ObjChkSeriesModel.BrID); // ClsCon.cmd.Parameters.AddWithValue("@YrCode", ObjChkSeriesModel.yrcd); ClsCon.cmd.Parameters.AddWithValue("@BankCode", ObjChkSeriesModel.BankCode); ClsCon.cmd.Parameters.AddWithValue("@ChequeFrom", ObjChkSeriesModel.ChequeFrom); ClsCon.cmd.Parameters.AddWithValue("@ChequeTo", ObjChkSeriesModel.ChequeTo); ClsCon.cmd.Parameters.AddWithValue("@Diffrence", ObjChkSeriesModel.Diffrence); ClsCon.cmd.Parameters.AddWithValue("@TblChequeSeries", ObjChkSeriesModel.DtChkSeries); con = ClsCon.SqlConn(); ClsCon.cmd.Connection = con; dtChequeSeriesDetail = new DataTable(); ClsCon.da = new SqlDataAdapter(ClsCon.cmd); ClsCon.da.Fill(dtChequeSeriesDetail); dtChequeSeriesDetail.TableName = "success"; } catch (Exception) { dtChequeSeriesDetail = new DataTable(); dtChequeSeriesDetail.TableName = "error"; return(dtChequeSeriesDetail); } finally { con.Close(); con.Dispose(); ClsCon.da.Dispose(); ClsCon.cmd.Dispose(); } return(dtChequeSeriesDetail); }
protected void ddlbank_SelectedIndexChanged(object sender, EventArgs e) { if (ddlbank.SelectedValue == "0") { lblMsg.Text = ""; lblMsg.CssClass = ""; } else { lblMsg.Text = ""; lblMsg.CssClass = ""; objChkseries = new ChequeSeriesModel(); objChkseries.Ind = 2; objChkseries.OrgID = GlobalSession.OrgID; objChkseries.BrID = GlobalSession.BrID; objChkseries.BankCode = Convert.ToInt32(ddlbank.SelectedValue); // objChkseries.DtChkSeries = VSItemsData; string uri = string.Format("ChequeSeries/ddlBankSeries"); DataTable dtSearchChkList = CommonCls.ApiPostDataTable(uri, objChkseries); if (dtSearchChkList.Rows.Count > 0) { // pnlSectionGrid.Visible = true; grdchequeseries.DataSource = ViewState["grdData"] = dtSearchChkList; grdchequeseries.DataBind(); } else { grdchequeseries.DataSource = new DataTable(); grdchequeseries.DataBind(); ViewState["grdData"] = null; //ShowMessage("Data Not Available Given Check Series Please Add Cheque Series.", false); return; } } }
public DataTable ddlBankSeries(ChequeSeriesModel ObjChkSeriesModel) { DataTable DDlChkSeriesList = ObjChequeSeriesDA.ddlBankSeriesDetail(ObjChkSeriesModel); return(DDlChkSeriesList); }
public DataTable SaveChkSerices(ChequeSeriesModel ObjChkSeriesModel) { DataTable ChkSeriesList = ObjChequeSeriesDA.SaveChkSericesDetail(ObjChkSeriesModel); return(ChkSeriesList); }