public bool ChkSheduleExists(string BrCode, string CustNo, string SubGlCode, string AccNo) { try { sql = "Select Top 1 1 From LoanSchedule Ls With(NoLock)" + " Where Ls.Brcd = '" + BrCode + "' And Ls.LoanglCode = '" + SubGlCode + "' And Ls.CustAccNo = '" + AccNo + "' And Ls.Stage = 1003"; PA = conn.sExecuteScalar(sql); if (PA == null || PA == "") { res = false; } else { res = true; } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } return(res); }
protected void txtAccType_TextChanged(object sender, EventArgs e) { try { string acct; acct = BD.GetAccTType(txtAccType.Text); if (acct == null) { WebMsgBox.Show("Enter valid account type!!....", this.Page); txtAccType.Text = ""; txtAccType.Focus(); } else { Ddlacctype.SelectedValue = acct; //txtmopr.Focus(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
protected void btnModify_Click(object sender, EventArgs e) { try { CheckStage(); int cnt = ci.ChequeIssueModfy(ViewState["id"].ToString(), Session["BRCD"].ToString(), txtProdCode.Text.ToString(), txtProdName.Text.ToString(), txtAccNo.Text.ToString(), txtAccName.Text.ToString(), txtNoLeaves.Text.ToString(), txtInstFrom.Text, txtInstTo.Text); if (cnt > 0) { BindGrid(); lblMessage.Text = "Successfully Modified..!"; ModalPopup.Show(this.Page); FL = "Insert";//Dhanya Shetty string Res = CLM.LOGDETAILS(FL, Session["BRCD"].ToString(), Session["MID"].ToString(), "ChequeBook_Mod _" + txtProdCode.Text + "_" + txtAccNo.Text + "_" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString()); ClearData(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
public int BindGrid(GridView Gview, string BRCD, string ProdCode, string AccNo, string AsOnDate, string RButton) { try { if (RButton == "S") { sql = "SELECT SUBGLCODE,SUBGLNAME,ACCNO,ACCNAME,NOOFLEAVES,FSERIES,TSERIES,EFFECTDATE FROM AVS_INSTRUMENTISSUE WHERE BRCD = '" + BRCD + "' " + " AND SUBGLCODE = '" + ProdCode + "' AND ACCNO = '" + AccNo + "' AND CONVERT(DATE, EFFECTDATE) <= '" + conn.ConvertDate(AsOnDate).ToString() + "' AND STAGE = 1003"; } else if (RButton == "A") { sql = "SELECT SUBGLCODE,SUBGLNAME,ACCNO,ACCNAME,NOOFLEAVES,FSERIES,TSERIES,EFFECTDATE FROM AVS_INSTRUMENTISSUE WHERE BRCD = '" + BRCD + "' " + " AND CONVERT(DATE, EFFECTDATE) <= '" + conn.ConvertDate(AsOnDate).ToString() + "' AND STAGE = 1003"; } Result = conn.sBindGrid(Gview, sql); } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } return(Result); }
protected void txttynam_TextChanged(object sender, EventArgs e) { try { string CUNAME = txttynam.Text; string[] custnob = CUNAME.Split('_'); if (custnob.Length > 1) { txttynam.Text = custnob[0].ToString(); txttype.Text = (string.IsNullOrEmpty(custnob[1].ToString()) ? "" : custnob[1].ToString()); // TxtGLCD.Text = "";// custnob[2].ToString(); string[] AC = accop.Getaccno(txttype.Text, Session["BRCD"].ToString(), custnob[2].ToString()).Split('-'); ViewState["ACCNO"] = AC[0].ToString(); ViewState["GLCODE"] = AC[1].ToString(); AutoAccname.ContextKey = Session["BRCD"].ToString() + "_" + txttype.Text;// +"_" + ViewState["GLCODE"].ToString(); txtaccno.Focus(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
public string SetNO(string BRCD) //BRCD ADDED --Abhishek { string ST = ""; try { try { sql = " Update avs1000 set Lastno=(SELECT MAX(LASTNO)+1 FROM AVS1000 WHERE SRNO='46' and BRCD='" + BRCD + "') where srno='46' and BRCD='" + BRCD + "' " + " SELECT MAX(LASTNO) FROM AVS1000 WHERE SRNO='46' and BRCD='" + BRCD + "'"; ST = conn.sExecuteScalar(sql); } catch (Exception Ex) { return("-1"); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } return(ST); }
public string FnBl_GetPostingTotal(ClsRecoveryGeneration RS) { string RES = ""; try { if (RS.BANKCODE == "1009") { //Sql = "Exec Isp_Recovery_CustStatement_1009 @Custno='" + RS.CustNo + "',@Flag='" + RS.FL + "',@Brcd='" + RS.BRCD + "',@ForMM='" + RS.MM + "',@ForYY='" + RS.YY + "',@RecCode='" + RS.RECCODE + "',@RecDiv='" + RS.RECDIV + "'"; Sql = "Exec Isp_Recovery_CustStatement_X_1009 @Custno='" + RS.CustNo + "',@Flag='" + RS.FL + "',@Brcd='" + RS.BRCD + "',@ForMM='" + RS.MM + "',@ForYY='" + RS.YY + "',@RecCode='" + RS.RECCODE + "',@RecDiv='" + RS.RECDIV + "'"; } else { Sql = "Exec Isp_Recovery_CustStatement_X @Custno='" + RS.CustNo + "',@Flag='" + RS.FL + "',@Brcd='" + RS.BRCD + "',@ForMM='" + RS.MM + "',@ForYY='" + RS.YY + "',@RecCode='" + RS.RECCODE + "',@RecDiv='" + RS.RECDIV + "'"; } RES = Conn.sExecuteScalar(Sql); } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } return(RES); }
protected void GvPatientDtlsMbno_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "ShowPaitentdetails") { GridViewRow gvrow = (GridViewRow)((Control)e.CommandSource).NamingContainer; LinkButton lblRegNo = (LinkButton)gvrow.FindControl("linkgetregno"); FetchPatientDetails(lblRegNo.Text); lblRegistrationNo.Text = lblRegNo.Text; ViewState["MobileSearch"] = "1"; ViewState["RegNo"] = lblRegNo.Text.Trim(); Panel1.Visible = true; btn_Save.Visible = false; btn_Update.Visible = true; } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx"); } }
public DataSet GetShareMemList(string BrCode, string FDate, string TDate, string EDate, string AppType) { try { sql = "Exec ISP_SHARERPT @BrCode = '" + BrCode + "', @FromDate = '" + conn.ConvertDate(FDate).ToString() + "', @ToDate = '" + conn.ConvertDate(TDate).ToString() + "', @EntryDate = '" + conn.ConvertDate(EDate).ToString() + "', @ApplType = '" + AppType + "'"; DT = new DataTable(); DT = conn.GetDatatable(sql); if (DT.Rows.Count > 0) { DS.Tables.Add(DT); } else { DS = null; } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } return(DS); }
public DataSet GetShareMismatchList(string BrCode, string FDate, string TDate, string EDate, string AppType) { try { sql = "Exec SP_SharesInfoM @BRCD = '" + BrCode + "', @PFDT = '" + conn.ConvertDate(FDate).ToString() + "', @PTDT = '" + conn.ConvertDate(TDate).ToString() + "', @Flag = '" + AppType + "'"; DT = new DataTable(); DT = conn.GetDatatable(sql); if (DT.Rows.Count > 0) { DS.Tables.Add(DT); } else { DS = null; } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } return(DS); }
public static void Main(string[] args) { try { ExceptionLogging.Setup(); using (var fabricRuntime = FabricRuntime.Create()) { // This is the name of the ServiceType that is registered with FabricRuntime. // This name must match the name defined in the ServiceManifest. If you change // this name, please change the name of the ServiceType in the ServiceManifest. fabricRuntime.RegisterServiceType("FabricTableServiceType", typeof(FabricTableService)); ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(FabricTableService).Name); Thread.Sleep(Timeout.Infinite); } } catch (Exception e) { ServiceEventSource.Current.ServiceHostInitializationFailed(e); throw; } }
private void GetCashBook(int CashBookId) { try { DataSet ds = objBACash.GetCashBook(CashBookId); if (ds.Tables[0].Rows.Count > 0) { hf_CashBookId.Value = ds.Tables[0].Rows[0]["CashBookId"].ToString(); txtCashKey.Text = ds.Tables[0].Rows[0]["CashBookKey"].ToString(); txtCashKey.Enabled = false; chkDeactivate.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["Deactivate"]); txtCashDescription.Text = ds.Tables[0].Rows[0]["CashDescription"].ToString(); dropDefaultAction.SelectedIndex = dropDefaultAction.Items.IndexOf(dropDefaultAction.Items.FindByValue(ds.Tables[0].Rows[0]["DefaultAction"].ToString())); txtGICode.Text = ds.Tables[0].Rows[0]["GICode"].ToString(); txtRefFormat.Text = ds.Tables[0].Rows[0]["ReferenceFormat"].ToString(); txtVatCodes.Text = ds.Tables[0].Rows[0]["VatCodes"].ToString(); } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex); } }
public void BindMainAccounts() { try { DataTable dt = new DataTable(); DataSet ds = _objBOUtility.getMainAccounts(); dt = ds.Tables[4]; if (ds.Tables[4].Rows.Count > 0) { txtAccountCode.Text = ds.Tables[4].Rows[0]["MainAccCode"].ToString(); //txt1.Text = objDS.Tables[0].Rows[0]["ColumnName"].ToString(); } else { } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex); } }
public int GetVoucherInfo(GridView Gview, string BrCode, string EDate, string FSetNo, string TSetNo) { try { string[] TD = EDate.Split('/'); string TBNAME = "AVSM_" + TD[2].ToString() + TD[1].ToString(); sql = "Select A.BrCd, ConVert(VarChar(10), A.EntryDate, 103) As EntryDate, A.SetNo, A.ScrollNo, A.SubGlCode, A.AccNo, A.PartiCulars, " + "(Case When A.TrxType = '1' Then A.Amount Else '0' End) As CREDIT, " + "(Case When A.TrxType = '2' Then A.Amount Else '0' End) As DEBIT, U.LoginCode As Maker From " + TBNAME + " A With(NoLock) " + "Left Join UserMaster U With(NoLock) On A.MID = U.PERMISSIONNO " + "WHERE A.BRCD = '" + BrCode + "' And A.EntryDate = '" + conn.ConvertDate(EDate) + "' " + "And A.SetNo Between '" + FSetNo + "' And '" + TSetNo + "' And A.Stage Not In (1003, 1004) " + "And A.SetNo < 20000 And Activity Not In (31, 32) And PmtMode Not In ('IC','OC') " + "Order By EntryDate, SetNo, ScrollNo"; Result = conn.sBindGrid(Gview, sql); } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } return(Result); }
public int UpdateLastno(string brcd, string subgl, string ACCNO)//added by ankita to update lastno 15/07/2017 { try { sql = "select LASTNO from glmast where brcd='" + brcd + "' and SUBGLCODE='" + subgl + "'"; sResult = conn.sExecuteScalar(sql); if (sResult != ACCNO) { sql1 = "update Glmast set LASTNO=(select (max(accno)) from Avs_Acc Where Brcd='" + brcd + "' And Subglcode='" + subgl + "') Where Brcd='" + brcd + "' And Subglcode='" + subgl + "'"; Result = conn.sExecuteQuery(sql1); } else { sql1 = "update Glmast set LASTNO=LASTNO-1 Where Brcd='" + brcd + "' And Subglcode='" + subgl + "'"; Result = conn.sExecuteQuery(sql1); } } catch (Exception ex) { ExceptionLogging.SendErrorToText(ex); } return(Result); }
public void Viewdata() { try { DataTable dt1 = new DataTable(); dt1 = objDist.viewBreedDtlsBAL(ddl_AnimalType.SelectedValue.ToString(), ConnKey); GvBreed.DataSource = dt1; GvBreed.DataBind(); if (dt1.Rows.Count > 0) { GvBreed.HeaderRow.Cells[0].Attributes["data-class"] = "expand"; GvBreed.HeaderRow.Cells[1].Attributes["data-hide"] = "phone"; GvBreed.HeaderRow.Cells[2].Attributes["data-hide"] = "phone"; GvBreed.HeaderRow.Cells[3].Attributes["data-hide"] = "phone"; GvBreed.HeaderRow.TableSection = TableRowSection.TableHeader; } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx"); } }
public int Getinfotable(GridView Gview, string smid, string sbrcd, string EDT) { try { string[] TD; TD = EDT.Split('/'); sql = " Select convert(varchar(10),a.SETNO)+'_'+convert(varchar(10),a.Amount) Dens,A.SETNO SETNO, ACC.SUBGLCODE AT, A.ACCNO ACNO, M.CUSTNAME CUSTNAME, A.Amount, " + " A.PARTICULARS PARTICULARS, A.INSTRUMENTNO, Convert(VarChar(10), A.INSTRUMENTDATE, 103) As InstDate, UM.USERNAME MAKER from AVSM_" + TD[2].ToString() + TD[1].ToString() + " A With(NoLock) " + " Inner Join USERMASTER UM With(NoLock) ON UM.PERMISSIONNO=A.MID " + " Inner Join AVS_ACC ACC With(NoLock) ON ACC.ACCNO=A.ACCNO And ACC.BRCD = A.BRCD And A.SUBGLCODE=ACC.SUBGLCODE " + " Inner Join MASTER M With(NoLock) ON M.CUSTNO=ACC.CUSTNO " + " Where A.BRCD='" + sbrcd + "' And A.STAGE = '1001' And A.Amount <> '0' And Trxtype = '2' And A.MID='" + smid + "' And A.ACTIVITY='4' " + " And A.ENTRYDATE = '" + conn.ConvertDate(EDT) + "' Order By A.SETNO,A.SCROLLNO"; IntResult = conn.sBindGrid(Gview, sql); } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } return(IntResult); }
protected void btnDelete_Click(object sender, EventArgs e) { try { CheckStage(); int cnt = CK.ChequeStockDel(ViewState["id"].ToString(), Session["BRCD"].ToString()); if (cnt > 0) { BindGrid(); FL = "Insert";//Dhanya Shetty string Res = CLM.LOGDETAILS(FL, Session["BRCD"].ToString(), Session["MID"].ToString(), "ChequeStock_Del _" + txtProdCode.Text + "_" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString()); lblMessage.Text = "Successfully Deleted..!"; ModalPopup.Show(this.Page); ClearData(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
protected void Btn_Details_Click(object sender, EventArgs e) { try { int RES; if (DdlDuartion.SelectedValue == "M") { RES = FD.GetGridData(Grd_Details, "ALL", TxtPrinciAmount.Text, TxtPeriod.Text, TxtROI.Text, "M"); FL = "Insert";//Dhanya Shetty string Res = CLM.LOGDETAILS(FL, Session["BRCD"].ToString(), Session["MID"].ToString(), "FDcalculator _" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString()); } else { RES = FD.GetGridData(Grd_Details, "FDS", TxtPrinciAmount.Text, TxtPeriod.Text, TxtROI.Text, "D"); FL = "Insert";//Dhanya Shetty string Res = CLM.LOGDETAILS(FL, Session["BRCD"].ToString(), Session["MID"].ToString(), "FDcalculator _" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString()); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
public string GetAgentName_IR(string AGNO, string BRCD) { try { //sql = "select GLNAME+'_'+glcode from GLMAST where SUBGLCODE='" + AGNO + "' AND GLCODE='' AND BRCD='" + BRCD + "'"; // sql = "SELECT GLNAME+'_'+CONVERT(varchar(10), GLCODE)+'_'+CONVERT(varchar(10), PLACCNO) FROM GLMAST WHERE SUBGLCODE='" + AGNO + "' AND GLCODE in (2,1) AND BRCD='" + BRCD + "'"; // CHANGED and Above Commented FOR NULL EXCEPTION WHEN AGENT NUMBER IS SEARCHED --Abhishek sql = "SELECT (CASE WHEN cOUNT(A)=0 THEN '0' " + " ELSE (SELECT GLNAME+'_'+CONVERT(varchar(10), GLCODE)+'_'+CONVERT(varchar(10), isnull(IR,0))+'_'+CONVERT(varchar(10), isnull(PLACCNO,0)) AS A " + " FROM GLMAST WHERE SUBGLCODE='" + AGNO + "' AND GLCODE in (2,1) AND BRCD='" + BRCD + "') END) " + " FROM (SELECT GLNAME+'_'+CONVERT(varchar(10), GLCODE)+'_'+CONVERT(varchar(10), isnull(IR,0))+'_'+CONVERT(varchar(10), isnull(PLACCNO,0)) AS A " + " FROM GLMAST WHERE SUBGLCODE='" + AGNO + "' AND GLCODE in (2,1) AND BRCD='" + BRCD + "') AS B "; AGNO = conn.sExecuteScalar(sql); return(AGNO); } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); //HttpContext.Current.//Response.Redirect("FrmLogin.aspx", true); } return(AGNO); }
protected void txtaccname_TextChanged(object sender, EventArgs e) { try { string CUNAME = txtaccname.Text; string[] custnob = CUNAME.Split('_'); if (custnob.Length > 1) { txtaccname.Text = custnob[0].ToString(); txtaccno.Text = custnob[1].ToString(); } else { WebMsgBox.Show("Account Number is Invalid....!", this.Page); txtaccno.Text = ""; txtaccno.Focus(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
protected void Clear() { try { txtProdType1.Text = ""; txtProdName1.Text = ""; TxtAccNo1.Text = ""; TxtAccName1.Text = ""; txtBalance.Text = ""; TxtChequeNo.Text = ""; TxtChequeDate.Text = ""; TxtChequeDate.Text = Session["EntryDate"].ToString(); txtProdType1.Focus(); } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } finally { txtProdType1.Focus(); } }
void SearchItemFromList(string SearchText) { try { if (Session["dt"] != null) { DataTable dt = (DataTable)Session["dt"]; DataRow[] dr = dt.Select( "Comkey='" + SearchText + "' OR ComDesc LIKE '%" + SearchText + "%' OR CategoryName LIKE '%" + SearchText + "%' OR TypeName LIKE '%" + SearchText + "%' OR VatRate LIKE '%" + SearchText + "%' OR ComZUTypeDesc LIKE '%" + SearchText + "%'"); if (dr.Count() > 0) { gvCommTypeList.PageSize = int.Parse(ViewState["ps"].ToString()); gvCommTypeList.DataSource = dr.CopyToDataTable(); gvCommTypeList.DataBind(); } else { gvCommTypeList.DataSource = null; gvCommTypeList.DataBind(); Label lblEmptyMessage = gvCommTypeList.Controls[0].Controls[0].FindControl("lblEmptyMessage") as Label; lblEmptyMessage.Text = "Currently there are no records in" + " '" + SearchText + "'"; } } } catch (Exception ex) { lblMsg.Text = _objBOUtiltiy.ShowMessage("danger", "Danger", ex.Message); ExceptionLogging.SendExcepToDB(ex); } }
private void BindVatDetails() { try { gvVatList.PageSize = int.Parse(ViewState["ps"].ToString()); int VatId = 0; DataSet ds = objBAVatType.GetVatType(VatId); Session["dt"] = ds.Tables[0]; if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { gvVatList.DataSource = ds.Tables[0]; string sortDirection = "ASC", sortExpression; if (ViewState["so"] != null) { sortDirection = ViewState["so"].ToString(); } if (ViewState["se"] != null) { sortExpression = ViewState["se"].ToString(); ds.Tables[0].DefaultView.Sort = sortExpression + " " + sortDirection; } gvVatList.DataBind(); } else { gvVatList.DataSource = null; gvVatList.DataBind(); Label lblEmptyMessage = gvVatList.Controls[0].Controls[0].FindControl("lblEmptyMessage") as Label; lblEmptyMessage.Text = "Currently there are no records in System"; } } catch (Exception ex) { lblMsg.Text = ""; ExceptionLogging.SendExcepToDB(ex); } }
protected void txtBrCode_TextChanged(object sender, EventArgs e) { try { if (txtBrCode.Text.ToString() != "") { string BrName = AC.GetBranchName(txtBrCode.Text.ToString()); if (BrName != null || BrName != "") { ClearProdText(); AutoGlName.ContextKey = txtBrCode.Text.ToString(); txtBrName.Text = BrName; btnSubmit.Visible = true; btnChange.Visible = false; txtProdType.Focus(); } else { ClearAllData(); WebMsgBox.Show("Enter valid branch code...!!", this.Page); txtBrCode.Focus(); } } else { WebMsgBox.Show("Enter branch code first...!!", this.Page); txtBrName.Text = ""; txtBrCode.Text = ""; txtBrCode.Focus(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
protected void btnPrint_Click(object sender, EventArgs e) { try { DT1 = LRA.CheckPrInt(Session["BRCD"].ToString(), txtProdCode.Text, txtaccno.Text, Session["EntryDate"].ToString()); if (DT1.Rows.Count > 0) { Principle = DT1.Rows[0]["Principle"].ToString(); Interest = DT1.Rows[0]["Interest"].ToString(); CurrInteresr = DT1.Rows[0]["CurrInterest"].ToString(); } if (Principle == "0.00" && Interest == "0.00" && CurrInteresr == "0.00") { FL = "Insert";//Dhanya Shetty string Res = CLM.LOGDETAILS(FL, Session["BRCD"].ToString(), Session["MID"].ToString(), "LoanClosure _Rpt_" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString()); if (Rdb_No.SelectedValue == "1") { string redirectURL = "FrmRView.aspx?BRCD=" + Session["BRCD"].ToString() + "&LOANGL=" + txtProdCode.Text + "&Edate=" + Session["ENTRYDATE"].ToString() + "&ACCNO=" + txtaccno.Text + "&rptname=RptAVS5066.rdlc"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('" + redirectURL + "','_blank')", true); } else if (Rdb_No.SelectedValue == "2") { string redirectURL = "FrmRView.aspx?BRCD=" + Session["BRCD"].ToString() + "&LOANGL=" + txtProdCode.Text + "&Edate=" + Session["ENTRYDATE"].ToString() + "&ACCNO=" + txtaccno.Text + "&rptname=RptLoanclosure.rdlc"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('" + redirectURL + "','_blank')", true); } } else { WebMsgBox.Show("Account has balance !!!", this.Page); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
protected void GVType_RowCommand(object sender, GridViewCommandEventArgs e) { check(); try { if (e.CommandName == "edt") { GridViewRow gvrow = (GridViewRow)((Control)e.CommandSource).NamingContainer; txttype.Text = ((Label)(gvrow.FindControl("lblName"))).Text; Session["SampleCode"] = ((Label)(gvrow.FindControl("lblSampTypeCode"))).Text; btnUpdate.Visible = true; BtnSave.Visible = false; BindGrid(); } if (e.CommandName == "dlt") { GridViewRow gvrow = (GridViewRow)((Control)e.CommandSource).NamingContainer; objBE.CatId = ((Label)(gvrow.FindControl("lblSampTypeCode"))).Text; objBE.Action = "D"; dt = ObjDL.CategoryIUDR(objBE, con); if (dt.Rows.Count > 0) { ObjCommon.ShowAlertMessage("Delete failed, please try again"); } else { ObjCommon.ShowAlertMessage("Your data has been Delete successfully"); } BindGrid(); } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UserId"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("../Error.aspx"); } }
void SearchItemFromList(string SearchText) { try { if (Session["dt"] != null) { DataTable dt = (DataTable)Session["dt"]; DataRow[] dr = dt.Select( "InvDate='" + SearchText + "' OR clientemail LIKE '%" + SearchText + "%' OR clientname LIKE '%" + SearchText + "%' OR consultantName LIKE '%" + SearchText + "%' OR PFInvOrder LIKE '%" + SearchText + "%' OR Convert(PFInvoiceTotal,'System.String') LIKE '%" + SearchText + "%'"); if (dr.Count() > 0) { gvPFInvoiceList.PageSize = int.Parse(ViewState["ps"].ToString()); gvPFInvoiceList.DataSource = dr.CopyToDataTable(); gvPFInvoiceList.DataBind(); } else { gvPFInvoiceList.DataSource = null; gvPFInvoiceList.DataBind(); Label lblEmptyMessage = gvPFInvoiceList.Controls[0].Controls[0].FindControl("lblEmptyMessage") as Label; lblEmptyMessage.Text = "Currently there are no records in" + " '" + SearchText + "'"; } } } catch (Exception ex) { lblMsg.Text = _BOUtility.ShowMessage("danger", "Danger", ex.Message); ExceptionLogging.SendExcepToDB(ex); } }
protected void AssignInsrtdata(DataTable dt) { try { AID = dt.Rows[0]["AID"].ToString(); PostingDate = dt.Rows[0]["PostingDate"].ToString(); FundingDate = dt.Rows[0]["FundingDate"].ToString(); PARTICULARS2 = dt.Rows[0]["PARTICULARS2"].ToString(); AMOUNT_1 = dt.Rows[0]["AMOUNT_1"].ToString(); AMOUNT_2 = dt.Rows[0]["AMOUNT_2"].ToString(); INSTRUMENTNO = dt.Rows[0]["INSTRUMENTNO"].ToString(); INSTRUMENTDATE = dt.Rows[0]["InstDate"].ToString(); INSTBANKCD = dt.Rows[0]["INSTBANKCD"].ToString(); INSTBRCD = dt.Rows[0]["INSTBRCD"].ToString(); RTIME = dt.Rows[0]["RTIME"].ToString(); MID = dt.Rows[0]["MID"].ToString(); CID = dt.Rows[0]["CID"].ToString(); VID = dt.Rows[0]["VID"].ToString(); PCMAC = dt.Rows[0]["PCMAC"].ToString(); PAYMAST = dt.Rows[0]["PAYMAST"].ToString(); RefBrcd = dt.Rows[0]["RefBrcd"].ToString(); RecPrint = dt.Rows[0]["RecPrint"].ToString(); OrgBrCd = dt.Rows[0]["OrgBrCd"].ToString(); ResBrCd = dt.Rows[0]["ResBrCd"].ToString(); RefId = dt.Rows[0]["RefId"].ToString(); TokenNo = dt.Rows[0]["TokenNo"].ToString(); Ref_Agent = dt.Rows[0]["Ref_Agent"].ToString(); stage = dt.Rows[0]["stage"].ToString(); Entrydate = dt.Rows[0]["Entrydate"].ToString(); Custname = AF.Getcustname(txtbrcd.Text, txtcstno.Text); Scrollno = AF.Getscrollno(Session["BRCD"].ToString(), ViewState["SETNO"].ToString(), Entrydate); } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
// Write methods here private void BindGrid() { try { DataTable table = new DataTable(); table.Columns.Add("Heading1", typeof(int)); table.Columns.Add("Heading2", typeof(string)); table.Columns.Add("Heading3", typeof(string)); // Here we add five DataRows. table.Rows.Add(25, "Indocin", "David"); table.Rows.Add(50, "Enebrel", "Sam"); table.Rows.Add(10, "Hydralazine", "Christoff"); table.Rows.Add(21, "Combivent", "Janet"); table.Rows.Add(100, "Dilantin", "Melanie"); if (table.Rows.Count > 0) { gvSample.DataSource = table; gvSample.DataBind(); _objBOUtiltiy.ShowMessage("sucess", "Success", "Find Data"); } else { gvSample.DataSource = null; gvSample.DataBind(); _objBOUtiltiy.ShowMessage("info", "Info", "Data not found"); } } catch (Exception ex) { lblMsg.Text = _objBOUtiltiy.ShowMessage("danger", "Error", ex.Message); ExceptionLogging.SendExcepToDB(ex); } }