protected void btn_add_Click(object sender, EventArgs e)
        {
            int servicetype = 0, vendorID = 0, result = 0;

            if (ddl_ServiceType.SelectedIndex > 0)
            {
                servicetype = int.Parse(ddl_ServiceType.SelectedItem.Value);
            }
            if (Page.IsValid)
            {
                Service serv = new Service(servicetype, vendorID, tb_servName.Text, tb_shortDesc.Text, tb_servDesc.Text, int.Parse(tb_quantity.Text), decimal.Parse(tb_price.Text), "0");
                result = serv.ServiceInsert(vendorID);

                lbl_msg.Visible = true;
                if (result > 0)
                {
                    foreach (HttpPostedFile postedFile in fileupload_photo.PostedFiles)
                    {
                        string fileName = Path.GetFileName(postedFile.FileName);
                        postedFile.SaveAs(Server.MapPath("~/img/") + fileName);
                        serv = new Service(fileName);
                        serv.ServiceImageInsert();
                    }

                    lbl_msg.Text = "Product Insert Successful";
                    InputValidation.ClearInputs(this.Controls);
                    ddl_ServiceType.SelectedIndex = 0;
                }
                else
                {
                    lbl_msg.Text = "Product Insert NOT Successful";
                }
            }
        }
Beispiel #2
0
 protected void btn_submit_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         ContactUs cs = new ContactUs(tb_name.Text, tb_email.Text, tb_message.Text);
         cs.insertEnquiry();
         InputValidation.ClearInputs(this.Controls);
         lbl_msg.Visible = true;
     }
 }
Beispiel #3
0
 protected void btn_submit_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         Payment p   = new Payment(tb_CardNumber.Text, tb_CardName.Text, tb_ExpMonth.Text, int.Parse(tb_Cvv.Text));
         int     cID = acc.gsID;
         p.insertPayment(cID);
         InputValidation.ClearInputs(this.Controls);
         Response.Redirect(Request.RawUrl);
     }
 }
Beispiel #4
0
    protected void btn_submit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            acc = (Account)Session["Id"];
            int slot = 0;
            switch (lbl_slot.Text)
            {
            case "9AM":
                slot = 1;
                break;

            case "12PM":
                slot = 2;
                break;

            case "3PM":
                slot = 3;
                break;

            case "6PM":
                slot = 4;
                break;
            }
            DateTime  d  = DateTime.Parse(lbl_date.Text);
            Showrooms sr = new Showrooms();
            showr           = sr.getBooking(slot, d);
            lbl_msg.Visible = true;
            if (showr != null)
            {
                lbl_msg.Text = "Slot is already taken";
            }
            else
            {
                sr = new Showrooms(acc.gsID, slot, int.Parse(tb_pax.Text), d);
                sr.insertShowroom();
                InputValidation.ClearInputs(this.Controls);
                lbl_date.Text = "";
                lbl_slot.Text = "";
                lbl_msg.Text  = "Booking Success!";
            }
        }
    }
Beispiel #5
0
    protected void btn_add_Click(object sender, EventArgs e)
    {
        //Product Status
        //0 = pending, 1 = Accepted, 2 = Rejected

        //Product Category
        //1 = bedroom, 2 = office, 3 = dining, 4 = kitchen, 5 = bathroom, 6 = children, 7 = livingroom
        acc = (Account)Session["sellerID"];
        int sID = acc.gsID, category = 0, result = 0;

        if (ddl_category.SelectedIndex > 0)
        {
            category = int.Parse(ddl_category.SelectedItem.Value);
        }
        if (Page.IsValid)
        {
            Product prod = new Product(category, sID, tb_prodName.Text, tb_shortDesc.Text, tb_prodDesc.Text, int.Parse(tb_quantity.Text), decimal.Parse(tb_price.Text), "0");
            result = prod.productInsert(sID);

            lbl_msg.Visible = true;
            if (result > 0)
            {
                foreach (HttpPostedFile postedFile in fileupload_photo.PostedFiles)
                {
                    string fileName = Path.GetFileName(postedFile.FileName);
                    postedFile.SaveAs(Server.MapPath("~/img/") + fileName);
                    prod = new Product(fileName);
                    prod.productImageInsert();
                }

                lbl_msg.Text = "Product Insert Successful";
                InputValidation.ClearInputs(this.Controls);
                ddl_category.SelectedIndex = 0;
            }
            else
            {
                lbl_msg.Text = "Product Insert NOT Successful";
            }
        }
    }