Пример #1
0
        public void Accept(int ID)
        {
            PullCourseClass obj = new PullCourseClass();

            if (obj.AcceptDeanPullCourse(ID) == 1)
            {
                fillGv();
            }
        }
        protected void btnSaveDean_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"].ToString());
            string Path   = "";
            string Data   = txtNumCourse1.Text.ToString() + txtNumCourse2.Text.ToString() + txtNumCourse3.Text.ToString() +
                            txtNmberHours.Text.ToString() + txtNumHourAfter.Text.ToString() + DateTime.Today.ToString() + rbtAceptHead.SelectedValue.ToString() + rbtAcceptDean.SelectedValue.ToString();

            if (fuSignatureDean.HasFile)
            {
                string Private = fuSignatureDean.FileName.ToString();
                Path = System.Web.HttpContext.Current.Server.MapPath("../Test") + "/" + Private;
                string Pasword = txtPassSign.Text.ToString();
                fuSignatureDean.SaveAs(Server.MapPath("../Test") + "/" + fuSignatureDean.FileName);
                SignatureEmployee newSig     = new SignatureEmployee();
                string            strencrypt = newSig.encrypet(Data, Path, Pasword);
                Result = newSig.Decreypt(strencrypt, ID);
            }

            if (Result == true)
            {
                PullCourseClass obj        = new PullCourseClass();
                int             id         = Convert.ToInt32(Request.QueryString["id"]);
                int             AcceptDean = Convert.ToInt32(rbtAcceptDean.SelectedValue.ToString());
                string          DeanDec    = txtDescriptionDean.Text.ToString();
                if (obj.AcceptDeanPullCourse(id, AcceptDean, DeanDec) == 1)
                {
                    SentMail s = new SentMail();
                    s.sendemailReg();
                    Response.Redirect("ProcessRequest2.aspx");
                }

                errorDean.Visible = false;
            }
            else
            {
                errorDean.Text    = "التوقيع المدخل خاطئ او كلمة المرور";
                errorDean.Visible = true;
            }
        }