Exemplo n.º 1
0
        public void setGarageInfo()
        {
            string     teratmentID = Request.QueryString["tid"].ToString();
            RepairJobl repairJob   = new RepairJobl(Convert.ToInt32(teratmentID));
            var        amountsTime = repairJob.totalWorkingHours;

            Garge garge = new Garge(Convert.ToInt32(Session["UserID"]));

            LblbisanceName.Text   = garge.GetNameGarga();
            LblbisanceName2.Text  = garge.GetNameGarga();
            city.Text             = garge.get_city();
            lblstreet.Text        = garge.GetAddress();
            lblphone.Text         = garge.GetPhone();
            name.InnerText        = garge.Get_Full_Name();
            phonenumber.InnerText = garge.GetPhone();
            email.InnerText       = garge.GetEmail();
            Phone.InnerText       = garge.GetPhone();
            mail.InnerText        = garge.GetEmail();
            priceHour.InnerText   = garge.GetPricePerHour().ToString() + "₪";
            amountTime.InnerText  = amountsTime.ToString();
            ////////
            DateTime currentTime = DateTime.Now;

            lbldatatime.Text = currentTime.ToString();
            Random random = new Random();

            lblidinvoic.Text          = "##" + random.Next(10001, 9999999).ToString() + "##";
            totelTimePrice.InnerText  = string.Format("{0:0.00}", Convert.ToDouble((amountsTime * garge.GetPricePerHour())).ToString()) + "₪";
            totelTimePrice2.InnerText = string.Format("{0:0.00}", Convert.ToDouble((amountsTime * garge.GetPricePerHour())).ToString()) + "₪";
            totel = Convert.ToDouble((amountsTime * garge.GetPricePerHour()));
        }
Exemplo n.º 2
0
        protected async void SendSms_Click(object sender, EventArgs e)
        {
            var           cid           = Request.QueryString["cid"];
            CustomerModel customer      = new CustomerModel(Convert.ToInt32(cid));
            string        customerPhone = customer.phonNumber;
            string        customername  = customer.firstnmae + " " + customer.lastname;

            string     teratmentID  = Request.QueryString["tid"].ToString();
            RepairJobl repairJob    = new RepairJobl(Convert.ToInt32(teratmentID));
            string     LicensePlate = repairJob.license_Number;


            Garge  garge        = new Garge(Convert.ToInt32(Session["UserID"]));
            string garageName   = garge.GetNameGarga();
            string garageNumber = garge.GetPhone();

            //This Method Sends Using API and its ASYNC (You have to wait until the process ends)
            await SmsSender.SendUsingAPIAsync(
                garageNumber,
                garageName,
                customerPhone,
                customername,
                LicensePlate
                );

            Thread.Sleep(5000); //Sleep for 5 SECOND Until API FINISH His Work
            showmodel();
        }
Exemplo n.º 3
0
        // submit new work card for customer

        protected void Submit_RepairJob_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    var Dblist = new List <DbListAdapter>();
                    Dblist.Add(new DbListAdapter("GaragID", Session["UserID"].ToString()));
                    Dblist.Add(new DbListAdapter("CustomerID", CustomID.Value));
                    Dblist.Add(new DbListAdapter("TypeID", SelectTipol.Value));
                    Dblist.Add(new DbListAdapter("License_Number", License_id.Text));
                    Dblist.Add(new DbListAdapter("description", description_ID.Value));
                    Dblist.Add(new DbListAdapter("StartDate", Data_ID.Value));
                    Dblist.Add(new DbListAdapter("Approved_by", UserName_ID.Value));
                    Dblist.Add(new DbListAdapter("Mileage_start", Mileage_start.Value));

                    bool Repair = RepairJobl.New_RepairJob(Dblist);
                    if (Repair)
                    {
                        annualTreatment();
                        Error_ID.Text = "כרטיס עבודה חדש נפתח בהצלחה ! ";
                        showmodel();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                Error_ID.Text = "חובה למלא שדות חובה ! ";
            }
        }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack & Session["UserID"] != null)
     {
         Garge             garge   = new Garge(Convert.ToInt32(Session["UserID"]));
         RepairJobl        allJobs = new RepairJobl();
         List <RepairJobl> data    = allJobs.AllHistory(Session["UserID"].ToString());
         ShwoHistory.DataSource = data;
         ShwoHistory.DataBind();
     }
 }
Exemplo n.º 5
0
        public List <RepairJobl> GetTeratments()
        {
            List <RepairJobl> list = new List <RepairJobl>();
            DataTable         sql  = new sql_class().Where("GaragID", this.GaragID.ToString()).Where("Status", "true").Get("RepairJob", "teratmentID");

            for (int i = 0; i < sql.Rows.Count; i++)
            {
                RepairJobl Teratment = new RepairJobl(Convert.ToInt32(sql.Rows[i]["teratmentID"]));
                list.Add(Teratment);
            }

            return(list);
        }
Exemplo n.º 6
0
        public static bool deltetJob(string teratmentID)
        {
            RepairJobl job         = new RepairJobl();
            bool       deleteOrnot = job.deleteJob(teratmentID);

            if (deleteOrnot)
            {
                CartModel cart = new CartModel();
                cart.deleteAllCart(teratmentID);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 7
0
        public static bool closeRepiarJob(string teratmentID, string amountTime)
        {
            sql_class sql    = new sql_class();
            var       Dblist = new List <DbListAdapter>();

            Dblist.Add(new DbListAdapter("TotalWorkingHours", amountTime));
            sql.Where("teratmentID", teratmentID);
            sql.Update("RepairJob", Dblist);
            RepairJobl jobl       = new RepairJobl();
            bool       closeOrnot = jobl.closeRepiarJob(teratmentID);

            if (closeOrnot)
            {
                CartModel cart = new CartModel();
                cart.cartItemChengaStatus(teratmentID);
                return(true);
            }
            else
            {
                return(false);
            }
        }