예제 #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;
            }
        }
예제 #2
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         btndelete.Attributes.Add("onclick", "javascript:return confirm('Are you sure you wish to delete?');");
         Session["oInvoiceID"] = Request.QueryString["InvoiceID"].ToString();
         string InvoiceNo = "";
         string Category  = Request.QueryString["InvoiceType"];
         objinvoice.GetDocumentNoByDocID(Convert.ToInt32(Session["oInvoiceID"]), Category, out InvoiceNo);
         lblRefernce.Text      = InvoiceNo;
         Session["oInvoiceNo"] = InvoiceNo;
         LoadData(InvoiceNo);
         PopulateGrid(Convert.ToInt32(Session["oInvoiceID"]));
     }
 }