コード例 #1
0
        protected void btnSabtEditProfile_Click(object sender, EventArgs e)
        {
            string id = Request.QueryString["userid"];

            if (id != "" || id != null)
            {
                Karmand stuu = rep.FindByEmployeeID(id);
                Karmand kar  = new Karmand();

                kar.PersonalCode = id;
                kar.EID          = stuu.EID;;
                kar.UserName     = tbxUserName.Value;
                kar.UserPass     = tbxPassword.Value;

                kar.FirstName = tbxFirstName.Value;
                kar.LastName  = tbxLastName.Value;
                kar.BirthDate = string.Format("{0}{1}{2}", tbxBirthDay.Value.Substring(0, 4), tbxBirthDay.Value.Substring(5, 2), tbxBirthDay.Value.Substring(8, 2));

                kar.PhoneNumber = tbxFixTel.Value;
                kar.Mobile      = tbxMobile.Value;

                //stu.Email = tbxEmail.Value;

                rep.SaveEmployees(kar);
                Response.Redirect("http://localhost:4911/Dashboard/Admin/Employees.aspx");
            }
        }
コード例 #2
0
        protected void btnSabtEditProfile_Click(object sender, EventArgs e)
        {
            if (Session["useridForEditEmployee"] != null)
            {
                string  id   = Session["useridForEditEmployee"].ToString();
                Karmand stuu = rep.FindByEmployeeID(id);
                Karmand kar  = new Karmand();

                kar.PersonalCode = id;
                kar.EID          = stuu.EID;;
                kar.UserName     = tbxUserName.Value;
                kar.UserPass     = tbxPassword.Value;

                kar.FirstName = tbxFirstName.Value;
                kar.LastName  = tbxLastName.Value;
                kar.BirthDate = string.Format("{0}{1}{2}", tbxBirthDay.Value.Substring(0, 4), tbxBirthDay.Value.Substring(5, 2), tbxBirthDay.Value.Substring(8, 2));

                kar.PhoneNumber = tbxFixTel.Value;
                kar.Mobile      = tbxMobile.Value;

                //stu.Email = tbxEmail.Value;

                rep.SaveEmployees(kar);
                Response.Redirect("http://localhost:4911/Dashboard/Admin/Employees.aspx");
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('شما با آدرس اشتباه وارد شده اید ! ');window.location ='http://localhost:4911/Dashboard/Admin/News.aspx'", true);
            }
        }
コード例 #3
0
        protected void btnSabtEditkartabl_Click(object sender, EventArgs e)
        {
            Karmand          stu = new Karmand();
            SchoolDBEntities db  = new SchoolDBEntities();

            Karmand stuu = db.Karmands.Where(p => p.UserName == "karim").Single();

            stu.EID          = lblID.InnerText.ToInt();
            stu.FirstName    = stuu.FirstName;
            stu.LastName     = stuu.LastName;
            stu.PersonalCode = lblPersonalCode.InnerText;
            stu.UserName     = stuu.UserName;
            stu.UserPass     = stuu.UserPass;

            stu.BirthDate = string.Format("{0}{1}{2}", tbxBirthYear.Value, stuu.BirthDate.Substring(4, 2), stuu.BirthDate.Substring(6, 2));

            stu.PhoneNumber = tbxFixTel.Value;
            stu.Mobile      = tbxMobile.Value;

            stu.Email = tbxEmail.Value;

            KarmandRepository sr = new KarmandRepository();

            sr.SaveEmployees(stu);
            Response.Redirect("http://localhost:4911/Dashboard/Admin/Kartabl.aspx");
        }
コード例 #4
0
        protected void btnSabtEditProfile_Click(object sender, EventArgs e)
        {
            Karmand kar = new Karmand();

            kar.UserName = tbxUserName.Value;
            kar.UserPass = tbxPassword.Value;

            kar.PersonalCode = tbxPersonalCode.Value;

            kar.FirstName = tbxFirstName.Value;
            kar.LastName  = tbxLastName.Value;
            kar.BirthDate = string.Format("{0}{1}{2}", tbxBirthDay.Value.Substring(0, 4), tbxBirthDay.Value.Substring(5, 2), tbxBirthDay.Value.Substring(8, 2));

            kar.PhoneNumber = tbxFixTel.Value;
            kar.Mobile      = tbxMobile.Value;

            // kar.Email = tbxEmail.Value;

            rep.SaveEmployees(kar);
            Response.Redirect("http://localhost:4911/Dashboard/Admin/Employees.aspx");
        }