예제 #1
0
 protected void Txtrefcustno_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string sql, AT;
         sql = AT = "";
         string   custname = accop.Getcustname(Txtrefcustno.Text);
         string[] name     = custname.Split('_');
         txtrefcustname.Text = name[0].ToString();
         string RC = txtrefcustname.Text;
         TxtAgentNo.Focus();
         if (RC == "")
         {
             WebMsgBox.Show("Customer not found", this.Page);
             Txtrefcustno.Text = "";
             Txtrefcustno.Focus();
             return;
         }
         if (Txtrefcustno.Text == txtcstno.Text)
         {
             WebMsgBox.Show("Ref Customer No Cannot be same as Customer No", this.Page);
             Txtrefcustno.Text   = "";
             txtrefcustname.Text = "";
             Txtrefcustno.Focus();
         }
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
     }
 }
예제 #2
0
    protected void TxtAgentNo_TextChanged(object sender, EventArgs e)
    {
        try
        {
            DataTable dt1  = new DataTable();
            string    sql1 = "select GLNAME,LASTNO,GLCODE from GLMAST where SUBGLCODE='" + TxtAgentNo.Text + "' AND GLCODE='2' AND BRCD='" + Session["BRCD"].ToString() + "'";
            dt1 = conn.GetDatatable(sql1);

            if (dt1.Rows.Count != 0)
            {
                TxtAgentname.Text      = dt1.Rows[0]["GLNAME"].ToString();
                ViewState["AC"]        = dt1.Rows[0]["LASTNO"].ToString();
                ViewState["DRGL"]      = dt1.Rows[0]["GLCODE"].ToString();
                ViewState["GL"]        = dt1.Rows[0]["GLCODE"].ToString();
                AutoAccname.ContextKey = Session["BRCD"].ToString() + "_" + TxtAgentNo.Text + "_" + ViewState["DRGL"].ToString() + "_" + ViewState["GL"].ToString();
                txtNomName.Focus();
            }
            else
            {
                WebMsgBox.Show("Please Enter the valid Agent No...!!", this.Page);
                TxtAgentNo.Focus();
                TxtAgentNo.Text = "";
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
예제 #3
0
    protected void txtrefcustname_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string   CUNAME  = txtrefcustname.Text;
            string[] custnob = CUNAME.Split('_');
            if (custnob.Length > 1)
            {
                txtrefcustname.Text = custnob[0].ToString();
                Txtrefcustno.Text   = (string.IsNullOrEmpty(custnob[1].ToString()) ? "" : custnob[1].ToString());
                TxtAgentNo.Focus();
            }
            if (Txtrefcustno.Text == txtcstno.Text)
            {
                WebMsgBox.Show("Ref Customer No Cannot be same as Customer No", this.Page);
                txtrefcustname.Text = "";
                Txtrefcustno.Text   = "";

                Txtrefcustno.Focus();
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }