public JsonResult Delete(int id)
        {
            EmployeeExperiencesWithDetailsBLL EmployeeExperiencesWithDetail = new EmployeeExperiencesWithDetailsBLL();

            EmployeeExperiencesWithDetail.LoginIdentity = UserIdentity;
            Result result = EmployeeExperiencesWithDetail.Remove(id);

            return(Json(new
            {
                data = EmployeeExperiencesWithDetail
            }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetByID(int id)
        {
            EmployeeExperiencesWithDetailsBLL exp = new EmployeeExperiencesWithDetailsBLL().GetByEmployeesExperiencesWithDetailID(id);

            return(Json(new
            {
                EmployeeExperienceWithDetailID = exp.EmployeeExperienceWithDetailID,
                JobName = exp.JobName,
                FromDate = exp.FromDate,
                ToDate = exp.ToDate,
                SectorName = exp.SectorName,
                SectorTypeID = exp.SectorsTypes.SectorTypeID,
                SectorTypeName = exp.SectorsTypes.SectorTypeName,
                CreatedBy = exp.CreatedBy.Employee.EmployeeNameAr,
                CreatedDate = exp.CreatedDate
            }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Create(EmployeeExperiencesWithDetailsViewModel EmployeeExperienceVM)
        {
            EmployeeExperiencesWithDetailsBLL EmployeeExperiencesWithDetails = new EmployeeExperiencesWithDetailsBLL();

            EmployeeExperiencesWithDetails.JobName      = EmployeeExperienceVM.JobName;
            EmployeeExperiencesWithDetails.FromDate     = EmployeeExperienceVM.FromDate;
            EmployeeExperiencesWithDetails.ToDate       = EmployeeExperienceVM.ToDate;
            EmployeeExperiencesWithDetails.SectorName   = EmployeeExperienceVM.SectorName;
            EmployeeExperiencesWithDetails.SectorsTypes = new SectorsTypesBLL()
            {
                SectorTypeID = EmployeeExperienceVM.SectorTypeID
            };
            EmployeeExperiencesWithDetails.EmployeesCodes = new EmployeesCodesBLL()
            {
                EmployeeCodeID = EmployeeExperienceVM.EmployeeVM.EmployeeCodeID.Value
            };
            EmployeeExperiencesWithDetails.LoginIdentity = UserIdentity;
            Result result = EmployeeExperiencesWithDetails.Add();

            return(Json(new { data = EmployeeExperiencesWithDetails.EmployeeExperienceWithDetailID }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetEmployeeExperiencesWithDetails()
        {
            EmployeeExperiencesWithDetailsViewModel VW = new EmployeeExperiencesWithDetailsViewModel();
            CultureInfo enCul = new CultureInfo("en-US");

            var data = new EmployeeExperiencesWithDetailsBLL().GetEmployeesExperiences()
                       .Select(x => new
            {
                EmployeeExperienceWithDetailID = x.EmployeeExperienceWithDetailID,
                EmployeeCodeNo = x.EmployeesCodes.EmployeeCodeNo,
                EmployeeNameAr = x.EmployeesCodes.Employee.EmployeeNameAr,
                x.SectorsTypes.SectorTypeName,
                x.SectorName,
                x.JobName,
                FromDate    = Globals.Calendar.GetUmAlQuraDate(x.FromDate),
                ToDate      = Globals.Calendar.GetUmAlQuraDate(x.ToDate),
                FromDateGr  = x.FromDate.ToString(ConfigurationManager.AppSettings["DateFormat"], enCul.DateTimeFormat),
                ToDateGr    = x.ToDate.ToString(ConfigurationManager.AppSettings["DateFormat"], enCul.DateTimeFormat),
                CreatedBy   = VW.GetCreatedByDisplayed(x.CreatedBy),
                CreatedDate = Globals.Calendar.GetUmAlQuraDate(x.CreatedDate)
            });

            return(Json(new { data = data }, JsonRequestBehavior.AllowGet));
        }