Ejemplo n.º 1
0
 //delete invoice
 protected void InvoiceDeleteButton_Click(object sender, EventArgs e)
 {
     InvoiceBL invoiceBL = new InvoiceBL();
     long invoiceID = Convert.ToInt64(Session["EditInvoiceID"]);
     invoiceBL.DeleteInvoice(invoiceID);
     this.InvoiceGridView.DataBind();
     this.MiniInvoiceFormView.DataBind();
     this.MiniInvoiceDetailsView.DataBind();
     InvoiceListUpdatePanel.Update();
     MiniInvoiceUpdatePanel.Update();
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "GoToTab(2);", true);
 }
Ejemplo n.º 2
0
 private string GenerateCustomizeNumber(string number)
 {
     string Number1 = null;
     string lastNumber=null;
     string month = DateTime.Today.Month.ToString();
     int year = DateTime.Today.Year;
     if (number == "invoice")
     {
         InvoiceBL invoiceBL=new InvoiceBL();
         Number1 = invoiceBL.GetInvoiceNumber();
     }
     else
     {
         Number1 = orderBL.GetOrderNumber();
     }
     if (Number1!=null)
     {
         lastNumber = Number1.Split('-')[2];
     }
     long jkl = Convert.ToInt64(lastNumber) + 1;
     string lmn = jkl.ToString();
     int i = Convert.ToInt32(lastNumber) + 1;
     int append = 5 - lmn.Length;
     string sid = "";
     for (int j = 0; j < append; j++)
     {
         sid += "0";
     }
     sid = sid + i;
     string GenerateNumber = month + +year + "-" + "Insert" + "-" + sid;
     return GenerateNumber;
 }