Exemple #1
0
    public void fillEditForm()
    {
        Clear();
        DataSet   ds = G_GetPass.GetpassOnDocNo(Convert.ToInt32(txtDocIdEdit.Text.Trim()), "O", Convert.ToInt32(strFY));
        DataTable dt = ds.Tables[0];

        if (dt.Rows.Count > 0)
        {
            string date = (Convert.ToDateTime(dt.Rows[0]["Doc_Date"].ToString())).ToString("dd/MM/yyyy");
            txtDocNo.Text   = dt.Rows[0]["Doc_No"].ToString();
            lblDocNo.Text   = dt.Rows[0]["Doc_ID"].ToString();
            txtDocDate.Text = date;
            fillTopGrid(ds.Tables[0]);
            filltempData(ds.Tables[1]);
            CallButonVisible("edit");
            txtDocDate.Focus();
        }
        else
        {
            MessageBox("Info! : \\r\\n Doc. No. " + txtDocIdEdit.Text.Trim() + " Not Found!!!");
            ModalPopUpDocNum.Show();
            txtDocIdEdit.Text = "";
            txtDocIdEdit.Focus();
        }
    }
 protected void btnEdit_Click(object sender, EventArgs e)
 {
     ModalPopUpDocNum.Show();
     TxtDocNo.Focus();
     Upanelcust.Update();
     Bindcustomer();
 }
    protected void BtnGetDCDetails_Click(object sender, EventArgs e)
    {
        //ModalPopUpDocNum.Hide();
        //Session["tempDCData"] = null;

        int DocNum = Convert.ToInt32(TxtDocNo.Text.Trim());


        DataTable dt = new DataTable();

        dt = PurchaseMaster.Get_PurchaseDetails(DocNum, Convert.ToDateTime("2011/01/01"), Convert.ToDateTime("2011/01/01")
                                                , Convert.ToInt32(strFY), "ACEDIT", 0, 0).Tables[0];

        if (dt.Rows.Count > 0)
        {
            lblshow.Text      = dt.Rows[0]["SuppliersRef"].ToString();
            txtSupplier.Text  = dt.Rows[0]["SuppliersRefCode"].ToString();
            txtPurchase.Text  = dt.Rows[0]["PurchaseCode"].ToString();
            lblpurchase.Text  = dt.Rows[0]["PurchaseName"].ToString();
            txtDate.Text      = dt.Rows[0]["InvoiceDate"].ToString();
            txtInvoiceNo.Text = dt.Rows[0]["InvoiceNo"].ToString();
            lblID.Text        = dt.Rows[0]["PurchaseMasterID"].ToString();

            try
            {
                //txtPercentage.Text = dt.Rows[0]["vat"].ToString();
                txtVatAmt.Text         = dt.Rows[0]["vat"].ToString();
                ddlmsoms.SelectedValue = dt.Rows[0]["ms_oms"].ToString();
                ddlVat.SelectedValue   = dt.Rows[0]["vat"].ToString();
                txtremark.Text         = dt.Rows[0]["remark"].ToString();
            }
            catch (Exception ex)
            {
            }
            gvPurchasing.DataSource = dt;
            gvPurchasing.DataBind();
            Session["tempdata"] = dt;
            btn_Save.Visible    = true;
            txtCode.Text        = "MIS";
            txtQuantity.Text    = "1";
            txtRate.Focus();
        }
        else
        {
            message("Record not found for document no. " + TxtDocNo.Text);
            ModalPopUpDocNum.Show();
            TxtDocNo.Text = "";
            TxtDocNo.Focus();
            btn_Save.Visible = false;
        }
    }
Exemple #4
0
    public void fillEditForm()
    {
        Clear();
        DataTable dt = G_CN.GetCNOnDocNo(0, txtDocIdEdit.Text.Trim(), Convert.ToInt32(strFY)).Tables[0];

        if (dt.Rows.Count > 0)
        {
            DataTable dt1 = new DataTable();

            dt1.Columns.Add("GCN_ID");
            dt1.Columns.Add("GCN_NO");
            dt1.Columns.Add("GCN_Date");
            dt1.Columns.Add("SALES_REP");
            dt1.Columns.Add("SCHL_ID");
            dt1.Columns.Add("SCHL_NAME");
            dt1.Columns.Add("SCHL_AREA");
            dt1.Columns.Add("SALES_CN_NO");
            dt1.Columns.Add("NAR");



            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt1.Rows.Add(dt.Rows[i]["GCN_ID"].ToString(), dt.Rows[i]["GCN_NO"].ToString(), dt.Rows[i]["GCN_DATE"].ToString(), dt.Rows[i]["SALES_REPRESENTATIVE"].ToString(), dt.Rows[i]["SCHL_ID"].ToString(), dt.Rows[i]["SCHL_NAME"].ToString(), dt.Rows[i]["AREA"].ToString(), dt.Rows[i]["SALESMAN_CN_NO"].ToString(), dt.Rows[i]["Narration"].ToString());
            }
            Session["getcntempdata"] = dt1;
            grdTemp.DataSource       = Session["getcntempdata"];
            grdTemp.DataBind();
            //string date = (Convert.ToDateTime(dt.Rows[0]["GCN_DATE"].ToString())).ToString("dd/MM/yyyy");
            //lblDocNo.Text = dt.Rows[0]["GCN_ID"].ToString();
            //lblID.Text = dt.Rows[0]["GCN_ID"].ToString();
            //txtGCNNo.Text = dt.Rows[0]["GCN_NO"].ToString();
            //txtSalesREp.Text = dt.Rows[0]["SALES_REPRESENTATIVE"].ToString();
            //lblCustomer.Text = dt.Rows[0]["CustomerName"].ToString();
            //lblSchoolID.Text = dt.Rows[0]["SCHL_ID"].ToString();
            //txtSchool.Text = dt.Rows[0]["SCHL_NAME"].ToString();
            //txtArea.Text = dt.Rows[0]["AREA"].ToString();
            //txtSalesManRecNo.Text = dt.Rows[0]["SALESMAN_CN_NO"].ToString();
            //txtNarration.Text = dt.Rows[0]["Narration"].ToString();
            //txtGCNDate.Text = date;
            //CallButonVisible("edit");
            //txtGCNNo.Focus();
        }
        else
        {
            MessageBox("Info! : \\r\\n GCN. No. " + txtDocIdEdit.Text.Trim() + " Not Found!!!");
            //txtDocIdEdit.Text = "";
            //txtDocIdEdit.Focus();
            ModalPopUpDocNum.Show();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ChetanaCompanyName"] != null)
        {
            if (Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();
            }
            else
            {
                Session.Clear();
            }
        }
        if (!IsPostBack)
        {
            //SetView();
            // BindExpensehead();
            ModalPopUpDocNum.Show();

            lblID.Text                    = "0";
            lblID1.Text                   = "0";
            lbl2ID.Text                   = "0";
            Session["tempdata"]           = null;
            pnlpurch.Visible              = true;
            btn_Save.Visible              = true;
            gvPurchasing.Visible          = true;
            lblDescriptionofGoods.Visible = true;
            SetView();
            fillddlVat();
            //  txtPurchase.Focus();

            try
            {
                txtDate.Text = System.DateTime.Now.ToString("dd/MM/yyyy");
            }
            catch
            {
            }
            if (gvPurchasing.Rows.Count <= 0)
            {
                lblGrandTot.Text = "0";
                lblVatAmt.Text   = "0";
                lblSubTotal.Text = "0";
            }
            TxtDocNo.Focus();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ChetanaCompanyName"] != "" || Session["ChetanaCompanyName"] != null)
        {
            if (Session["FY"] != "" || Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();
            }
            else
            {
                Session.Clear();
            }
        }
        if (!Page.IsPostBack)
        {
            GetValidation(3, Convert.ToInt32(Session["Role"]));
            ModalPopUpDocNum.Show();
            TxtDocNo.Focus();

            string grp = "BookSet";
            DDLSelectSet.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown");
            DDLSelectSet.DataBind();
            DDLSelectSet.Items.Insert(0, new ListItem("-Select book set-", "0"));

            string std = "Standard";
            DDLstandard.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(std, "DropDown");
            DDLstandard.DataBind();
            DDLstandard.Items.Insert(0, new ListItem("-STD-", "0"));
            //   txtdocDate.Text = DateTime.Now.ToString(sDateFormat);
            txtChalDate.Text = DateTime.Now.ToString(sDateFormat);
            //  txtDeliverydte.Text = DateTime.Now.ToString(sDateFormat);
            //    txtOrdDate.Text = DateTime.Now.ToString(sDateFormat);
            //txtorder.Focus();
            Session["tempDCData"] = null;
            // Openpopup(2).;
            // btncancel.Visible = false;
            //Session["tempDCData"] = null;
            Bindcustomer();
            // DCMaster.Get_Transporter(custcode);
            lblZoneCode.Visible = false;
            DDLZone.Visible     = false;
        }
    }
Exemple #7
0
    protected void img01_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton img = (ImageButton)(sender);

        if (img.CommandName.ToLower() == "p")
        {
            grdconfirm.DataSource = DCDetails.Idv_Get_DCDetails_By_DocNo(Convert.ToInt32(img.CommandArgument.Trim()),
                                                                         "helpdesk", Convert.ToInt32(0)).Tables[1];
            grdconfirm.DataBind();
            ModalPopUpDocNum.Show();
            UpdatePanel7.Update();
        }
        else
        {
            stDS = DCDetails.Get_SubDocId_And_ItsRecords_By_DocNo(Convert.ToInt32(img.CommandArgument.Trim()), "helpdesk",
                                                                  Convert.ToInt32(0));
            RepDetailsApprove.DataSource = stDS.Tables[0];
            RepDetailsApprove.DataBind();
            ModalPopupExtender1.Show();
            UpdatePanel8.Update();
        }
    }
Exemple #8
0
    public void fillEditForm()
    {
        Clear();
        DataTable dt = G_GetPass.GetpassOnDocNo(Convert.ToInt32(txtDocIdEdit.Text.Trim()), "O", Convert.ToInt32(strFY)).Tables[0];

        if (dt.Rows.Count > 0)
        {
            string date   = (Convert.ToDateTime(dt.Rows[0]["Doc_Date"].ToString())).ToString("dd/MM/yyyy");
            string LRdate = (Convert.ToDateTime(dt.Rows[0]["LR_Date"].ToString())).ToString("dd/MM/yyyy");
            txtDocNo.Text              = dt.Rows[0]["Doc_No"].ToString();
            lblDocNo.Text              = dt.Rows[0]["Doc_ID"].ToString();
            txtDcNo.Text               = dt.Rows[0]["DC_No"].ToString();
            txtBillNo.Text             = dt.Rows[0]["Bill_Nos"].ToString();
            lblclone.Text              = dt.Rows[0]["Bill_Nos"].ToString();
            txtcustomer.Text           = dt.Rows[0]["CustomerName"].ToString();
            lblCustID.Text             = dt.Rows[0]["Cust_ID"].ToString();
            txttransporter.Text        = dt.Rows[0]["Trasporter"].ToString();
            lblTransID.Text            = dt.Rows[0]["Transporter_ID"].ToString();
            txtNoOfBund.Text           = dt.Rows[0]["No_Bundles"].ToString();
            txtValOfGoods.Text         = dt.Rows[0]["Value_Goods"].ToString();
            txtSentBy.Text             = dt.Rows[0]["Sent_By"].ToString();
            txtLRNo.Text               = dt.Rows[0]["LR_No"].ToString();
            txtLrDate.Text             = LRdate;
            chIsDelivery.Checked       = Convert.ToBoolean(dt.Rows[0]["Delivery"].ToString());
            txtAmt.Text                = dt.Rows[0]["Amount"].ToString();
            rdoPaidStaus.SelectedValue = dt.Rows[0]["Pay_Paid"].ToString();
            txtDocDate.Text            = date; dt.Rows[0]["Amount"].ToString();
            txtRemark.Text             = dt.Rows[0]["Remark1"].ToString();
            CallButonVisible("edit");
            txtDocDate.Focus();
        }
        else
        {
            MessageBox("Info! : \\r\\n Doc. No. " + txtDocIdEdit.Text.Trim() + " Not Found!!!");
            txtDocIdEdit.Text = "";
            txtDocIdEdit.Focus();
            ModalPopUpDocNum.Show();
        }
    }
Exemple #9
0
    protected void btnView_Click(object sender, EventArgs e)
    {
        LinkButton btn = ((LinkButton)sender);

        lblKycId.Text              = ((Label)btn.Parent.FindControl("lblKycNo")).Text.ToString();
        txtKycDate.Text            = ((Label)btn.Parent.FindControl("lblKycDate")).Text.ToString();
        txtCustCode.Text           = ((Label)btn.Parent.FindControl("lblCustCode")).Text.ToString();
        txtCustName.Text           = ((Label)btn.Parent.FindControl("lblCustName")).Text.ToString();
        txtCustAdd.Text            = ((Label)btn.Parent.FindControl("lblCustAddress")).Text.ToString();
        txtArea.Text               = ((Label)btn.Parent.FindControl("lblArea")).Text.ToString();
        txtCity.Text               = ((Label)btn.Parent.FindControl("lblCity")).Text.ToString();
        txtZipCode.Text            = ((Label)btn.Parent.FindControl("lblZipCode")).Text.ToString();
        txtZoneCode.Text           = ((Label)btn.Parent.FindControl("lblzodeCode")).Text.ToString();
        txtTelephone.Text          = ((Label)btn.Parent.FindControl("lblTelNo")).Text.ToString();
        txtMobile.Text             = ((Label)btn.Parent.FindControl("lblMobile")).Text.ToString();
        txtDelAdd.Text             = ((Label)btn.Parent.FindControl("lblDelAddress")).Text.ToString();
        txtTransport.SelectedValue = Convert.ToInt32(((Label)btn.Parent.FindControl("lblTrasport")).Text).ToString();
        txtDisYear.Text            = Convert.ToSingle(((Label)btn.Parent.FindControl("lblDis")).Text).ToString();
        txtTitlesYear.Text         = Convert.ToInt32(((Label)btn.Parent.FindControl("lblTitle")).Text).ToString();

        lblprvyeardisc.Text   = Convert.ToSingle(((Label)btn.Parent.FindControl("lblPrevDis")).Text).ToString();
        lblpreyeartitles.Text = Convert.ToInt32(((Label)btn.Parent.FindControl("lblPrevtitle")).Text).ToString();

        rbtnChr.Checked = ((Label)btn.Parent.FindControl("lblIfBkseller")).Text.ToString() == "CH RECD" ? rbtnChr.Checked = true : rbtnChr.Checked = false;
        rbtnSch.Checked = ((Label)btn.Parent.FindControl("lblIfBkseller")).Text.ToString() == "SCH" ? rbtnSch.Checked = true : rbtnSch.Checked = false;
        rbtnWcp.Checked = ((Label)btn.Parent.FindControl("lblIfBkseller")).Text.ToString() == "WCP" ? rbtnWcp.Checked = true : rbtnWcp.Checked = false;


        ChkScheme.Checked        = Convert.ToBoolean(((Label)btn.Parent.FindControl("lblSchTr")).Text);
        ChkAddComminsion.Checked = Convert.ToBoolean(((Label)btn.Parent.FindControl("lblAddComm")).Text);
        ChkDisForm.Checked       = Convert.ToBoolean(((Label)btn.Parent.FindControl("lblDisForm")).Text);

        lblOS.Text    = ((Label)btn.Parent.FindControl("lblOS")).Text.ToString();
        lblAvg.Text   = ((Label)btn.Parent.FindControl("lblAvg")).Text.ToString();
        txtRemrk.Text = ((Label)btn.Parent.FindControl("lblRemark")).Text.ToString();
        ModalPopUpDocNum.Show();
        updetails.Update();
    }
    protected void BtnGetDCDetails_Click(object sender, EventArgs e)
    {
        //ModalPopUpDocNum.Hide();
        //Session["tempDCData"] = null;

        int DocNum = Convert.ToInt32(TxtDocNo.Text.Trim());

        Session["purDocNo"] = TxtDocNo.Text.Trim();

        DataTable dt = new DataTable();

        dt = PurchaseMaster.Get_PurchaseDetails(DocNum, Convert.ToDateTime("2011/01/01"), Convert.ToDateTime("2011/01/01")
                                                , Convert.ToInt32(strFY), "EDIT", 0, 0).Tables[0];

        if (dt.Rows.Count > 0)
        {
            lblshow.Text      = dt.Rows[0]["SuppliersRef"].ToString();
            txtSupplier.Text  = dt.Rows[0]["SuppliersRefCode"].ToString();
            txtPurchase.Text  = dt.Rows[0]["PurchaseCode"].ToString();
            lblpurchase.Text  = dt.Rows[0]["PurchaseName"].ToString();
            txtDate.Text      = dt.Rows[0]["InvoiceDate"].ToString();
            txtInvoiceNo.Text = dt.Rows[0]["InvoiceNo"].ToString();
            lblID.Text        = dt.Rows[0]["PurchaseMasterID"].ToString();

            gvPurchasing.DataSource = dt;
            gvPurchasing.DataBind();
            Session["tempdata"] = dt;
        }
        else
        {
            message("Record not found for document no. " + TxtDocNo.Text);
            ModalPopUpDocNum.Show();
            TxtDocNo.Text = "";
            TxtDocNo.Focus();
            btn_Save.Visible = false;
        }
    }
Exemple #11
0
    public void fillEditForm()
    {
        Clear();
        DataSet   ds = G_GetPass.GetpassOnDocNo(Convert.ToInt32(txtDocIdEdit.Text.Trim()), "L", Convert.ToInt32(strFY));
        DataTable dt = ds.Tables[0];

        if (dt.Rows.Count > 0)
        {
            string date = (Convert.ToDateTime(dt.Rows[0]["Doc_Date"].ToString())).ToString("dd/MM/yyyy");
            txtDocNo.Text          = dt.Rows[0]["Doc_No"].ToString();
            lblDocNo.Text          = dt.Rows[0]["Doc_ID"].ToString();
            txtDocDate.Text        = date;
            txtDriver.Text         = dt.Rows[0]["Driver_Name"].ToString();
            lblDriver.Text         = dt.Rows[0]["Driver_Name"].ToString();
            lblDriver.Visible      = true;
            lblDriverID.Text       = dt.Rows[0]["Driver_ID"].ToString();
            txtVehicle.Text        = dt.Rows[0]["Veh_no"].ToString();
            lblVehicleNo.Text      = dt.Rows[0]["Veh_no"].ToString();
            lblVehicleNoID.Text    = dt.Rows[0]["Veh_ID"].ToString();
            ddlArea.SelectedValue  = dt.Rows[0]["Area"].ToString();
            txtDiliveryboy.Text    = dt.Rows[0]["Deliveruy_Boy"].ToString();
            lblDeliveryBoy.Text    = dt.Rows[0]["Deliveruy_Boy"].ToString();
            lblDeliveryBoy.Visible = true;
            lblDeliveryBoyID.Text  = dt.Rows[0]["Deliveruy_Boy_ID"].ToString();
            filltempData(ds.Tables[1]);
            CallButonVisible("edit");
            txtDocDate.Focus();
        }
        else
        {
            MessageBox("Info! : \\r\\n Doc. No. " + txtDocIdEdit.Text.Trim() + " Not Found!!!");
            ModalPopUpDocNum.Show();
            txtDocIdEdit.Text = "";
            txtDocIdEdit.Focus();
        }
    }
Exemple #12
0
    protected void BtnGetDCDetails_Click(Object sender, EventArgs e)
    {
        int       SpecNo = Convert.ToInt32(txtDocIdEdit.Text);
        int       FY     = Convert.ToInt32(strFY);
        DataSet   ds     = ObjBAL.Idv_Chetana_Get_Godown_Speciman_Head(SpecNo, FY, "SpcimanEdit");
        DataTable dt     = ds.Tables[0];

        if (dt.Rows.Count > 0)
        {
            btnDelete.Visible          = true;
            lblSpecId.Text             = dt.Rows[0]["SpecAutoId"].ToString();
            txtSpecimanNo.Text         = dt.Rows[0]["SpecSeqNo"].ToString();
            txtSpecDate.Text           = dt.Rows[0]["SpeDate"].ToString();
            txtBranch.Text             = dt.Rows[0]["BranchName"].ToString();
            txttransporter.Text        = dt.Rows[0]["TranspportName"].ToString();
            txtNoOfParcels.Text        = dt.Rows[0]["NoOfParcels"].ToString();
            txtRemark.Text             = dt.Rows[0]["Remark"].ToString();
            txtValOfGoods.Text         = dt.Rows[0]["valueOfGood"].ToString();
            txtSentBy.Text             = dt.Rows[0]["SendBy"].ToString();
            txtLRNo.Text               = dt.Rows[0]["LRNO"].ToString();
            txtLrDate.Text             = dt.Rows[0]["LDDate"].ToString();
            rdoPaidStaus.SelectedValue = Convert.ToInt32(dt.Rows[0]["Paid"]).ToString();
            chIsDelivery.Checked       = Convert.ToBoolean(dt.Rows[0]["Delivery"].ToString());
            filltempData(ds.Tables[1]);
            CallButonVisible("edit");
            grdTemp.Visible = true;
            txtSpecDate.Focus();
        }
        else
        {
            MessageBox("Info! : \\r\\n Doc. No. " + txtDocIdEdit.Text.Trim() + " Not Found!!!");
            ModalPopUpDocNum.Show();
            txtDocIdEdit.Text = "";
            txtDocIdEdit.Focus();
        }
    }
Exemple #13
0
    protected void BtnGetDCDetails_Click(object sender, EventArgs e)
    {
        OtherBAL  ObjBal   = new OtherBAL();
        string    RadioVal = "";
        DataSet   ds       = ObjBal.Idv_Chetana_Get_KycForm(Convert.ToInt32(txtDocIdEdit.Text), Convert.ToInt32(Session["FY"]), Convert.ToInt32("0"), Convert.ToInt32("0"), "", "", "", "");
        DataTable dt       = ds.Tables[1];

        if (dt.Rows.Count > 0)
        {
            #region Radio Button Checked

            RadioVal = dt.Rows[0]["IfBkseller"].ToString();
            if (RadioVal == "CH RECD")
            {
                rbtnChr.Checked = true;
            }
            else if (RadioVal == "SCH")
            {
                rbtnSch.Checked = true;
            }
            else if (RadioVal == "WCP")
            {
                rbtnWcp.Checked = true;
            }
            else if (RadioVal == "COD")
            {
                rbtnCod.Checked = true;
            }
            else
            {
                RadioVal = "";
            }

            #endregion

            lblKycId.Text    = dt.Rows[0]["KycNo"].ToString();
            txtCustCode.Text = dt.Rows[0]["CustCode"].ToString();
            txtCustName.Text = dt.Rows[0]["CustName"].ToString();
            txtCustAdd.Text  = dt.Rows[0]["CustAddress"].ToString();
            txtArea.Text     = dt.Rows[0]["Area"].ToString();

            txtCity.Text       = dt.Rows[0]["City"].ToString();
            txtZipCode.Text    = dt.Rows[0]["ZipCode"].ToString();
            txtZoneCode.Text   = dt.Rows[0]["ZoneCode"].ToString();
            txtTelephone.Text  = dt.Rows[0]["TelNo"].ToString();
            txtMobile.Text     = dt.Rows[0]["MobileNo"].ToString();
            txtDelAdd.Text     = dt.Rows[0]["DelAddr"].ToString();
            txtTitlesYear.Text = dt.Rows[0]["Titles"].ToString();
            txtDisYear.Text    = dt.Rows[0]["Dis"].ToString();

            //Prev Year Dicount And Title
            lblprvyeardisc.Text   = dt.Rows[0]["PrevDis"].ToString();
            lblpreyeartitles.Text = dt.Rows[0]["PrevTitle"].ToString();

            ChkScheme.Checked        = Convert.ToBoolean(dt.Rows[0]["SchLTR"].ToString());
            ChkAddComminsion.Checked = Convert.ToBoolean(dt.Rows[0]["AddCommFrm"].ToString());
            ChkDisForm.Checked       = Convert.ToBoolean(dt.Rows[0]["DisForm"].ToString());
            lblOS.Text    = Convert.ToSingle(dt.Rows[0]["OS"]).ToString();
            lblAvg.Text   = dt.Rows[0]["TotalAvg"].ToString();
            txtRemrk.Text = dt.Rows[0]["Remark"].ToString();
            // txtPersonInchrg.Text = dt.Rows[0]["PersonInchrg"].ToString();
            txtTransport.SelectedValue = dt.Rows[0]["Transport"].ToString();
            lblAutoExtend.Text         = lblKycId.Text;
            txtCustCode.Focus();
            lblEdit.Text = "Edit";
        }
        else
        {
            Message("Info! : \\r\\n Kyc No. " + txtDocIdEdit.Text.Trim() + " Not Found!!!");
            ModalPopUpDocNum.Show();
            txtDocIdEdit.Text = "";
            txtDocIdEdit.Focus();
        }
    }
    protected void BtnGetDCDetails_Click(object sender, EventArgs e)
    {
        String cd = "";

        ModalPopUpDocNum.Hide();
        Session["tempDCData"] = null;

        int DocNum = Convert.ToInt32(ddldocno.SelectedValue);


        //  bool condition = false;
        cd = "1";
        DataSet   ds     = DCMaster.Get_DCMasterBy_DocNum(DocNum, "1");
        DataTable dt     = ds.Tables[0];
        DataTable dtzone = ds.Tables[2];

        cd = "2";
        if (dt.Rows.Count > 0)
        {
            txtdocnew.Text   = dt.Rows[0]["DocumentNo_New"].ToString();
            txtdoc.Text      = dt.Rows[0]["DocumentNo"].ToString();
            txtchalan.Text   = dt.Rows[0]["ChallanNo"].ToString();
            txtChalDate.Text = dt.Rows[0]["ChallanDate"].ToString();
            txtorder.Text    = dt.Rows[0]["OrderNo"].ToString();
            txtcustomer.Text = dt.Rows[0]["CustCode"].ToString();
            lblCustName.Text = dt.Rows[0]["CustName"].ToString();
            DDlemployee.Items.Clear();
            cd = "3";
            try
            {
                DDlemployee.DataSource = DCMaster.Get_Employee_By_Customer_Code(txtcustomer.Text.ToString(), "Employee");
                DDlemployee.DataBind();
                cd = "4";
                if (DDlemployee.Items.Count > 0)
                {
                    DDlemployee.SelectedValue = dt.Rows[0]["SalesmanCode"].ToString();
                    cd = "5";
                    DDlemployee.SelectedItem.Text = dt.Rows[0]["SalesmanName"].ToString();
                    cd = "6";
                }
                txtOrdDate.Text    = dt.Rows[0]["OrderDate"].ToString();
                txtdocDate.Text    = dt.Rows[0]["DocumentDate"].ToString();
                txtpIncharge.Text  = dt.Rows[0]["PIncharge"].ToString();
                txtspInstruct.Text = dt.Rows[0]["SpInstruction"].ToString();
                txtbankdet.Text    = dt.Rows[0]["BankCode"].ToString();
                lblbankname.Text   = dt.Rows[0]["BankName"].ToString();
                cd = "7";
                //Extra Zone Code Bind
                if (dtzone.Rows.Count > 0)
                {
                    lblZoneCode.Visible = true;
                    DDLZone.Visible     = true;
                    DDLZone.Items.Clear();
                    DDLZone.DataSource = ds.Tables[2];
                    DDLZone.DataBind();
                    if (dt.Rows[0]["ExtraZoneCode"].ToString() != "")
                    {
                        //DDLZone.SelectedValue = dt.Rows[0]["ExtraZoneCode"].ToString();
                    }
                }
                else
                {
                    DDLZone.Items.Clear();
                    lblZoneCode.Visible = false;
                    DDLZone.Visible     = false;
                }


                txtDeliverydte.Text = Convert.ToDateTime(DCMaster.Get_DCMasterBy_DocNum(DocNum, "0").Tables[1].Rows[0]["DeliveryDate"].ToString()).ToString("dd/MM/yyyy");
                UpdatePanel14.Update();
            }
            catch (Exception ex)
            {
                MessageBox(cd);
                //Response.Write(ex.Message.ToString());
            }

            // Bind_DDL_Transport();
            //  Ddltransport.SelectedValue = dt.Rows[0]["TransportID"].ToString();
            if (dt.Rows[0]["TransporterCode"].ToString() == "Trans")
            {
                lbltransporter.Visible = false;
                lbltransporter.Text    = dt.Rows[0]["TransporterCode"].ToString();

                txttransporter.Text = dt.Rows[0]["Transporter"].ToString();
            }
            else
            {
                txttransporter.Text    = dt.Rows[0]["TransporterCode"].ToString();
                lbltransporter.Visible = true;
                lbltransporter.Text    = dt.Rows[0]["Transporter"].ToString();
            }
            //DataSet ds = new DataSet();
            // ds = SpecimanDetails.GetSpecimenDatilsByEmpCode(Convert.ToString(DocNum), "documentno");

            DataTable dt1 = new DataTable();
            if (Session["tempDCData"] != null)
            {
                Session["tempDCData"] = fillTempBookData(DocNum.ToString(), "get");
                dt1 = (DataTable)Session["tempDCData"];
            }
            else
            {
                Session["tempDCData"] = fillTempBookData(DocNum.ToString(), "get");
                dt1 = (DataTable)Session["tempDCData"];
            }

            grdBookDetails.DataSource = dt1;
            grdBookDetails.DataBind();
            grdBookDetails.Columns[5].Visible = true;
            grdBookDetails.Columns[4].Visible = true;
            btn_Save.Visible = true;
            //DataTable dt3 = new DataTable();
            //dt3 = ds.Tables[0];
            //Session["tempDCData"] = dt3;
            grdBookDetails.Visible = true;
            //  btn_Save.Visible = false;
        }
        else
        {
            message("Record not found for document no. " + TxtDocNo.Text);
            ModalPopUpDocNum.Show();
            TxtDocNo.Text = "";
            TxtDocNo.Focus();
            btn_Save.Visible = false;
        }
    }