Пример #1
0
        protected void btnsubmitoffers_Click(object sender, EventArgs e)
        {
            DAC_BookServices oDAC_BookServices = new DAC_BookServices();
            REF_BookServices oREF_BookServices = new REF_BookServices();

            oREF_BookServices.CusID     = Convert.ToInt32(dropCusotmer.Value);
            oREF_BookServices.ServiceID = Convert.ToInt32(dropService.Value);
            oREF_BookServices.OfferID   = Convert.ToInt32(dropoffers.Value);
            DataTable  dt;
            DAV_Offers oDAV_Offers = new DAV_Offers();
            REF_Offers oREF_Offers = new REF_Offers();

            oREF_Offers.ID = Convert.ToInt32(dropoffers.Value);
            dt             = oDAV_Offers.SelectOffersByID(oREF_Offers);
            Double OfferPrice = Double.Parse(dt.Rows[0][6].ToString());

            oREF_BookServices.OfferPrice = dt.Rows[0][6].ToString();

            DAC_Service oDAC_Service = new DAC_Service();
            REF_Service oREF_Service = new REF_Service();

            oREF_Service.ID = Convert.ToInt32(dropService.Value);
            dt = oDAC_Service.SelectServiceByID(oREF_Service);
            Double ServicePrice = Double.Parse(dt.Rows[0][4].ToString());

            Double Total = ServicePrice - OfferPrice;

            oREF_BookServices.ServicePrice = dt.Rows[0][3].ToString();

            oREF_BookServices.TotalPrice = Total.ToString();
            oDAC_BookServices.Insert(oREF_BookServices);
            LoadData();
        }
Пример #2
0
        protected void btndelete_Click(object sender, EventArgs e)
        {
            DAC_Service oDAC_Service = new DAC_Service();
            REF_Service oREF_Service = new REF_Service();

            oREF_Service.ID               = Convert.ToInt32(ServiceID);
            oREF_Service.ServiceiD        = serviceCode.Text;
            oREF_Service.Service_Name     = ServiceName.Text;
            oREF_Service.Service_Duration = ServiceDuration.Text;
            oREF_Service.Price_Per_Hour   = PricePerHour.Text;
            oREF_Service.Description      = Description.Text;

            oDAC_Service.Delete(oREF_Service);
            Response.Redirect("./frmService.aspx", true);
        }
Пример #3
0
        private void LoadService()
        {
            DataTable   dt;
            DAC_Service oDAC_Service = new DAC_Service();

            dt = oDAC_Service.SelectService();

            if (dt.Rows.Count > 0)
            {
                dropService.DataSource     = null;
                dropService.DataSource     = dt;
                dropService.DataTextField  = "service_name";
                dropService.DataValueField = "idmainservice";
                dropService.DataBind();
            }
        }
Пример #4
0
        public void LoadData(REF_Service oREF_Service)
        {
            try
            {
                DataTable   dt;
                DAC_Service oDAC_Service = new DAC_Service();

                dt = oDAC_Service.SelectServiceByID(oREF_Service);
                serviceCode.Text     = dt.Rows[0][1].ToString();
                ServiceName.Text     = dt.Rows[0][2].ToString();
                ServiceDuration.Text = dt.Rows[0][3].ToString();
                PricePerHour.Text    = dt.Rows[0][4].ToString();
                Description.Text     = dt.Rows[0][5].ToString();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Пример #5
0
        protected void btnsubmitService_Click(object sender, EventArgs e)
        {
            try
            {
                DAC_Service oDAC_Service = new DAC_Service();
                REF_Service oREF_Service = new REF_Service();
                oREF_Service.ServiceiD        = serviceCode.Text;
                oREF_Service.Service_Name     = ServiceName.Text;
                oREF_Service.Service_Duration = ServiceDuration.Text;
                oREF_Service.Price_Per_Hour   = PricePerHour.Text;
                oREF_Service.Description      = Description.Text;

                oDAC_Service.Insert(oREF_Service);
                ShowMessage("Data Insert successfully!");
                LoadData();
            }
            catch (Exception ex)
            {
                ShowMessage("Something went wrong! Please try again!");
            }
        }
Пример #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DataTable  dt;
            DAV_Offers oDAV_Offers = new DAV_Offers();
            REF_Offers oREF_Offers = new REF_Offers();

            oREF_Offers.ID = Convert.ToInt32(dropoffers.Value);
            dt             = oDAV_Offers.SelectOffersByID(oREF_Offers);
            Double OfferPrice = Double.Parse(dt.Rows[0][6].ToString());


            DAC_Service oDAC_Service = new DAC_Service();
            REF_Service oREF_Service = new REF_Service();

            oREF_Service.ID = Convert.ToInt32(dropService.Value);
            dt = oDAC_Service.SelectServiceByID(oREF_Service);
            Double ServicePrice = Double.Parse(dt.Rows[0][4].ToString());
            Double Total        = ServicePrice - OfferPrice;

            lbltotal.InnerText = "Total Cost Rs." + Total.ToString();
        }
Пример #7
0
        public void LoadData()
        {
            try
            {
                DataTable   dt;
                DAC_Service oDAC_Service = new DAC_Service();
                dt = oDAC_Service.SelectService();
                String StrInnserHtml = "";

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        StrInnserHtml = StrInnserHtml + "<tr><td>" + dt.Rows[i][1].ToString() + "</td><td>" + dt.Rows[i][2].ToString() + "</td><td>" + dt.Rows[i][3].ToString() + "</td><td> " + dt.Rows[i][4].ToString() + " </td><td> " + dt.Rows[i][5].ToString() + " </td><td><a href='frmService.aspx?ID=" + dt.Rows[i][0].ToString() + "'>Edit</a></td></tr>";
                    }
                }
                divInnerHtml.InnerHtml = StrInnserHtml;
            }
            catch (Exception ex)
            {
                throw;
            }
        }