public static string Event()
        {
            int   id    = Convert.ToInt32(HttpContext.Current.Session["UserID"]);
            Garge garge = new Garge(id);

            return(garge.Calnder_data());
        }
Beispiel #2
0
 protected void ReminderTreatment()
 {
     Garge garge = new Garge(Convert.ToInt32(Session["UserID"]));
     List <CustomerModel> list = garge.getAllCustomers();
     //ShwoCustomer.DataSource = list;
     //ShwoCustomer.DataBind();
 }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["UserID"] != null)
                {
                    //string Name_Hebrwo = "";
                    Garge  garge = new Garge(Convert.ToInt32(Session["UserID"]));
                    string city  = garge.get_city();
                    Set_Wolcome_Time();
                    user_name.Text       += garge.Get_Full_Name();
                    user_name2.Text       = garge.Get_Full_Name();
                    user_name3.Text       = garge.GetNameGarga();
                    UserName4.Text        = garge.GetFirstName();
                    City_Name.Text        = city;
                    City_Name_Hebrwo.Text = city;
                    Useremail.Text        = garge.GetEmail();
                    Image1.ImageUrl       = garge.GetimageUrl();
                    Image2.ImageUrl       = garge.GetimageUrl();
                    Image3.ImageUrl       = garge.GetimageUrl();
                    RendarCard();
                }

                else
                {
                    Response.Redirect("~/error-404.html");
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", ex.ToString(), true);
            }
        }
Beispiel #4
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();
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["UserID"] != null)
                {
                    Garge  garge = new Garge(Convert.ToInt32(Session["UserID"]));
                    string city  = garge.get_city();
                    BisanceID.Attributes["placeholder"] = garge.GetNameGarga();
                    price.Attributes["placeholder"]     = "₪" + garge.GetPricePerHour().ToString();
                    StreetID.Attributes["placeholder"]  = garge.GetAddress();
                    emailId.Attributes["placeholder"]   = garge.GetEmail();
                    PhoneId.Attributes["placeholder"]   = garge.GetPhone();
                }

                else
                {
                    Response.Redirect("~/error-404.html");
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", ex.ToString(), true);
            }
        }
        public static bool DeleteEvent(string idevent)
        {
            int   id    = Convert.ToInt32(HttpContext.Current.Session["UserID"]);
            Garge garge = new Garge(id);

            return(garge.UpdateShowEvent(idevent));
        }
Beispiel #7
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()));
        }
Beispiel #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserID"] != null)
     {
         Garge garge = new Garge(Convert.ToInt32(Session["UserID"]));
         Image1.ImageUrl = garge.GetimageUrl();
     }
 }
        protected void bt_submit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                bool Exsict = CheackUserName();
                if (Exsict == false)
                {
                    Random random = new Random();
                    activatoncode = random.Next(1001, 9999).ToString();
                    try
                    {
                        string Encryptedpass = FormsAuthentication.HashPasswordForStoringInConfigFile(tb_password.Text, "SHA1");
                        var    dateAndTime   = DateTime.Now;
                        var    date          = dateAndTime.Date;
                        date.ToString("dd/MM/yyyy");
                        var Dblist = new List <DbListAdapter>();
                        Dblist.Add(new DbListAdapter("CityID", ddl_city.SelectedValue));
                        Dblist.Add(new DbListAdapter("NameGarga", tb_namebisance.Text));
                        Dblist.Add(new DbListAdapter("pricePerHour", pricePerHour.Text));
                        //Dblist.Add(new DbListAdapter("UserName", tb_user.Text));
                        Dblist.Add(new DbListAdapter("Password", Encryptedpass));
                        Dblist.Add(new DbListAdapter("Address", tb_Address.Text));
                        Dblist.Add(new DbListAdapter("FIRST_NAME", tb_Fname.Text));
                        Dblist.Add(new DbListAdapter("LAST_NAME", tb_Lname.Text));
                        Dblist.Add(new DbListAdapter("Phone", tb_phone.Text));
                        Dblist.Add(new DbListAdapter("Email", tb_email.Text));
                        Dblist.Add(new DbListAdapter("Activecode", activatoncode));
                        //Dblist.Add(new DbListAdapter("JoinDate", date.ToString()));
                        bool garageid = Garge.create_new_garage(Dblist);
                        if (garageid)
                        {
                            sendemail();
                            //Session["user"] = tb_Fname.Text;
                            //Session["user"] = tb_user.Text;
                            Session["email"] = tb_email.Text;
                            Response.Redirect("~/emailverification.aspx?tb_email=" + tb_email.Text);
                        }
                    }
                    catch (Exception ex)
                    {
                        Lblsend.Text = ex.Message;
                    }
                    finally
                    {
                    }
                }
                else
                {
                    Lblsend.Text = "נראה שחשבון מייל זה כבר נמצא בשימוש!";
                    pricePerHour.Focus();
                }
            }

            else
            {
                Label1.Text = "חובה למלאות שדות חובה* !";
            }
        }
        protected void All_RepJob()
        {
            List <string>     customerid = new List <string>();
            Garge             garge      = new Garge(Convert.ToInt32(Session["UserID"]));
            List <RepairJobl> list       = garge.GetTeratments();

            RepJob.DataSource = list;
            RepJob.DataBind();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack & Session["UserID"] != null)
     {
         Garge garge = new Garge(Convert.ToInt32(Session["UserID"]));
         List <CustomerModel> list = garge.getAllCustomers();
         ShwoCustomer.DataSource = list;
         ShwoCustomer.DataBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserID"] != null)
     {
         Garge garge = new Garge(Convert.ToInt32(Session["UserID"]));
         profileImage.ImageUrl             = garge.GetimageUrl();
         FnameID.Attributes["placeholder"] = garge.GetFirstName();
         LnameID.Attributes["placeholder"] = garge.GetLastName();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserID"] != null && !IsPostBack)

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

                UserName_ID.Value = garge.Get_Full_Name();
            }
        }
Beispiel #14
0
        //shwo all open work card
        protected void RendarCard()
        {
            Garge             garge   = new Garge(Convert.ToInt32(Session["UserID"]));
            List <RepairJobl> listTop = garge.GetTeratmentsTop3();
            List <RepairJobl> list    = garge.GetTeratments();

            Count.InnerText          = list.Count.ToString();
            Count2.InnerText         = listTop.Count.ToString();
            Open_WordCaed.DataSource = listTop;
            Open_WordCaed.DataBind();
        }
Beispiel #15
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();
     }
 }
Beispiel #16
0
        protected void BtnLogin_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                string    Encryptedpass = FormsAuthentication.HashPasswordForStoringInConfigFile(tb_password.Text, "SHA1");
                DataTable data          = Garge.get_data(tb_user.Text, Encryptedpass, "true");
                if (data.Rows.Count > 0)
                {
                    Session["UserID"] = data.Rows[0]["GaragID"].ToString();
                    Response.Redirect("~/Admin2HomePage.aspx");
                }

                else
                {
                    Lblreg.Text      = "שם משתמש או סיסמא אינם נכונים!";
                    Lblreg.ForeColor = System.Drawing.Color.Red;
                }
            }
            else
            {
                Lblreg.Text      = "חובה למלא שדות חובה!";
                Lblreg.ForeColor = System.Drawing.Color.Red;
            }
        }
        protected void SendEmailByAdmin()
        {
            Garge  garge   = new Garge(Convert.ToInt32(Session["UserID"]));
            string Name    = garge.GetNameGarga();
            String Address = garge.GetAddress();
            String City    = garge.get_city();
            String phone   = garge.GetPhone();

            if (EmailBLL.IsValidEmailAddress(tbEmail.Text))
            {
                string       path        = @"C:\Users\isaya\OneDrive\שולחן העבודה\c#\GargeManger\EmailTamplate\NewCustomerAdd.html";
                StreamReader sr          = new StreamReader(path);
                string       FullMessage = sr.ReadToEnd();
                FullMessage = FullMessage.Replace("{UserName}", Fname.Text);
                FullMessage = FullMessage.Replace("{LastName}", Lname.Text);
                FullMessage = FullMessage.Replace("{NameGarga}", Name);
                FullMessage = FullMessage.Replace("{UserIdCard}", tbUser.Text);
                FullMessage = FullMessage.Replace(" {Address}", Address);
                FullMessage = FullMessage.Replace("{City}", City);
                FullMessage = FullMessage.Replace("{phone}", phone);
                sr.Close();
                EmailBLL.SendMailMessage(tbEmail.Text, "*****@*****.**", null, null, "לקוח יקר", FullMessage, null);
            }
        }