예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            grid();
            grp_bind();
            // dwd_grp.Items.Insert(0, new ListItem("---Select Group---", "0"));
            fillstate();
            fillcity();
            //dwd_st.Items.Insert(0, new ListItem("", "1"));
            //dwd_ct.Items.Insert(0, new ListItem("", "1"));
            if (Request.QueryString["cmp"] != "" && Request.QueryString["cmp"] != null)
            {
                bl.id = Convert.ToInt32(Request.QueryString["cmp"].ToString());
                DataSet ds = new DataSet();
                ds = dl.select_itm_cmp(bl);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    TextBox1.Text   = ds.Tables[0].Rows[0]["company_name"].ToString();
                    dwd_grp.Text    = ds.Tables[0].Rows[0]["grp_id"].ToString();
                    txt_nik.Text    = ds.Tables[0].Rows[0]["nick_nm"].ToString();
                    txt_con_nm.Text = ds.Tables[0].Rows[0]["contact_per_name"].ToString();
                    txt_add1.Text   = ds.Tables[0].Rows[0]["address_1"].ToString();
                    txt_add2.Text   = ds.Tables[0].Rows[0]["address_2"].ToString();
                    dwd_st.Text     = ds.Tables[0].Rows[0]["state_id"].ToString();
                    bl.state_id     = Convert.ToInt32(dwd_st.SelectedValue.ToString());
                    DataSet ds_state = new DataSet();
                    ds_state              = dl.selectcity(bl);
                    dwd_ct.DataSource     = ds_state;
                    dwd_ct.DataTextField  = "city_name";
                    dwd_ct.DataValueField = "city_id";
                    dwd_ct.DataBind();
                    dwd_ct.Text  = ds.Tables[0].Rows[0]["city_id"].ToString();
                    txt_pin.Text = ds.Tables[0].Rows[0]["pin"].ToString();

                    TextBox13_ph.Text  = ds.Tables[0].Rows[0]["contact_no"].ToString();
                    txt_vat.Text       = ds.Tables[0].Rows[0]["vat"].ToString();
                    txt_vat_dt.Text    = ds.Tables[0].Rows[0]["tin_date"].ToString();
                    hp_vat.NavigateUrl = ds.Tables[0].Rows[0]["tin_attch"].ToString();
                    // cst_date.Text = ds.Tables[0].Rows[0]["cst_date"].ToString();
                    txt_st.Text        = ds.Tables[0].Rows[0]["st"].ToString();
                    txt_pan.Text       = ds.Tables[0].Rows[0]["pan"].ToString();
                    txt_tds.Text       = ds.Tables[0].Rows[0]["tds"].ToString();
                    txt_cst.Text       = ds.Tables[0].Rows[0]["cst"].ToString();
                    cst_date.Text      = ds.Tables[0].Rows[0]["cst_date"].ToString();
                    hp_cst.NavigateUrl = ds.Tables[0].Rows[0]["cst_attch"].ToString();
                    TextBox5_ecc.Text  = ds.Tables[0].Rows[0]["ecc"].ToString();
                    txt_crd_limit.Text = ds.Tables[0].Rows[0]["credit_limit"].ToString();
                    txt_b_nm.Text      = ds.Tables[0].Rows[0]["bank_name"].ToString();
                    txt_acno.Text      = ds.Tables[0].Rows[0]["ac_no"].ToString();
                    txt_bch.Text       = ds.Tables[0].Rows[0]["branch"].ToString();
                    txt_i.Text         = ds.Tables[0].Rows[0]["ifsc"].ToString();
                    txt_bsr_cmp.Text   = ds.Tables[0].Rows[0]["bsr"].ToString();
                    cst_date.Text      = ds.Tables[0].Rows[0]["cst_date"].ToString();
                }
                Button2.Visible = false;
                Button4.Visible = true;
            }
            TextBox1.Focus();
        }
    }