Ejemplo n.º 1
0
        public void LoadFacultyData(string Fid)
        {
            try
            {
                FacultiesRepositpry fir     = new FacultiesRepositpry();
                Faculty             faculty = fir.FindByid(Fid.ToInt());


                if (faculty != null)
                {
                    lbltitle.Text     = faculty.FacultyTitle;
                    lblFacultyid.Text = faculty.FacultyID.ToString();

                    TextBox1.Text = faculty.FacultyTitle;
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 2
0
        public void LoadLevelData(string Levelid)
        {
            try
            {
                EduLevelsRepository elir  = new EduLevelsRepository();
                EduLevel            level = elir.FindByid(Levelid.ToInt());


                if (level != null)
                {
                    lbltitle.Text = level.LevelTitle;

                    lbllevelid.Text = level.LevelID.ToString();
                    TextBox1.Text   = level.LevelTitle;
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 3
0
        public void loadform()
        {
            try
            {
                FacultiesRepositpry fair = new FacultiesRepositpry();
                DataTable           dt   = fair.GetAllFaculties();
                ddlfacultuy.Items.Clear();

                foreach (DataRow dr in dt.Rows)
                {
                    ddlfacultuy.Items.Add(new ListItem(dr["FacultyTitle"].ToString(), dr["FacultyID"].ToString()));
                }



                EduFieldsRepository fieldir = new EduFieldsRepository();
                DataTable           dtfield = fieldir.GetAllEduFields();
                foreach (DataRow dr in dtfield.Rows)
                {
                    ddlfield.Items.Add(new ListItem(dr["FieldTitle"].ToString(), dr["FieldID"].ToString()));
                }

                VEduTendenciesRepository tenir = new VEduTendenciesRepository();
                DataTable ten = tenir.GetAllTendency();
                foreach (DataRow dr in ten.Rows)
                {
                    ddltendency.Items.Add(new ListItem(dr["TendencyTitle"].ToString(), dr["TendencyID"].ToString()));
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
        public void loadform(string perid)
        {
            try
            {
                PersonsAdminsRepository per    = new PersonsAdminsRepository();
                PersonsAdmin            person = per.FindByid(perid.ToInt());

                if (person != null)
                {
                    lbllecid.Text            = person.AdminID.ToString();
                    txtname.Text             = person.FirstName;
                    txtlastname.Text         = person.LastName;
                    lblusername.Text         = person.Username;
                    Session["pass"]          = person.Password;
                    chkActiveAccount.Checked = (person.Status.Value == 0 ? true : false);
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
        public void loadform(string perid)
        {
            try
            {
                WebServiceAccountsRepository webir   = new WebServiceAccountsRepository();
                WebServiceAccount            account = webir.FindByid(perid.ToInt());
                if (account != null)
                {
                    lbllecid.Text = account.AccountID.ToString();


                    lblusername.Text = account.Username;

                    chkActiveAccount.Checked = (account.Status.Value == 0 ? true : false);
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
 protected void Button2_Click(object sender, EventArgs e)
 {
     if (tbxUsername.Text == "admin" && tbxPassword.Text == "adminhadaf")
     {
         Session["username"] = tbxUsername.Text.Trim();
         Session["password"] = tbxPassword.Text.Trim();
         Redirector.Goto(Redirector.PageName.adminpage);
     }
     else
     {
         HadafTools.ShowMessage(lblmessage, "نام کاربری یافت نشد", Color.Red);
     }
 }
Ejemplo n.º 7
0
        public void loadform()
        {
            try
            {
                lbluserid.Text     = Session["UserID"].ToString();
                lblusertypeid.Text = Session["UserTypeID"].ToString();
                EmailTypesRepository etr = new EmailTypesRepository();
                DataTable            dt  = etr.GetAllEmailTypes();
                ddlemailtype.Items.Clear();

                foreach (DataRow dr in dt.Rows)
                {
                    ddlemailtype.Items.Add(new ListItem(dr["EmailTypeTitle"].ToString(), dr["EmailTypeID"].ToString()));
                }



                switch (Session["UserTypeID"].ToString())
                {
                case "1":
                {
                    VStudentsRepository vstdir = new VStudentsRepository();
                    VStudent            std    = vstdir.FindByid(Session["UserID"].ToString().ToInt());
                    Label9.Text = "دانشجو" + ":" + std.FirstName + " " + std.LastName;
                }
                break;

                case "2":
                {
                    VLecturersRepository vlec = new VLecturersRepository();
                    VLecturer            lec  = vlec.FindByid(Session["UserID"].ToString().ToInt());
                    Label9.Text = "استاد" + ":" + lec.FirstName + " " + lec.LastName;
                }
                break;

                case "3":
                {
                    VEmployeesRepository vlec = new VEmployeesRepository();
                    VEmployee            emp  = vlec.FindByid(Session["UserID"].ToString().ToInt());
                    Label9.Text = "کارمند" + ":" + emp.FirstName + " " + emp.LastName;
                }
                break;
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 8
0
        protected void btnSubmitCaptcha_Click(object sender, EventArgs e)
        {
            bool success = false;

            if (Session["Captcha"] != null)
            {
                //Match captcha text entered by user and the one stored in session
                if (Convert.ToString(Session["Captcha"]) == txtCaptchaText.Text.Trim())
                {
                    success = true;
                }
            }

            lblStatus.Visible = true;
            if (success)
            {
                lblStatus.Text = "Success";
                PersonsAdminsRepository perir       = new PersonsAdminsRepository();
                PersonsAdmin            currentuser = perir.FindByUserName(tbxusername.Text);

                if (currentuser == null)
                {
                    PersonTools.ShowMessage(lblStatus, Resources.DashboardText.errInvalidUserPass, Color.Red);

                    return;
                }

                if (tbxpass.Text != currentuser.Password)
                {
                    PersonTools.ShowMessage(lblStatus, Resources.DashboardText.errInvalidUserPass, Color.Red);
                    return;
                }

                if (currentuser.Status.Value == 1)
                {
                    PersonTools.ShowMessage(lblStatus, Resources.DashboardText.errAccountIsLocked, Color.Red);
                    return;
                }


                Session["CurrentUser"] = currentuser;

                Redirector.Goto(Redirector.PageName.DepartmentsManager);
            }
            else
            {
                PersonTools.ShowMessage(lblStatus, Resources.DashboardText.errInvalidUserPass, Color.Red);
            }
        }
Ejemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         object o = Page.RouteData.Values["TelTypeID"];
         if (o != null)
         {
             LoadTelTypeData(o.ToString());
         }
         else
         {
             Redirector.Goto(Redirector.PageName.errorpage);
         }
     }
 }
Ejemplo n.º 10
0
        public void LoadEmailContactData(string userid, string usertypeid)
        {
            try
            {
                EmailContactsRepository dir = new EmailContactsRepository();
                Session["EmailPersonContactData"] = dir.GetEmailpersonContactList(userid.ToInt(), usertypeid.ToInt());

                GridView1.DataSource = Session["EmailPersonContactData"];


                GridView1.DataBind();

                lblrecordcount.Text = string.Format("{0} : {1}", dir.EmailContactCount().ToString().ToFarsiNumber(), Resources.DashboardText.RecordCount);

                lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["EmailPersonContactData"] as DataTable).Rows.Count.ToString().ToFarsiNumber(), Resources.DashboardText.SelectRecordCount);

                switch (Session["UserTypeID"].ToString())
                {
                case "1":
                {
                    VStudentsRepository vstdir = new VStudentsRepository();
                    VStudent            std    = vstdir.FindByid(Session["UserID"].ToString().ToInt());
                    Label9.Text = "دانشجو" + ":" + std.FirstName + " " + std.LastName;
                }
                break;

                case "2":
                {
                    VLecturersRepository vlec = new VLecturersRepository();
                    VLecturer            lec  = vlec.FindByid(Session["UserID"].ToString().ToInt());
                    Label9.Text = "استاد" + ":" + lec.FirstName + " " + lec.LastName;
                }
                break;

                case "3":
                {
                    VEmployeesRepository vlec = new VEmployeesRepository();
                    VEmployee            emp  = vlec.FindByid(Session["UserID"].ToString().ToInt());
                    Label9.Text = "کارمند" + ":" + emp.FirstName + " " + emp.LastName;
                }
                break;
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
        public void LoadStdData()
        {
            try
            {
                PersonsAdminsRepository pair = new PersonsAdminsRepository();
                Session["padata"]    = pair.GetAlldata();
                GridView1.DataSource = Session["padata"];
                GridView1.DataBind();

                lblrecordcount.Text = string.Format("{0} : {1}", pair.PersonAdmincount().ToString().ToFarsiNumber(), Resources.DashboardText.RecordCount);

                lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["padata"] as DataTable).Rows.Count.ToString().ToFarsiNumber(), Resources.DashboardText.SelectRecordCount);
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         object o = Page.RouteData.Values["UserTypeID"];
         Session["UserTypeID"] = o.ToString();
         object oo = Page.RouteData.Values["UserID"];
         Session["UserID"] = oo.ToString();
         if (o != null && oo != null)
         {
             LoadEmailContactData(Session["UserID"].ToString(), Session["UserTypeID"].ToString());
         }
         else
         {
             Redirector.Goto(Redirector.PageName.errorpage);
         }
     }
 }
Ejemplo n.º 13
0
        public void LoadStdData()
        {
            try
            {
                VStudentsRepository vstdir = new VStudentsRepository();
                Session["stddata"]   = vstdir.GetAllvstd();
                GridView1.DataSource = Session["stddata"];


                GridView1.DataBind();

                lblrecordcount.Text = string.Format("{0} : {1}", vstdir.stdcount().ToString().ToFarsiNumber(), Resources.DashboardText.RecordCount);

                lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["stddata"] as DataTable).Rows.Count.ToString().ToFarsiNumber(), Resources.DashboardText.SelectRecordCount);
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 14
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            string            username    = tbxUsername.Text.Trim();
            CounterRepository ar          = new CounterRepository();
            Counter           currentUser = ar.FindBystdid(username);


            if (currentUser == null)
            {
                HadafTools.ShowMessage(lblmessage, "توسط این کاربر ثبت نامی انجام نشده است", Color.Red);

                return;
            }

            else
            {
                string stdid = tbxUsername.Text;
                Session["studentid"] = stdid;
                Redirector.Goto(Redirector.PageName.StdUnit);
            }
        }
Ejemplo n.º 15
0
        public void loadform()
        {
            try
            {
                DepartmentsRepository depir = new DepartmentsRepository();
                DataTable             dep   = depir.GetAllDepartment();

                foreach (DataRow dr in dep.Rows)
                {
                    ddldep.Items.Add(new ListItem(dr["DepartmentTitle"].ToString(), dr["DepartmentID"].ToString()));
                }

                RolesRepository roleir = new RolesRepository();
                DataTable       role   = roleir.GetAllRoles();
                foreach (DataRow dr in role.Rows)
                {
                    ddlrole.Items.Add(new ListItem(dr["RoleTitle"].ToString(), dr["RoleID"].ToString()));
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 16
0
        public void LoadDepartmentData(string Depid)
        {
            try
            {
                DepartmentsRepository dir        = new DepartmentsRepository();
                Department            department = dir.FindByid(Depid.ToInt());

                if (department != null)
                {
                    lbltitle.Text = department.DepartmentTitle;

                    lblDepartmentid.Text = department.DepartmentID.ToString();
                    TextBox1.Text        = department.DepartmentTitle;
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 17
0
        public void LoadTelTypeData(string Telid)
        {
            try
            {
                TelTypesRepository etir    = new TelTypesRepository();
                TelType            Teltype = etir.FindByid(Telid.ToInt());


                if (Teltype != null)
                {
                    lbltitle.Text       = Teltype.TelTypeTitle;
                    lblEmailTypeid.Text = Teltype.TelTypeID.ToString();
                    TextBox1.Text       = Teltype.TelTypeTitle;
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 18
0
        public void LoadDepartmentData(string Roleid)
        {
            try
            {
                RolesRepository rrir = new RolesRepository();
                Role            role = rrir.FindByid(Roleid.ToInt());

                if (role != null)
                {
                    lbltitle.Text  = role.RoleTitle;
                    lblRoleid.Text = role.RoleID.ToString();

                    TextBox1.Text = role.RoleTitle;
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 19
0
        public void LoadFieldData(string Fieldid)
        {
            try
            {
                EduFieldsRepository efir  = new EduFieldsRepository();
                EduField            field = efir.FindByid(Fieldid.ToInt());

                if (field != null)
                {
                    lbltitle.Text = field.FieldTitle;

                    lblFieldid.Text = field.FieldID.ToString();
                    TextBox1.Text   = field.FieldTitle;
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
Ejemplo n.º 20
0
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     Redirector.Goto(Redirector.PageName.TelTypesManagment);
 }
Ejemplo n.º 21
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            UserRepository ar          = new UserRepository();
            enter          currentUser = ar.FindByUserName(Label1.Text);
            string         status      = currentUser.Status.ToString();

            if (status == "0")
            {
                //try
                //{
                int unit = 0;
                int sum;
                sum = 0;
                string succsesfulsave = "";
                foreach (GridViewRow gvr in GridView1.Rows)
                {
                    if ((gvr.FindControl("CheckBox1") as CheckBox).Checked == true)
                    {
                        unit = gvr.Cells[2].Text.ToInt();
                        sum  = sum + unit;
                    }
                }
                Label2.Text = sum.ToString();

                if ((sum >= 12) && (sum <= 20))
                {
                    lblmessage.Text = "";
                    foreach (GridViewRow gvr in GridView1.Rows)
                    {
                        if ((gvr.FindControl("CheckBox1") as CheckBox).Checked == true)
                        {
                            try
                            {
                                CoursRepository air        = new CoursRepository();
                                Counter         newAccount = new Counter();
                                //  string reshte=
                                newAccount.Reshte    = Session["value"].ToString();
                                newAccount.stdid     = Label1.Text;
                                newAccount.CoursUnit = gvr.Cells[2].Text.ToInt();
                                newAccount.CoursName = gvr.Cells[1].Text;
                                air.Savecourse(newAccount);


                                //  HadafTools.ShowMessage(lblmessage, " ثبت با موفقیت انجام شد ", Color.Red);

                                succsesfulsave = "ok";
                            }
                            catch
                            {
                                HadafTools.ShowMessage(lblmessage, " ثبت امکانپذیر  نمی باشد ", Color.Red);
                            }
                        }
                    }
                    if (succsesfulsave == "ok")
                    {
                        UserRepository ur   = new UserRepository();
                        enter          user = ur.FindByUserName(Label1.Text);
                        user.Status = int.Parse("1");
                        ur.Savestatus(user);


                        studentcountRepository str = new studentcountRepository();
                        Student newstd             = new Student();
                        newstd.stdid  = Label1.Text;
                        newstd.Reshte = Session["value"].ToString();
                        str.Save(newstd);
                        Redirector.Goto(Redirector.PageName.ok);
                    }
                }

                else
                {
                    HadafTools.ShowMessage(lblmessage, " تعداد واحد مجاز نمی باشد ", Color.Red);
                }
                // }
                //catch
                //{
                //    HadafTools.ShowMessage(lblmessage, " ثبت امکانپذیر  نمی باشد ", Color.Red);
                //}
            }
            else
            {
                HadafTools.ShowMessage(lblmessage, " پیش ثبت توسط این نام کاربری قبلا انجام شد ", Color.Red);
            }
        }
 protected void Button2_Click(object sender, EventArgs e)
 {
     Redirector.Goto(Redirector.PageName.insertstd);
 }
Ejemplo n.º 23
0
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     Redirector.Goto(Redirector.PageName.DepartmentsManager);
 }
Ejemplo n.º 24
0
 protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
 {
     Redirector.Goto(Redirector.PageName.PersonsAdminsManagment);
 }
Ejemplo n.º 25
0
 protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
 {
     Redirector.Goto(Redirector.PageName.EduFieldsManager);
 }
 protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
 {
     Redirector.Goto(Redirector.PageName.WebServiceManagement);
 }
Ejemplo n.º 27
0
        public void loadform()
        {
            try
            {
                EmailContactsRepository ecrir = new EmailContactsRepository();
                EmailContact            email = ecrir.FindByid(Session["ID"].ToString().ToInt());
                lblid.Text           = email.ID.ToString();
                lbluserid.Text       = Session["UserID"].ToString();
                lblusertypeid.Text   = Session["UserTypeID"].ToString();
                Session["EmailType"] = email.EmailTypeID.ToString();

                lblemailaddrress.Text = email.EmailAddrress;

                Session["newemailtype"] = email.EmailTypeID.ToString();


                switch (Session["UserTypeID"].ToString())
                {
                case "1":
                {
                    VStudentsRepository vstdir = new VStudentsRepository();
                    VStudent            std    = vstdir.FindByid(Session["UserID"].ToString().ToInt());
                    Label9.Text = "دانشجو" + ":" + std.FirstName + " " + std.LastName;
                }
                break;

                case "2":
                {
                    VLecturersRepository vlec = new VLecturersRepository();
                    VLecturer            lec  = vlec.FindByid(Session["UserID"].ToString().ToInt());
                    Label9.Text = "استاد" + ":" + lec.FirstName + " " + lec.LastName;
                }
                break;

                case "3":
                {
                    VEmployeesRepository vlec = new VEmployeesRepository();
                    VEmployee            emp  = vlec.FindByid(Session["UserID"].ToString().ToInt());
                    Label9.Text = "کارمند" + ":" + emp.FirstName + " " + emp.LastName;
                }
                break;
                }



                EmailTypesRepository etir      = new EmailTypesRepository();
                EmailType            emailtype = etir.FindByid(Session["EmailType"].ToString().ToInt());
                if (emailtype != null)
                {
                    lblEmailtype.Text = emailtype.EmailTypeTitle;
                    // Label7.Text = std.FirstName.ToString() + " " + std.LastName.ToString();
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }


                EmailTypesRepository etr = new EmailTypesRepository();
                DataTable            dt2 = etr.GetAllEmailTypes();
                ddlemailtype.Items.Clear();

                foreach (DataRow dr in dt2.Rows)
                {
                    ddlemailtype.Items.Add(new ListItem(dr["EmailTypeTitle"].ToString(), dr["EmailTypeID"].ToString()));
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }
 protected void Button3_Click(object sender, EventArgs e)
 {
     Redirector.Goto(Redirector.PageName.stdsearch);
 }
Ejemplo n.º 29
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Redirector.Goto(Redirector.PageName.AddTelType);
 }
Ejemplo n.º 30
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     Redirector.Goto(Redirector.PageName.AddStudent);
 }