public void NUnit_Domain_GetCatProvinces()
 {
     string status = string.Empty;
     Cat_ProvinceServices service = new Cat_ProvinceServices();
     int count = service.GetAllUseEntity<Cat_ProvinceEntity>(ref status).Count();
     //NUnit.Framework.Assert.AreNotEqual(0, count);
     Console.Write("Total Record: " + count);
 }
 public void NUnit_Domain_GetByIdCatProvinces()
 {
     Cat_ProvinceServices service = new Cat_ProvinceServices();
     var Province = new Cat_Province { Id = 22 };
     string status = string.Empty;
     var result = service.GetById<Cat_Province>(Province.Id, ref status);
     NUnit.Framework.Assert.IsNotNull(result);
     Console.Write("SearchResult: " + result.Id + " | " + result.ProvinceName + " | " + result.ProvinceCode + " | " + result.Notes);
 }
 public void NUnit_Domain_UpdateCatProvince()
 {
     Cat_ProvinceServices service = new Cat_ProvinceServices();
     var Province = new Cat_Province
     {
         Id = 12,
         ProvinceName = "ABCDomain12",
         ProvinceCode = "BC-12",
         Notes = "NUnit Test12"
     };
   //  NUnit.Framework.Assert.IsTrue(result);
     if (service.Edit<Cat_Province>(Province) == ActionStatus.EditSucceed.ToString())
     {
         Console.WriteLine("==>>> Result After Update:  " + Province.Id + " | " + Province.ProvinceName + " | " + Province.ProvinceCode + " | " + Province.Notes);
     }
 }
        public void NUnit_Domain_DeleteCatProvince()
        {
            Cat_ProvinceServices service = new Cat_ProvinceServices();
            int rs = 0;
            for (int i = 1; i <= 1000000; i++)
            {
                var Province = new Cat_Province { Id = i };
                if (service.Delete<Cat_Province>(Province.Id) == ActionStatus.DeleteSucceed.ToString())
                {
                    rs += 1;
                    Console.WriteLine("Process Success >>> Delete >>> " + i);
                }
            }
            Console.WriteLine("Total success record: " + rs);

            //NUnit.Framework.Assert.IsTrue(result);
        }
 public void NUnit_Domain_AddCatProvince()
 {
     Cat_ProvinceServices service = new Cat_ProvinceServices();
     bool result =true;
     int rs=0;
     for (int i = 0; i < 1000000; i++)
     {
         var Province = new Cat_Province
         {
             ProvinceName = "NUnit Domain ProvinceName " + i,
             ProvinceCode = "NUnit-ProvinceCode-" + i,
             Notes = "NUnit-Notes-"+i
         };
         if (service.Add<Cat_Province>(Province) == ActionStatus.AddSucceed.ToString())
         {
             rs += 1;
             Console.WriteLine("Process Success >>> Create >>> " + Province.Id + " | " + Province.ProvinceName + " | " + Province.ProvinceCode + " | " + Province.Notes);
         }
     }
     Console.WriteLine("Total success record: " + rs);
 }
示例#6
0
        public DataTable GetReportNotHaveSocial(DateTime? dateFrom, DateTime? dateTo, string OrgStructureID,string userLogin) 
        {
            using (var context = new VnrHrmDataContext())
            {
                string status = string.Empty;

                //string type_COLLECT_SOCIAL_INSURANCE = AppConfig.E_COLLECT_SOCIAL_INSURANCE.ToString();
                //bool _e_PROBATION_NoPay_INSURANCE = false;


                var profileServices = new Hre_ProfileServices();
                DataTable table = GetReportNotHaveSocialSchema();
                var lstObjProfile = new List<object>();
                lstObjProfile.Add(OrgStructureID);
                lstObjProfile.Add(null);
                lstObjProfile.Add(null);
                var lstProfile = profileServices.GetData<Hre_ProfileEntity>(lstObjProfile, ConstantSql.hrm_hr_sp_get_ProfileIdsByOrg, userLogin, ref status).ToList();

                var gradePayrollService = new Cat_GradePayrollServices();
                var lstObjGradePayroll = new List<object>();
                lstObjGradePayroll.Add(null);
                lstObjGradePayroll.Add(null);
                lstObjGradePayroll.Add(1);
                lstObjGradePayroll.Add(int.MaxValue -1);

                var contractServices = new Hre_ContractServices();
                var lstObjContract = new List<object>();
                lstObjContract.AddRange(new object[15]);
                lstObjContract[13] = 1;
                lstObjContract[14] = int.MaxValue -1;


                var provinceServices = new Cat_ProvinceServices();
                var lstObjProvince = new List<object>();
                lstObjProvince.Add(null);
                lstObjProvince.Add(null);
                lstObjProvince.Add(null);
                lstObjProvince.Add(null);
                lstObjProvince.Add(null);
                lstObjProvince.Add(null);
                var lstProvince = provinceServices.GetData<Cat_ProvinceEntity>(lstObjProvince, ConstantSql.hrm_cat_sp_get_Province, userLogin, ref status).ToList();

                foreach (var item in lstProfile)
                {
                    DataRow dr = table.NewRow();
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.ID] = item.ID;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.CodeEmp] = item.CodeEmp == null ? string.Empty : item.CodeEmp;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.ProfileName] = item.ProfileName == null ? string.Empty : item.ProfileName;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.E_DEPARTMENT] = item.OrgStructureName == null ? string.Empty : item.E_DEPARTMENT;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.E_DIVISION] = item.OrgStructureName == null ? string.Empty : item.E_DIVISION;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.E_SECTION] = item.OrgStructureName == null ? string.Empty : item.E_SECTION;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.E_TEAM] = item.OrgStructureName == null ? string.Empty : item.E_TEAM;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.E_UNIT] = item.OrgStructureName == null ? string.Empty : item.E_UNIT;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.PositionName] = item.PositionName == null ? string.Empty : item.PositionName;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.JobTitleName] = item.JobTitleName == null ? string.Empty : item.JobTitleName;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.EthnicGroupName] = item.EthnicGroupName == null ? string.Empty : item.EthnicGroupName;
                    
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.HealthTreatmentPlace] = item.HealthTreatmentPlace == null ? string.Empty : item.HealthTreatmentPlace;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.HealthTreatmentPlaceCode] = item.HealthTreatmentPlaceCode == null ? string.Empty : item.HealthTreatmentPlaceCode;

                    
                    var province = lstProvince.Where(s => s.ID == item.PlaceOfIssueID).FirstOrDefault();
                    if(province != null)
                    {
                        dr[Ins_ReportNotHaveSocialEntity.FieldNames.IDPOI_Code] = province.Code == null ? string.Empty : province.Code;
                        dr[Ins_ReportNotHaveSocialEntity.FieldNames.IDPOI] = province.ProvinceName == null ? string.Empty : province.ProvinceName;
                    }
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.Origin] = item.Origin == null ? string.Empty : item.Origin;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.PAddress] = item.PAddress == null ? string.Empty : item.PAddress;
                    dr[Ins_ReportNotHaveSocialEntity.FieldNames.TAddress] = item.TAddress == null ? string.Empty : item.TAddress;
                    
                    if (item.DateHire != null)
                    {
                        dr[Ins_ReportNotHaveSocialEntity.FieldNames.DateHire] = item.DateHire.Value;
                    }
                    if (item.DateQuit != null)
                    {
                        dr[Ins_ReportNotHaveSocialEntity.FieldNames.DateHire] = item.DateQuit.Value;
                    }
                    if (item.DateOfBirth != null)
                    {
                        dr[Ins_ReportNotHaveSocialEntity.FieldNames.DateOfBirth] = item.DateOfBirth.Value;
                    }

                    var provinceTreatment = lstProvince.Where(s => s.ID == item.ProvinceInsuranceID).FirstOrDefault();
                    if (provinceTreatment != null)
                    {
                        dr[Ins_ReportNotHaveSocialEntity.FieldNames.PlaceOfTreatmentProvince] = provinceTreatment.Code == null ? string.Empty : provinceTreatment.Code;
                    }
                    table.Rows.Add(dr);

                }
                return table;
            }
            
        }
示例#7
0
 /// <summary>
 /// get levelinterview and jobvancyID from Rec_interview by CandidateID
 /// </summary>
 /// <param name="ID"></param>
 /// <returns></returns>
 public JsonResult GetCandidateID(Guid ID)
 {
     var result = new List<Rec_InterviewModel>();
     string status = string.Empty;
     if (ID != Guid.Empty)
     {
         var service = new Cat_ProvinceServices();
         result = service.GetData<Rec_InterviewModel>(ID, ConstantSql.hrm_rec_sp_get_CandidateId, UserLogin, ref status);
     }
     return Json(result, JsonRequestBehavior.AllowGet);
 }
示例#8
0
 public JsonResult GetReqDocumentCascading(Guid ReqDocumentID, string ReqDocumentFilter)
 {
     var result = new List<Cat_ReqDocumentModel>();
     if (ReqDocumentID != Guid.Empty)
     {
         string status = string.Empty;
         var baseService = new BaseService();
         var service = new Cat_ProvinceServices();
         List<object> listModel = new List<object>();
         listModel.AddRange(new object[4]);
         listModel[2] = 1;
         listModel[3] = int.MaxValue - 1;
         var listReqDocument = baseService.GetData<Cat_ReqDocumentModel>(listModel, ConstantSql.hrm_cat_sp_get_ReqDocument, UserLogin, ref status).ToList();
         result = listReqDocument.Where(s => s.ResignReasonID == ReqDocumentID).ToList();
         if (!string.IsNullOrEmpty(ReqDocumentFilter))
         {
             var rs = result.Where(s => s.ReqDocumentName != null && s.ReqDocumentName.ToLower().Contains(ReqDocumentFilter.ToLower())).ToList();
             rs = rs.OrderBy(s => s.ReqDocumentName).ToList();
             return Json(rs, JsonRequestBehavior.AllowGet);
         }
     }
     return Json(result, JsonRequestBehavior.AllowGet);
 }
示例#9
0
        public JsonResult GetJobTypeCascading(Guid RoleID, string jobtitleFilter)
        {
            var result = new List<Cat_JobTypeModel>();
            string status = string.Empty;
            if (RoleID != Guid.Empty)
            {
                var service = new Cat_ProvinceServices();
                result = service.GetData<Cat_JobTypeModel>(RoleID, ConstantSql.hrm_cat_sp_get_JobTypeByRoleId, UserLogin, ref status);
                if (!string.IsNullOrEmpty(jobtitleFilter))
                {
                    var rs = result.Where(s => s.JobTypeName != null && s.JobTypeName.ToLower().Contains(jobtitleFilter.ToLower())).ToList();

                    return Json(rs, JsonRequestBehavior.AllowGet);
                }
            }
            return Json(result, JsonRequestBehavior.AllowGet);
        }
示例#10
0
        public JsonResult GetVillageCascading(Guid districtid, string villageFilter)
        {
            var result = new List<Cat_VillageModel>();
            string status = string.Empty;
            if (districtid != Guid.Empty)
            {
                var service = new Cat_ProvinceServices();
                result = service.GetData<Cat_VillageModel>(districtid, ConstantSql.hrm_cat_sp_get_VillageByDistrictId, UserLogin, ref status);
                result = result.OrderBy(s => s.VillageName).ToList();
                if (!string.IsNullOrEmpty(villageFilter))
                {
                    var rs = result.Where(s => s.VillageName != null && s.VillageName.ToLower().Contains(villageFilter.ToLower())).OrderBy(s => s.VillageName).ToList();

                    return Json(rs, JsonRequestBehavior.AllowGet);
                }
            }
            return Json(result, JsonRequestBehavior.AllowGet);
        }
示例#11
0
        public JsonResult GetProvinceCascading(Guid country, string provinceFilter)
        {
            var result = new List<CatProvinceModel>();
            string status = string.Empty;
            if (country != Guid.Empty)
            {
                var service = new Cat_ProvinceServices();
                result = service.GetData<CatProvinceModel>(country, ConstantSql.hrm_cat_sp_get_ProvinceByCountryId, UserLogin, ref status);
                result = result.OrderBy(s => s.ProvinceName).ToList();
                if (!string.IsNullOrEmpty(provinceFilter))
                {
                    var rs = result.Where(s => s.ProvinceName != null && s.ProvinceName.ToLower().Contains(provinceFilter.ToLower())).ToList();
                    rs = rs.OrderBy(s => s.ProvinceName).ToList();
                    return Json(rs, JsonRequestBehavior.AllowGet);
                }


            }
            return Json(result, JsonRequestBehavior.AllowGet);
        }