Exemplo n.º 1
0
        public void Accept(int ID)
        {
            ShowStatusClass obj = new ShowStatusClass();

            if (obj.AcceptDeanShowStatus(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   = labDate.Text.ToString() + labStudentNumber.Text.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)
            {
                ShowStatusClass obj        = new ShowStatusClass();
                int             id         = Convert.ToInt32(Request.QueryString["id"]);
                int             AcceptDean = Convert.ToInt32(rbtAcceptDean.SelectedValue.ToString());
                string          DeanDec    = txtDescriptionDean.Text.ToString();
                if (obj.AcceptDeanShowStatus(id, AcceptDean, DeanDec) == 1)
                {
                    DataRow  dr    = obj.drgetform(id);
                    int      STUid = Convert.ToInt32(dr["StudentID"].ToString());
                    SentMail s     = new SentMail();
                    s.sendemailStudent(STUid);
                    Response.Redirect("ProcessRequest2.aspx");
                }

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