Beispiel #1
0
        private void LoadData(int InvoiceID)
        {
            string strDocNo = "";
            string DocType  = Session["eDocType"].ToString();

            objinvoice.GetDocumentNoByDocID(InvoiceID, DocType, out strDocNo);
            lbldocumentno.Text     = strDocNo;
            lblVoucherno.Text      = Session["eVoucherNumber"].ToString();
            lbldocumentdate.Text   = Session["eInvoiceDate"].ToString();
            lbldocumentstatus.Text = Session["eDocStatus"].ToString();
            lblsuppliername.Text   = objinvoice.GetSupplierName(InvoiceID, DocType);
            lblauthstring.Text     = objinvoice.GetAuthorisationString(InvoiceID, DocType);
            lbldepartment.Text     = objinvoice.GetDepartment(InvoiceID, DocType);


            int UserTypeID = objinvoice.GetUserType(Convert.ToInt32(Session["UserID"]));

            if (UserTypeID < 3)
            {
                btndelete.Visible       = false;
                txtcomment.Visible      = false;
                lblComment.Visible      = false;
                lblCreditNoteNo.Visible = false;
                lbltextCrnNo.Visible    = false;
            }

            if (DocType == "CRN")
            {
                visiblelable = 1;
                lblassociatedinvoiceno.Text    = "Associated Invoice No";
                lblassociatedinvoiceno.Visible = true;

                lblassociatedno.Text    = objinvoice.GetAssociatedCreditInvoiceNo(InvoiceID, DocType);
                lblassociatedno.Visible = true;
            }
            if (DocType == "INV")
            {
                lblCreditNoteNo.Text = "Associated CreditNote No";
                lbltextCrnNo.Text    = objinvoice.GetAssociatedCreditInvoiceNo(InvoiceID, DocType);
                if (lbltextCrnNo.Text.Trim() != "")
                {
                    visiblelable1           = 1;
                    lblCreditNoteNo.Visible = true;
                    lbltextCrnNo.Visible    = true;
                }
            }

            GDlineinfo.DataSource = objinvoice.GetLineInformation(InvoiceID, DocType);
            GDlineinfo.DataBind();

            if (lbldocumentstatus.Text == "Delete/Archive")
            {
                btndelete.Visible = false;
            }
        }