コード例 #1
0
        protected void btnPO_Click(object sender, EventArgs e)
        {
            BllPurchaseOrders po        = new BllPurchaseOrders();
            string            productID = "";
            string            desc      = "";
            string            quantity  = "";
            string            unitPrice = "";
            //   int poNum = po.GetPoID();
            CheckBox cb = new CheckBox();

            foreach (GridViewRow row in gvPurchase.Rows)
            {
                cb = (CheckBox)row.FindControl("CheckBox1");
                if (!cb.Checked)
                {
                    continue;
                }

                if (productID == "")
                {
                    productID += row.Cells[0].Text;
                    desc      += row.Cells[1].Text;
                    quantity  += row.Cells[2].Text;
                    unitPrice += row.Cells[3].Text;
                    continue;
                }

                productID += "," + row.Cells[0].Text;
                desc      += "," + row.Cells[1].Text;
                quantity  += "," + row.Cells[2].Text;
                unitPrice += "," + row.Cells[3].Text;
            }

            po.CreatePOI(productID, desc, quantity, unitPrice, "New");
        }
コード例 #2
0
        private void BindOrderDetails(int PONum)
        {
            BllPurchaseOrders po = new BllPurchaseOrders();
            DataSet           ds;

            ds = po.GetOrderDetails(PONum);
            gvPurchase.DataSource = ds;
            gvPurchase.DataBind();
        }
コード例 #3
0
        protected void createDo_Click(object sender, EventArgs e)
        {
            BllDeliveryOrders d = new BllDeliveryOrders();
            int poNum           = Convert.ToInt32(lblPONum.Text);
            int qty             = Convert.ToInt32(lblQty.Text);
            //int prodID = Convert.ToInt32(GridView1.SelectedRow.Cells[0].Text);
            //string prodDesc = GridView1.SelectedRow.Cells[1].Text;
            //int qty = Convert.ToInt32(GridView1.SelectedRow.Cells[2].Text);
            //string status = "Processing";
            DateTime time   = DateTime.Now;            // Use current time
            string   format = "yyyy-MM-dd hh:mm tt";
            string   date   = time.ToString(format);
            int      result = 0;

            result = d.DeliveryInsert(50.00M, "Processing", poNum, date, "Standard", lblDesc.Text, qty, "boxwear", Convert.ToDecimal(lblTotal.Text));

            if (result == 1)
            {
                BllPurchaseOrders po = new BllPurchaseOrders();
                po.updatePOStatus(poNum);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
                                                    "alert('Insert successful'); window.location='" +
                                                    Request.ApplicationPath + "pendingpurchaseorders.aspx';", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
                                                    "alert('Insert unsuccessful'); window.location='" +
                                                    Request.ApplicationPath + "pendingpurchaseorders.aspx';", true);
            }



            ////invoce
            //int result = 0;
            //int poNum = Convert.ToInt32(lblPONum.Text);
            //Bllinvoice a = new Bllinvoice();
            //string status = "Processing";
            //DateTime myDateTime = DateTime.Now;
            //string date = myDateTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
            //result = a.insertInvoice(date, Convert.ToDecimal(lblTotal.Text), status, poNum);

            //if (result == 1)
            //{

            //    BllPurchaseOrders po = new BllPurchaseOrders();
            //    po.updatePOStatus(poNum);
            //    ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
            //            "alert('Insert successful'); window.location='" +
            //            Request.ApplicationPath + "pendingpurchaseorders.aspx';", true);
            //}else
            //{
            //    ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
            //            "alert('Insert unsuccessful'); window.location='" +
            //            Request.ApplicationPath + "pendingpurchaseorders.aspx';", true);
            //}
        }
コード例 #4
0
        private void BindPOFiltered(string status)
        {
            BllPurchaseOrders myCat = new BllPurchaseOrders();
            DataSet           ds;

            ds = myCat.GetPOListFiltered(status);
            gvPurchase.DataSource = ds;
            gvPurchase.DataBind();
        }
コード例 #5
0
        private void BindPOList()
        {
            BllPurchaseOrders po = new BllPurchaseOrders();
            DataSet           ds;

            ds = po.GetPOList();
            gvPurchase.DataSource = ds;
            gvPurchase.DataBind();
        }
コード例 #6
0
        private void BindPOList()
        {
            BllPurchaseOrders myCat = new BllPurchaseOrders();
            DataSet           ds;

            ds = myCat.GetPOList();
            gvOrder.DataSource = ds;
            gvOrder.DataBind();
        }
コード例 #7
0
        private void BindCustomerOrder()
        {
            BllPurchaseOrders myCat = new BllPurchaseOrders();
            DataSet           ds;

            ds = myCat.GetCO();
            gvPurchase.DataSource = ds;
            gvPurchase.DataBind();
        }
コード例 #8
0
        protected void btnNext_Click(object sender, EventArgs e)
        {
            BllPurchaseOrders po = new BllPurchaseOrders();
            // int poNum = po.GetPoID();
            int     prodID    = Convert.ToInt32(lblProdId.Text);
            int     quantity  = Convert.ToInt32(tbQuantity.Text);
            decimal amt       = 0;
            decimal unitPrice = Convert.ToDecimal(lblPrice.Text);

            //  decimal totalPrice = quantity * unitPrice;
            po.InsertCatalogue(prodID, lblName.Text, lblDesc.Text, quantity, unitPrice);

            // need to insert into purchaseOrders
            //string date = DateTime.Now.ToString("dd/MM/yyyy");
            //po.CreatePO(date, "Pending", totalPrice, "BoxWear", "TheBigFour");

            Response.Redirect("ProductCatalogue.aspx");
        }
コード例 #9
0
 protected void btnNum_Click(object sender, EventArgs e)
 {
     BllPurchaseOrders po = new BllPurchaseOrders();
 }