public void FamilyInfo()
        {
            int h = 0;

            h = int.Parse(Session["familyformID"].ToString());
            try
            {
                using (LawyersEntities dc = new LawyersEntities())
                {
                    // Check If Existed Or Not :
                    var u = dc.FamilyForum_Table.Single(i => i.FamilyForumID == h
                                                        );
                    if (u != null)
                    {
                        ViewBag.ApplicantName = u.ApplicantName;
                        ViewBag.CustodialName = u.CustodialName;
                    }
                }
            }
            catch (Exception)
            {
                //اذا كان المستخدم اساسا مش موجود في جدول المستخدمين او كلمة المرور خطأ
                ModelState.AddModelError("", "خطأ في الدخول للنظام");
            }
        }
Ejemplo n.º 2
0
        // GET: Order
        public ActionResult Order(string projectid)
        {
            Session["Projectid"] = int.Parse(projectid.ToString());
            int proid  = int.Parse(Session["Projectid"].ToString());
            int UserID = int.Parse(Session["UserID"].ToString());

            if ((string)Session["UserType"] != "1")
            {
                try
                {
                    using (LawyersEntities dc = new LawyersEntities())
                    {
                        // Check If Existed Or Not :
                        var u = dc.ProjectControl_Table.Single(i => i.UserID == UserID &&
                                                               i.ProjectID == proid &&
                                                               i.Status == true);
                        if (u != null)
                        {
                            ViewBag.CurrentUser = true;
                        }
                    }
                }
                catch (Exception)
                {
                    ViewBag.CurrentUser = false;
                }
            }
            PopulateIssuesType();
            PopulateUsers();
            PopulateTypeOfCase();
            PopulateCourts();
            PopulateGovernorate();
            PopulateArea();
            return(View());
        }
Ejemplo n.º 3
0
        private static IEnumerable <CoursesViewModel> GetOrders()
        {
            var entities = new LawyersEntities();

            return(entities.Courses_Table
                   .Select(db => new CoursesViewModel
            {
                CoursesID = db.CoursesID,
                CoursesName = db.CoursesName,
                CoursesStartDate = db.CoursesStartDate.HasValue ? db.CoursesStartDate.Value : default(DateTime),
                CoursesEndDate = db.CoursesEndDate.HasValue ? db.CoursesEndDate.Value : default(DateTime),
                TotalSessions = db.TotalSessions,
                TrainingHours = db.TrainingHours,
                TotalBeneficiaries = db.TotalBeneficiaries,
                Males = db.Males,
                Females = db.Females,
                UserID = db.UserID,

                Users = new UsersForeignkey()
                {
                    UserID = db.Users_Table.UserID,
                    FullName = db.Users_Table.FullName,
                },
                TargetGroupID = db.TargetGroupID,

                TargetGroup = new TargetGroupFroingKey()
                {
                    TargetGroupID = db.TargetGroup_Table.TargetGroupID,
                    TargetGroupName = db.TargetGroup_Table.TargetGroupName,
                },

                ProjectID = db.ProjectID,
            }));
        }
        // GET: Advocacyactivities
        public ActionResult Advocacy(string projectid)
        {
            Session["Projectid"] = int.Parse(projectid.ToString());
            int proid  = int.Parse(Session["Projectid"].ToString());
            int UserID = int.Parse(Session["UserID"].ToString());

            #region (تأكيد اذا كان المستخدم تابع لمشروع)
            if ((string)Session["UserType"] != "1")
            {
                try
                {
                    using (LawyersEntities dc = new LawyersEntities())
                    {
                        // Check If Existed Or Not :
                        var u = dc.ProjectControl_Table.Single(i => i.UserID == UserID &&
                                                               i.ProjectID == proid &&
                                                               i.Status == true);
                        if (u != null)
                        {
                            ViewBag.CurrentUser = true;
                        }
                    }
                }
                catch (Exception)
                {
                    ViewBag.CurrentUser = false;
                }
            }
            #endregion

            PopulateUsers();
            return(View());
        }
        private static IEnumerable <BeneficiariesForeignkey> GetBeneficiaries()
        {
            var northwind = new LawyersEntities();

            return(northwind.Beneficiaries_Table.Select(order => new BeneficiariesForeignkey
            {
                BeneficiariesIDNumber = order.BeneficiariesIDNumber,
                BeneficiariesName = order.BeneficiariesName,

                Beneficiaries_ID = order.Beneficiaries_ID
            }));
        }
        public JsonResult GetGovernorate()
        {
            var northwind = new LawyersEntities();


            var province = northwind.Governorate_Table.Select(db => new GovernorateForeignkey
            {
                Governorate_ID   = db.Governorate_ID,
                Governorate_Name = db.Governorate_Name
            });


            return(Json(province, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 7
0
        private void PopulateIssuesType()
        {
            var dataContext = new LawyersEntities();
            var IssuesType  = dataContext.IssuesType_Table
                              .Select(c => new IssuesTypeForeingKey
            {
                IssuesTypeID   = c.IssuesTypeID,
                IssuesTypename = c.IssuesTypename
            })
                              .OrderBy(e => e.IssuesTypeID);

            ViewData["IssuesType"]        = IssuesType;
            ViewData["defaultIssuesType"] = IssuesType.First();
        }
Ejemplo n.º 8
0
        public void PopulateProject()
        {
            var dataContext = new LawyersEntities();
            var Project     = dataContext.Project_Table

                              .Select(c => new ProjectForeignkey
            {
                ProjectID   = c.ProjectID,
                ProjectName = c.ProjectName
            })
                              .OrderBy(e => e.ProjectID);

            ViewData["Project"]        = Project;
            ViewData["defaultProject"] = Project.First();
        }
Ejemplo n.º 9
0
        public void PopulateLawyer()
        {
            var dataContext = new LawyersEntities();
            var Lawyer      = dataContext.Lawyer_Table

                              .Select(c => new LawyerForeignkey
            {
                LawyerID   = c.LawyerID,
                LawyerName = c.LawyerName
            })
                              .OrderBy(e => e.LawyerID);

            ViewData["Lawyer"]        = Lawyer;
            ViewData["defaultLawyer"] = Lawyer.First();
        }
Ejemplo n.º 10
0
        public JsonResult GetArea(int Governorate_ID)
        {
            var northwind = new LawyersEntities();


            var province = northwind.Area_Table.Where(m => m.Governorate_ID == Governorate_ID).Select(db => new AreaForeignkey
            {
                Area_ID   = db.Area_ID,
                Area_Name = db.Area_Name
            });



            return(Json(province, JsonRequestBehavior.AllowGet));
        }
        public void PopulateUsers()
        {
            var dataContext = new LawyersEntities();
            var users       = dataContext.Users_Table

                              .Select(c => new UsersForeignkey
            {
                UserID   = c.UserID,
                FullName = c.FullName
            })
                              .OrderBy(e => e.UserID);

            ViewData["users"]       = users;
            ViewData["defaultUser"] = users.First();
        }
Ejemplo n.º 12
0
        public void PopulateTargetGroup()
        {
            var dataContext = new LawyersEntities();
            var TargetGroup = dataContext.TargetGroup_Table

                              .Select(c => new TargetGroupFroingKey
            {
                TargetGroupID   = c.TargetGroupID,
                TargetGroupName = c.TargetGroupName
            })
                              .OrderBy(e => e.TargetGroupID);

            ViewData["TargetGroup"]        = TargetGroup;
            ViewData["defaultTargetGroup"] = TargetGroup.First();
        }
Ejemplo n.º 13
0
        public void PopulateGovernorate()
        {
            var dataContext = new LawyersEntities();
            var Governorate = dataContext.Governorate_Table

                              .Select(c => new GovernorateForeignkey
            {
                Governorate_ID   = c.Governorate_ID,
                Governorate_Name = c.Governorate_Name
            })
                              .OrderBy(e => e.Governorate_ID);

            ViewData["Governorate"]        = Governorate;
            ViewData["defaultGovernorate"] = Governorate.First();
        }
Ejemplo n.º 14
0
        public void PopulateTypeOfCase()
        {
            var dataContext = new LawyersEntities();
            var typeOfcase  = dataContext.TypeOfCase_Table

                              .Select(c => new TypeOfCaseForeignkey
            {
                TypeOfCaseID = c.TypeOfCase_ID,
                TypeOfCase   = c.TypeOfCaseName
            })
                              .OrderBy(e => e.TypeOfCaseID);

            ViewData["typeOfcase"]        = typeOfcase;
            ViewData["defaultTypeOfCase"] = typeOfcase.First();
        }
Ejemplo n.º 15
0
        public void PopulateCourts()
        {
            var dataContext = new LawyersEntities();
            var Courts      = dataContext.Courts_Table

                              .Select(c => new CourtsForeignkey
            {
                CourtsID   = c.CourtsID,
                CourtsName = c.CourtsName
            })
                              .OrderBy(e => e.CourtsID);

            ViewData["Courts"]        = Courts;
            ViewData["defaultCourts"] = Courts.First();
        }
Ejemplo n.º 16
0
        public void PopulateMediaType()
        {
            var dataContext = new LawyersEntities();
            var MediaType   = dataContext.MediaType_Table

                              .Select(c => new MediaTypeForingKey
            {
                MediaTypeID   = c.MediaTypeID,
                MediaTypeName = c.MediaTypeName
            })
                              .OrderBy(e => e.MediaTypeID);

            ViewData["MediaType"]        = MediaType;
            ViewData["defaultMediaType"] = MediaType.First();
        }
Ejemplo n.º 17
0
        public void PopulateArea()
        {
            var dataContext = new LawyersEntities();
            var Area        = dataContext.Area_Table

                              .Select(c => new AreaForeignkey
            {
                Area_ID   = c.Area_ID,
                Area_Name = c.Area_Name
            })
                              .OrderBy(e => e.Area_ID);

            ViewData["Area"]        = Area;
            ViewData["defaultArea"] = Area.First();
        }
Ejemplo n.º 18
0
        public void PopulateDiligenceType()
        {
            //  وهنا كمان لازم يكون نشيط حتى يتم ادراجه في المشاريع
            var dataContext   = new LawyersEntities();
            var DiligenceType = dataContext.DiligenceType_Table

                                .Select(c => new DiligenceTypeForeingKey
            {
                DiligenceTypeID   = c.DiligenceTypeID,
                DiligenceTypeName = c.DiligenceTypeName
            })
                                .OrderBy(e => e.DiligenceTypeID);

            ViewData["DiligenceType"]        = DiligenceType;
            ViewData["defaultDiligenceType"] = DiligenceType.First();
        }
Ejemplo n.º 19
0
        public void PopulateIssuesType()
        {
            //  وهنا كمان لازم يكون نشيط حتى يتم ادراجه في المشاريع
            var dataContext = new LawyersEntities();
            var IssuesType  = dataContext.IssuesType_Table

                              .Select(c => new IssuesTypeForeingKey
            {
                IssuesTypeID   = c.IssuesTypeID,
                IssuesTypename = c.IssuesTypename
            })
                              .OrderBy(e => e.IssuesTypeID);

            ViewData["IssuesType"]        = IssuesType;
            ViewData["defaultIssuesType"] = IssuesType.First();
        }
        public void PopulateGender()
        {
            //  وهنا كمان لازم يكون نشيط حتى يتم ادراجه في المشاريع
            var dataContext = new LawyersEntities();
            var Gender      = dataContext.Gender_Table

                              .Select(c => new GenderForeignkey
            {
                GenderID   = c.GenderID,
                GenderName = c.GenderName
            })
                              .OrderBy(e => e.GenderID);

            ViewData["Gender"]        = Gender;
            ViewData["defaultGender"] = Gender.First();
        }
Ejemplo n.º 21
0
        public void PopulateUsers()
        {
            //  وهنا كمان لازم يكون نشيط حتى يتم ادراجه في المشاريع
            var dataContext = new LawyersEntities();
            var users       = dataContext.Users_Table

                              .Select(c => new UsersForeignkey
            {
                UserID   = c.UserID,
                FullName = c.FullName
            })
                              .OrderBy(e => e.UserID);

            ViewData["users"]       = users;
            ViewData["defaultUser"] = users.First();
        }
        public void PopulateIssuesStatus()
        {
            //  وهنا كمان لازم يكون نشيط حتى يتم ادراجه في المشاريع
            var dataContext  = new LawyersEntities();
            var IssuesStatus = dataContext.IssuesStatus_Table


                               .Select(c => new IssuesStatusForeignkey
            {
                IssuesStatusID   = c.IssuesStatusID,
                IssuesStatusName = c.IssuesStatusName
            })
                               .OrderBy(e => e.IssuesStatusID);

            ViewData["IssuesStatus"]        = IssuesStatus;
            ViewData["defaultIssuesStatus"] = IssuesStatus.First();
        }
        public ActionResult ADDBenef(BeneficiariesViewModel db)
        {
            LawyersEntities entities = new LawyersEntities();
            var             entity   = new Beneficiaries_Table();

            entity.BeneficiariesIDNumber = db.BeneficiariesIDNumber;

            entity.BeneficiariesName = db.BeneficiariesName;

            entity.BeneficiariesPhone = db.BeneficiariesPhone;
            entity.GenderID           = db.GenderID;

            entities.Beneficiaries_Table.Add(entity);
            entities.SaveChanges();

            db.Beneficiaries_ID = entity.Beneficiaries_ID;
            return(View());
        }
Ejemplo n.º 24
0
        public ActionResult Login(Users_Table user)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    using (LawyersEntities dc = new LawyersEntities())
                    {
                        // Check If Existed Or Not :
                        var u = dc.Users_Table.Single(i => i.UserName == user.UserName &&
                                                      i.Password == user.Password &&
                                                      i.Status == true);
                        if (u != null)
                        {
                            Session["UserID"]   = u.UserID;
                            Session["UserName"] = u.FullName;
                            Session["Password"] = u.Password;
                            Session["UserType"] = u.UserType;

                            if ((string)Session["UserType"] == "1" || (string)Session["UserType"] == "2" || (string)Session["UserType"] == "3")
                            {
                                return(RedirectToAction("Index", "Home"));
                            }
                            else if ((string)Session["UserType"] == "4")
                            {
                                return(RedirectToAction("FamilyForum", "FamilyForum"));
                            }



                            //  User Informations :
                        }
                    }
                }
                catch (Exception)
                {
                    //اذا كان المستخدم اساسا مش موجود في جدول المستخدمين او كلمة المرور خطأ
                    ModelState.AddModelError("", "خطأ في الدخول للنظام");
                }
            }
            return(View(user));
        }
Ejemplo n.º 25
0
 public ActionResult db_Create([DataSourceRequest] DataSourceRequest request, ProjectControlViewModel db)
 {
     try
     {
         LawyersEntities entities = new LawyersEntities();
         var             project  = entities.ProjectControl_Table
                                    .Single(i => i.UserID == db.UserID &&
                                            i.ProjectID == db.ProjectID);
         db.ProjectControlID = 0;
         ModelState.AddModelError("خطأ", "المستخدم موجود مسبقا في المشروع");
     }
     catch (Exception)
     {
         if (db != null && ModelState.IsValid)
         {
             ProjectControlSerivce.Create(db);
             return(Json(new[] { db }.ToDataSourceResult(request, ModelState)));
         }
     }
     return(Json(new[] { db }.ToDataSourceResult(request, ModelState)));
 }
Ejemplo n.º 26
0
 public UserService(LawyersEntities entities)
 {
     this.entities = entities;
 }
Ejemplo n.º 27
0
 public CoursesService(LawyersEntities entities)
 {
     this.entities = entities;
 }
Ejemplo n.º 28
0
 public ProjectService(LawyersEntities entities)
 {
     this.entities = entities;
 }
Ejemplo n.º 29
0
 public LegalIssuesService(LawyersEntities entities)
 {
     this.entities = entities;
 }
Ejemplo n.º 30
0
 public MediationService(LawyersEntities entities)
 {
     this.entities = entities;
 }