Esempio n. 1
0
    protected void GrdCustviewM_RowEditing(object sender, GridViewEditEventArgs e)
    {
        try
        {
            string CustCode = ((Label)GrdCustviewM.Rows[e.NewEditIndex].FindControl("lblCustCodeM")).Text;
            //  string DC = ((Label)GrdCustview.Rows[e.NewEditIndex].FindControl("lblDC1")).Text;

            DataTable dt4 = new DataTable();
            dt4 = DCReturnBook.GetCustAddress(CustCode, "RtdBkCustlist").Tables[0];

            if (dt4.Rows.Count > 0)
            {
                lbl4CustName.Text    = dt4.Rows[0]["CustName"].ToString();
                lbl4CustAddress.Text = dt4.Rows[0]["Address"].ToString();
            }

            Grd4.DataSource = DCReturnBook.Get_DC_ReturnBook(CustCode, "DCRTDBook").Tables[0];
            Grd4.DataBind();

            Pnl5CustDetails.Visible = false;
            Pnl5.Visible            = false;
            Pnl4CustDetails.Visible = true;
            Pnl4.Visible            = true;
            PnlCustDetails.Visible  = false;
            Pnl3.Visible            = false;
            Pnlview.Visible         = false;
            PnlBkdetails.Visible    = false;
            Pnl4view.Visible        = false;
            Pnl4Bkdetails.Visible   = false;
        }
        catch
        {
        }
    }
Esempio n. 2
0
    protected void Grdcustview_RowEditing(object sender, GridViewEditEventArgs e)
    {
        try
        {
            string CustCode = ((Label)GrdCustview.Rows[e.NewEditIndex].FindControl("lblCustCode1")).Text;
            string DC       = ((Label)GrdCustview.Rows[e.NewEditIndex].FindControl("lblDC1")).Text;

            if (DC == "Y")
            {
                DataTable dt5 = new DataTable();
                dt5 = DCReturnBook.GetCustAddress(CustCode, "RtdBkCustlist").Tables[0];

                if (dt5.Rows.Count > 0)
                {
                    lbl5CustName.Text    = dt5.Rows[0]["CustName"].ToString();
                    lbl5CustAddress.Text = dt5.Rows[0]["Address"].ToString();
                }
                Grd5.DataSource = CreditNote.Get_DC_CNBook(Convert.ToInt32(strFY), CustCode, "DCRTDBookAll").Tables[0];
                Grd5.DataBind();

                PnlCustview.Visible     = false;
                Pnl5CustDetails.Visible = true;
                Pnl5.Visible            = true;
                Pnl4CustDetails.Visible = false;
                Pnl4.Visible            = false;
            }
            else
            if (DC == "N")
            {
                DataTable dt4 = new DataTable();
                dt4 = DCReturnBook.GetCustAddress(CustCode, "RtdBkCustlist").Tables[0];

                if (dt4.Rows.Count > 0)
                {
                    lbl4CustName.Text    = dt4.Rows[0]["CustName"].ToString();
                    lbl4CustAddress.Text = dt4.Rows[0]["Address"].ToString();
                }

                Grd4.DataSource = CreditNote.Get_DC_CNBook(Convert.ToInt32(strFY), CustCode, "DCRTDBook").Tables[0];
                Grd4.DataBind();

                PnlCustview.Visible     = false;
                Pnl5CustDetails.Visible = false;
                Pnl5.Visible            = false;
                Pnl4CustDetails.Visible = true;
                Pnl4.Visible            = true;
            }
        }
        catch
        {
        }
    }