Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
0
        public void loadform()
        {
            EduFieldsRepository efir = new EduFieldsRepository();

            DataTable dt = efir.GetAllEduFields();

            ddlfield.Items.Clear();

            foreach (DataRow dr in dt.Rows)
            {
                ddlfield.Items.Add(new ListItem(dr["FieldTitle"].ToString(), dr["FieldID"].ToString()));
            }
        }
Exemplo n.º 3
0
        public void LoadFieldData()
        {
            EduFieldsRepository efir = new EduFieldsRepository();

            Session["FieldData"] = efir.GetAllEduFields();

            GridView1.DataSource = Session["FieldData"];


            GridView1.DataBind();

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

            lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["FieldData"] as DataTable).Rows.Count.ToString().ToFarsiNumber(), Resources.DashboardText.SelectRecordCount);
        }
Exemplo n.º 4
0
        public DataTable GetEduField(string username, string password)
        {
            WebServiceAccountsRepository webir       = new WebServiceAccountsRepository();
            WebServiceAccount            currentuser = webir.FindByUserName(username);

            if (currentuser != null)
            {
                if (currentuser.Password == password)
                {
                    EduFieldsRepository depir = new EduFieldsRepository();
                    return(depir.GetAllEduFields());
                }
                else
                {
                    return(null);
                }
            }

            else
            {
                return(null);
            }
        }
Exemplo n.º 5
0
        public void loadform(string stdi)
        {
            //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()));
            }


            EduLevelsRepository leveir  = new EduLevelsRepository();
            DataTable           dtlevel = leveir.GetAllEduLevels();

            foreach (DataRow dr in dtlevel.Rows)
            {
                ddllevel.Items.Add(new ListItem(dr["LevelTitle"].ToString(), dr["LevelID"].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()));
            }

            VStudentsRepository vstir = new VStudentsRepository();
            VStudent            std   = vstir.FindByid(stdi.ToInt());

            if (std != null)
            {
                lblstdid.Text    = std.StudentID.ToString();
                txtstdcode.Text  = std.StudentCode;
                txtname.Text     = std.FirstName;
                txtlastname.Text = std.LastName;
                RadioButtonList1.SelectedValue = std.Gender.ToString();
                txtnationalcode.Text           = std.NationalCode;
                lblfaculty.Text = std.FacultyTitle;
                lbllevel.Text   = std.LevelTitle;
                lblfield.Text   = std.FieldTitle;
                lbltend.Text    = std.TendencyTitle;
                RadioButtonList2.SelectedValue = std.EntryTerm.ToString();

                lblusername.Text = std.Username;
                if (txtpass.Text != null)
                {
                    txtpass.Text = std.Password;
                }

                //  ImageButton1.ImageUrl = std.ImageFileName;
                Session["newfacultyid"]  = std.FacultyID.ToString();
                Session["newlevelid"]    = std.LevelID.ToString();
                Session["newfieldid"]    = std.FieldID.ToString();
                Session["newtenid"]      = std.TendencyID.ToString();
                Session["pass"]          = std.Password;
                chkActiveAccount.Checked = (std.Status.Value == 0 ? true : false);
                Session["imageurl"]      = std.ImageFileName;
                if (Session["imageurl"].ToString() != null)
                {
                    ImageButton2.ImageUrl = "~/file/" + std.ImageFileName;
                }
            }
            else
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }



            //}
            //catch
            //{
            //       Redirector.Goto(Redirector.PageName.errorpage);

            //}
        }
Exemplo n.º 6
0
        public void loadform(string Leci)
        {
            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()));
                }

                VLecturersRepository vstir = new VLecturersRepository();
                VLecturer            Lec   = vstir.FindByid(Leci.ToInt());
                if (Lec != null)
                {
                    lbllecid.Text    = Lec.LecturerID.ToString();
                    txtname.Text     = Lec.FirstName;
                    txtlastname.Text = Lec.LastName;
                    RadioButtonList1.SelectedValue = Lec.Gender.ToString();
                    txtnationalcode.Text           = Lec.NationalCode;
                    lblfaculty.Text = Lec.FacultyTitle;

                    lblfield.Text = Lec.FieldTitle;
                    lbltend.Text  = Lec.TendencyTitle;

                    lblusername.Text = Lec.Username;
                    if (txtpass.Text != null)
                    {
                        txtpass.Text = Lec.Password;
                    }

                    //  ImageButton1.ImageUrl = Lec.ImageFileName;
                    Session["newfacultyid"]  = Lec.FacultyID.ToString();
                    Session["pass"]          = Lec.Password.ToString();
                    Session["newfieldid"]    = Lec.FieldID.ToString();
                    Session["newtenid"]      = Lec.TendencyID.ToString();
                    chkActiveAccount.Checked = (Lec.Status.Value == 0 ? true : false);

                    Session["imageurl"] = Lec.ImageFileName.ToString();
                    if (Session["imageurl"].ToString() != null)
                    {
                        ImageButton2.ImageUrl = "~/file/" + Lec.ImageFileName;
                    }
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }