protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            if (txtBrCode.Text.ToString() == "")
            {
                txtBrCode.Focus();
                WebMsgBox.Show("Enter branch code first", this.Page);
                return;
            }
            else if (txtProdCode.Text.ToString() == "")
            {
                txtProdCode.Focus();
                WebMsgBox.Show("Enter procudt code first", this.Page);
                return;
            }
            else if (txtAsOnDate.Text.ToString() == "")
            {
                txtAsOnDate.Focus();
                WebMsgBox.Show("Enter as on date first", this.Page);
                return;
            }
            else if (txtProdCode2.Text.ToString() == "")
            {
                txtProdCode2.Focus();
                WebMsgBox.Show("Enter product code first ...!!", this.Page);
                return;
            }
            else
            {
                DT = DP.BindData(txtBrCode.Text.ToString(), txtProdCode.Text.ToString(), txtAsOnDate.Text.ToString(), "Trial", DdlRecDiv.SelectedValue.ToString(), DdlRecDept.SelectedValue.ToString(), txtProdCode2.Text.ToString(), Session["MID"].ToString());
                if (DT.Rows.Count > 0)
                {
                    btnSubmit.Visible = false;
                    btnPost.Visible   = true;
                    btnPost.Focus();

                    grdDevident.DataSource = DT;
                    grdDevident.DataBind();
                }
                else
                {
                    btnSubmit.Visible = true;
                    btnPost.Visible   = false;

                    DdlRecDept.Focus();
                    grdDevident.DataSource = null;
                    grdDevident.DataBind();
                }
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
Example #2
0
 protected void DdlRecDiv_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         BindRecDept();
         DdlRecDept.Focus();
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
     }
 }