Beispiel #1
0
 public ProductOrdered(MadeToOrder o, string todo)
 {
     InitializeComponent();
     order = o;
     //op = new OrderedProduct();
     type = todo;
     if (type == "edit")
     {
         //op.TransactionId = o.TransactionId;
         sowebsvc = new SOWebSvcClient();
         //op.GetProductInfo();
         op = sowebsvc.GetOrderedProductInfo(o.TransactionId);
         sowebsvc.Close();
     }
     else
     {
         op = new OrderedProduct();
     }
 }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(Request["save"]))
            {
                sowebsvc       = new SOWebSvcClient();
                cust           = new Customer();
                cust.FirstName = Request["fname"];
                cust.LastName  = Request["lname"];
                cust.Address   = Request["address"];
                cust.ContactNo = Request["contactno"];

                if (sowebsvc.SaveCustomer(cust))
                {
                    Response.Write("<script>alert('Customer Added!');</script>");
                }
                else
                {
                    Response.Write("<script>alert('Error occured. Please try again later.');</script>");
                }
                //Response.Redirect("Default.aspx");
            }
        }
Beispiel #3
0
        private void btnPOSave_Click(object sender, EventArgs e)
        {
            if (txtPOCloth.Text == "")
            {
                MessageBox.Show("Please provide cloth type.");
            }
            else if (txtPODet.Text == "")
            {
                MessageBox.Show("Please provide the details of the product.");
            }
            else
            {
                sowebsvc = new SOWebSvcClient();
                if (type == "add")
                {
                    //saves order transaction

                    sowebsvc.SaveTransaction(order);
                    //order.SaveTransaction();

                    //gets the rent id
                    SelectList slist = new SelectList();
                    slist.GetMaxOrdersID();
                    DataRow oRow = slist.DTable.Rows[0];

                    //gets the order number
                    order.TransactionId = Int32.Parse(oRow["Max"].ToString());

                    //gets inputs
                    op.TransactionId = order.TransactionId;
                    op.ClothType     = txtPOCloth.Text;
                    op.Details       = txtPODet.Text;
                    op.Chest         = Double.Parse(txtPOChest.Text);
                    op.Waist         = Double.Parse(txtPOWaist.Text);
                    op.Length        = Double.Parse(txtPOLength.Text);
                    //op.SaveInfo();
                    if (sowebsvc.SaveOrderedProductInfo(op))
                    {
                        MessageBox.Show("Transaction Complete!");
                    }
                }
                else
                {
                    //gets inputs
                    op.TransactionId = order.TransactionId;
                    op.ClothType     = txtPOCloth.Text;
                    op.Details       = txtPODet.Text;
                    op.Chest         = Double.Parse(txtPOChest.Text);
                    op.Waist         = Double.Parse(txtPOWaist.Text);
                    op.Length        = Double.Parse(txtPOLength.Text);
                    // op.UpdateInfo();
                    if (sowebsvc.UpdateOrderedProductInfo(op))
                    {
                        MessageBox.Show("Ordered Product Updated!");
                    }
                }

                sowebsvc.Close();

                isDone = true;
                this.Close();
            }
        }