Exemplo n.º 1
0
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string SerNm = drpDwnlstSerNm.SelectedItem.Text;
                BLAddClient blGetSerId = new BLAddClient();
                SqlDataReader drGetSerId = blGetSerId.GetServiceIdByNm1(SerNm);
                if (drGetSerId.HasRows)
                {
                    drGetSerId.Read();

                    lblSerId.Text = Convert.ToString(drGetSerId.GetInt32(0));
                    drGetSerId.Close();
                }
            }
            catch (Exception ex)
            {
                lblCatchError.Text = ex.Message.ToString();
            }
        }
Exemplo n.º 2
0
        protected void UpdateClientDetails(int ClientId)
        {
            try
            {
                BLAddClient blUpClient = new BLAddClient();
                SqlDataReader dr = blUpClient.GetClientDetails(ClientId);
                if (dr.HasRows)
                {
                    dr.Read();
                    txtClientCode.Text = "JMC" + ClientId;
                    txtClientNm.Text = dr.GetString(1);
                    txtadd1.Text = dr.GetString(2);
                    txtadd2.Text = dr.GetString(3);
                    txtadd3.Text = dr.GetString(4);

                    txtPin.Text = dr.GetString(5);
                    if (dr["Telephone"].ToString() == "-")
                    {
                        txtTelClient.Text = "";
                    }
                    else
                    {
                        txtTelClient.Text = dr.GetString(6);
                    }
                    string mobno = dr.GetString(7);
                    if (mobno == "-")
                    {
                        txtMobClient.Text = "";
                    }
                    else
                    {
                        txtMobClient.Text = mobno;
                    }
                    txtPANClient.Text = dr.GetString(8);
                    txtClientBranch.Text = dr.GetString(9);
                    txtCityClient.Text = dr.GetString(10);
                    txtContactPer1.Text = dr.GetString(11);
                    txtContactPer2.Text = dr.GetString(12);
                    txtContactPer3.Text = dr.GetString(13);
                    txtContact1.Text = dr.GetString(14);
                    txtContact2.Text = dr.GetString(15);
                    txtContact3.Text = dr.GetString(16);
                    string email1 = dr.GetString(17);
                    string email2 = dr.GetString(18);
                    string email3 = dr.GetString(19);
                    if (email1 == "-")
                        txtEmailId1.Text = "";
                    else
                        txtEmailId1.Text = email1;
                    if (email2 == "-")

                        txtEmailId2.Text = "";
                    else
                        txtEmailId2.Text = email2;
                    if (email3 == "-")
                        txtEmailId3.Text = "";
                    else

                        txtEmailId3.Text = email3;
                    bool isdel = dr.GetBoolean(20);
                    if (isdel == true)
                        rbtnYesIsDel.Checked = true;
                    else
                        rbtnNoIsDel.Checked = true;
                    txtPrefix.Enabled = false;
                    txtPrefix.Text = dr.GetString(21);
                    int app = dr.GetInt32(22);
                    if (app == 1)
                        chkbxAppCl.Checked = true;
                    else
                        chkbxAppCl.Checked = true;
                    txtSerTaxClient.Text = dr.GetInt32(23).ToString();
                    if (dr["emailinv"] == DBNull.Value)
                    {
                        txtEmlIdInvce.Text = "";
                    }
                    else
                    {
                        txtEmlIdInvce.Text = dr.GetString(24);
                    }
                    if (dr["multiemail"] == DBNull.Value)
                    {
                        txtMulEmailId.Text = "";
                    }
                    else
                    {
                        txtMulEmailId.Text = dr.GetString(25);
                    }

                    dr.Close();
                    btnClearFlds.Enabled = false;
                }
                getServicesForUpdate(ClientId);

            }
            catch (Exception ex)
            {
                lblCatchError.Text = ex.Message.ToString();
            }
        }
Exemplo n.º 3
0
 public int getclientid()
 {
     try
     {
         BLAddClient blgetSer = new BLAddClient();
         SqlDataReader dr = blgetSer.GetClientId1();
         if (dr.HasRows)
         {
             dr.Read();
             ClId = dr.GetInt32(0);
             dr.Close();
         }
         return ClId;
     }
     catch (Exception ex)
     {
         lblCatchError.Text = ex.Message.ToString();
         return 0;
     }
 }