예제 #1
0
        public void LoadTelContactData(string userid, string usertypeid)
        {
            //try
            //{

            TelContactsRepository dir = new  TelContactsRepository();

            Session["TelPersonContactData"] = dir.GetTelpersonContactList(userid.ToInt(), usertypeid.ToInt());

            GridView1.DataSource = Session["TelPersonContactData"];


            GridView1.DataBind();

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

            lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["TelPersonContactData"] 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);
            // }
        }
예제 #2
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);
            }
        }
예제 #3
0
        public VLecturer FindByid(int id)
        {
            VLecturer result = null;

            using (PersonsDBEntities DC = conn.GetContext())
            {
                //--  SELECT * FROM vPhoneList WHERE PhobeID = phoneID

                result = (from r in DC.VLecturers
                          where r.LecturerID == id
                          select r).FirstOrDefault();
            }

            return(result);
        }
예제 #4
0
        public VLecturer FindBynationalcode(string text)
        {
            VLecturer result = null;

            using (PersonsDBEntities DC = conn.GetContext())
            {
                //--  SELECT * FROM vPhoneList WHERE PhobeID = phoneID

                result = (from r in DC.VLecturers
                          where r.NationalCode == text
                          select r).FirstOrDefault();
            }

            return(result);
        }
예제 #5
0
        public VLecturer FindByuserName(string userName)
        {
            VLecturer result = null;

            using (PersonsDBEntities DC = conn.GetContext())
            {
                //--  SELECT * FROM vPhoneList WHERE PhobeID = phoneID

                result = (from r in DC.VLecturers
                          where r.Username == userName
                          select r).FirstOrDefault();
            }

            return(result);
        }
예제 #6
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);
            }
        }
예제 #7
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);
            }
        }