private void BindPOList()
        {
            int        id    = Convert.ToInt32(Session["invoiceid"].ToString());
            Bllinvoice myCat = new Bllinvoice();
            DataSet    ds;

            ds = myCat.GetInvoiceByID(id);

            int rec = ds.Tables["Table"].Rows.Count;

            DataRow row           = ds.Tables["Table"].Rows[0];
            string  InvoiceAmt    = row["InvoiceAmt"].ToString();
            string  InvoiceID     = row["InvoiceID"].ToString();
            string  InvoiceDate   = row["InvoiceDate"].ToString();
            string  InvoiceStatus = row["InvoiceStatus"].ToString();
            string  PoID          = row["PoID"].ToString();
            string  due           = row["invoiceDue"].ToString();
            string  paymentDate   = row["paymentDate"].ToString();
            string  paymentMadeBy = row["paymentMadeBy"].ToString();



            status_lbl.Text       = InvoiceStatus;
            date_lbl.Text         = InvoiceDate;
            lbl_TotalPrice.Text   = InvoiceAmt;
            Label1.Text           = InvoiceID;
            ordernotxt.Text       = InvoiceID;
            duelbl.Text           = due;
            paymentdatelbl.Text   = paymentDate;
            paymentmadebylbl.Text = paymentMadeBy;

            //isssue above. cant myCat.GetInvoiceByID(id);
        }
Esempio n. 2
0
        private void BindPOList()
        {
            Bllinvoice myCat = new Bllinvoice();
            DataSet    ds;

            ds = myCat.GetAllInvoice();
            gvInvoice.DataSource = ds;
            gvInvoice.DataBind();
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string     id    = Session["invoiceid"].ToString();
            int        id2   = Convert.ToInt32(Session["invoiceid"].ToString());
            Bllinvoice myCat = new Bllinvoice();
            DataSet    ds;

            ds = myCat.GetInvoiceByID(id2);

            string PoID = ds.Tables[0].Rows[0]["PoID"].ToString();

            BindOrderDetails(Convert.ToInt32(PoID));

            BindPOList();
        }
Esempio n. 4
0
        protected void createInvoice_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Session["id"].ToString());

            //invoice
            int        result = 0;
            int        poNum  = Convert.ToInt32(poidlbl.Text);
            Bllinvoice a      = new Bllinvoice();
            string     status = "Unpaid";
            //DateTime myDateTime = DateTime.Now;
            //DateTime date = DateTime.Now.ToString("dd.MM.yyy");
            DateTime endDate = DateTime.Now.AddMonths(1);
            string   duedate = endDate.ToString();

            result = a.insertInvoice(DateTime.Now, Convert.ToDecimal(valuelbl.Text), status, poNum, id, endDate);

            if (result == 1)
            {
                //insert inner join here to get invoiceID
                DataSet ds;
                ds = GetInvoiceByID(id);
                int rec = ds.Tables["Table"].Rows.Count;

                DataRow row  = ds.Tables["Table"].Rows[0];
                int     inid = Convert.ToInt32(row["InvoiceID"].ToString());

                updateDeliveryInvoice(id, inid);

                ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
                                                    "alert('Insert successful'); window.location='" +
                                                    Request.ApplicationPath + "ViewDeliveryDetails.aspx';", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
                                                    "alert('Insert unsuccessful'); window.location='" +
                                                    Request.ApplicationPath + "ViewDeliveryDetails.aspx';", true);
            }
        }
Esempio n. 5
0
        protected void paynow_btn_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Session["invoiceid"]);

            string creditc  = ccNo.Text;
            string cardType = CreditCardUtility.GetTypeName(creditc);

            cardtype.Text = cardType;

            bool exp = isValid(expDate.Text);

            //if (exp == false)
            //{

            //}


            if (cardType == "Unknown" || exp == false)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
                                                    "alert('Credit card is INVALID'); window.location='" +
                                                    Request.ApplicationPath + "payment.aspx';", true);
            }
            else
            {
                //need to login to work
                string     paymentMadeBy = Session["user"].ToString();
                Bllinvoice myCat         = new Bllinvoice();
                myCat.UpdateInvoicePayment(id, ccNo.Text, ccv.Text, expDate.Text, "Paid", DateTime.Now, paymentMadeBy);

                string id1 = (Session["invoiceid"]).ToString();
                ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
                                                    "alert('Payment Successful'); window.location='" +
                                                    Request.ApplicationPath + "invoiceReview.aspx';", true);
            }
        }