当前位置: 首页>>代码示例>>C#>>正文


C# BaseService.Add方法代码示例

本文整理汇总了C#中BaseService.Add方法的典型用法代码示例。如果您正苦于以下问题:C# BaseService.Add方法的具体用法?C# BaseService.Add怎么用?C# BaseService.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseService的用法示例。


在下文中一共展示了BaseService.Add方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Post

        public GridBuilderModel Post(GridBuilderModel model)
        {
            if (model != null)
            {
                ActionService service = new ActionService(UserLogin);
                List<object> lstObj = new List<object>() { model.UserID, model.GridControlName };
                var status = string.Empty;
                var entity = service.GetDataByListParameter<Sys_ColumnModeEntity>(lstObj, ConstantSql.hrm_sys_sp_get_ColumnMode, ref status);
                model.ActionStatus = status;
                if (entity != null && model.IsGet)
                {
                    model = entity.CopyData<GridBuilderModel>();
                    model.StringXml = entity.ColumnMode;
                    return model;
                }

                if (!string.IsNullOrEmpty(model.StringXml))
                {
                    XmlDocument doc = JsonConvert.DeserializeXmlNode(model.StringXml);
                    var baseService = new BaseService();
                    Sys_ColumnModeEntity newEntity = new Sys_ColumnModeEntity()
                    {
                        UserInfoID = model.UserID,
                        GridControlName = model.GridControlName,
                        ColumnMode = doc.InnerXml + "|" + model.PageSize
                    };
                    if (entity != null)
                    {
                        newEntity.ID = entity.ID;
                        baseService.Edit<Sys_ColumnModeEntity>(newEntity);
                    }
                    else
                    {
                        baseService.Add<Sys_ColumnModeEntity>(newEntity);
                    }

                    return model;
                }
            }
            return model;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:41,代码来源:Sys_ColumnModeController.cs

示例2: GetComputeBackPayList

        public ActionResult GetComputeBackPayList([DataSourceRequest] DataSourceRequest request, Can_ComputeBackPaySearchModel model)
        {
            string status = string.Empty;
            string note = "Tổng Hợp Trả Lại Tiền Ăn ";

            var baseService = new BaseService();
            var dataComputes = GetListData<Can_ComputeBackPayModel, Can_ComputeBackPayModel, Can_ComputeBackPaySearchModel>(request, model, ConstantSql.hrm_can_sp_get_ComputeBackPay, ref status);
            var computeBackPayModels = new List<Can_ComputeBackPayModel>();
            if (dataComputes.Any() && model != null && model.MonthYear.HasValue)
            {
                var month = model.MonthYear.Value.Month;
                var year = model.MonthYear.Value.Year;

                var backPays = baseService.GetAllUseEntity<Can_BackPayEntity>(ref status).Where(p => p.MonthYear.HasValue && p.MonthYear.Value.Year == year && p.MonthYear.Value.Month == month).ToList();

                foreach (var canComputeBackPayModel in dataComputes)
                {
                    var backPay = backPays.Where(p => p.ProfileID == canComputeBackPayModel.ProfileID && p.MealAllowanceTypeSettingID == canComputeBackPayModel.MealAllowanceTypeSettingID).FirstOrDefault();

                    #region Thêm mới vào Can_BackPay
                    if (backPay == null)
                    {
                        var backPayEntity = new Can_BackPayEntity
                        {
                            ProfileID = canComputeBackPayModel.ProfileID,
                            MonthYear = model.MonthYear,
                            MealAllowanceTypeSettingID = canComputeBackPayModel.MealAllowanceTypeSettingID
                        };

                        if (canComputeBackPayModel.IsFullPay.HasValue && canComputeBackPayModel.IsFullPay.Value)
                        {
                            //neu isFullPay => cap nhat count , amount
                            backPayEntity.Count = (int?)canComputeBackPayModel.Total;
                            backPayEntity.Amount = (canComputeBackPayModel.Amount * canComputeBackPayModel.Total);
                        }
                        else
                        {
                            //neu ko la isFullPay => cap nhat CountByFomular,AmountByFomular
                            backPayEntity.CountByFomular = (int?)ComputeAmountBackPay(canComputeBackPayModel.Total);
                            backPayEntity.AmountByFomular = canComputeBackPayModel.Amount * ComputeAmountBackPay(canComputeBackPayModel.Total);
                        }
                        //add
                        backPayEntity.Note = note + canComputeBackPayModel.MonthYear;
                        baseService.Add<Can_BackPayEntity>(backPayEntity);
                        backPays.Add(backPayEntity);
                    }
                    #endregion

                    #region Chỉnh sửa Can_BackPay
                    else
                    {
                        //edit
                        //neu isFullPay => cap nhat count , amount
                        //neu ko la isFullPay => cap nhat CountByFomular,AmountByFomular
                        if (canComputeBackPayModel.IsFullPay.HasValue && canComputeBackPayModel.IsFullPay.Value)
                        {
                            //neu isFullPay => cap nhat count , amount
                            backPay.Count = (int?)canComputeBackPayModel.Total;
                            backPay.Amount = canComputeBackPayModel.Amount * canComputeBackPayModel.Total;
                        }
                        else
                        {
                            //neu ko la isFullPay => cap nhat CountByFomular,AmountByFomular
                            backPay.CountByFomular = (int?)ComputeAmountBackPay(canComputeBackPayModel.Total);
                            backPay.AmountByFomular = canComputeBackPayModel.Amount * ComputeAmountBackPay(canComputeBackPayModel.Total);
                        }

                        if (!string.IsNullOrEmpty(backPay.Note))
                        {
                            canComputeBackPayModel.Note = backPay.Note;
                        }
                        backPay.Note = note + canComputeBackPayModel.MonthYear;
                        baseService.Edit<Can_BackPayEntity>(backPay);
                    }
                    #endregion
                }

                #region List hiển thị
                var profileIds = dataComputes.Select(p => p.ProfileID).ToList();

                var modelSearch = new Can_BackPaySearchModel();
                modelSearch.ProfileName = null;
                modelSearch.DateFrom = null;
                modelSearch.DateTo = null;

                var datas = GetListData<Can_BackPayModel, Can_BackPayEntity, Can_BackPaySearchModel>(request, modelSearch, ConstantSql.hrm_can_sp_get_BackPay, ref status);
                computeBackPayModels = datas.Where(p => p.MonthYear.HasValue && p.MonthYear.Value.Year == year && p.MonthYear.Value.Month == month)
                     .Select(p => new Can_ComputeBackPayModel
                     {
                         ProfileName = p.ProfileName,
                         MonthYear = p.MonthYear.HasValue ? p.MonthYear.Value.ToString("MM-yyyy") : string.Empty,
                         Note = p.Note,
                         Amount = p.Amount ?? 0,
                         MealAllowanceTypeSettingID = p.MealAllowanceTypeSettingID,
                         Type = p.MealAllowanceTypeName,
                         CountByFomular = ComputeAmountBackPay(p.CountByFomular ?? 0),
                         AmountByFomular = p.AmountByFomular,
                         Summary = ComputeAmountBackPay(p.CountByFomular ?? 0) + (p.Count ?? 0),
                         Total = p.Count ?? 0
                     })
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Canteen_GetDataController.cs

示例3: CreateTemplate

        public ActionResult CreateTemplate(string t1, bool t2, string t3, string t4, bool t5, bool t6)
        {
            var service = new BaseService();
            Cat_ExportEntity exportEntity = new Cat_ExportEntity()
            {
                ExportName = t1,
                IsColumnDynamic = t2,
                ScreenName = t4,
                TemplateFile = t3,
                IsReadOnly = t5,
                IsProtected = t6,
                IsSmartMarkers = true
            };

            service.Add(exportEntity);
            return Json("");
        }
开发者ID:dtafe,项目名称:vnr,代码行数:17,代码来源:Hre_GetDataController.cs

示例4: ImportRecruitmentHistory

        public void ImportRecruitmentHistory(string candidateIds, string UserLogin)
        {
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repo = new Rec_RecruitmentCampaignRepository(unitOfWork);
                var repoCandidate = new Rec_CandidateRepository(unitOfWork);
                var lstIds = candidateIds.Split(',');
                List<Guid> listID = new List<Guid>();
                for (int i = 0; i < lstIds.Length; i++)
                {
                    try
                    {
                        listID.Add(Guid.Parse(lstIds[i].ToString()));
                    }
                    catch
                    { }
                }
                BaseService baseService = new BaseService();
                string status = string.Empty;
                var listCandidates = repoCandidate.FindBy(x => listID.Contains(x.ID)).ToList();
                foreach (var candidateModel in listCandidates)
                {
                    List<object> lstObjhistory = new List<object>();
                    lstObjhistory.Add(candidateModel.IdentifyNumber);
                    lstObjhistory.Add(candidateModel.CandidateName);
                    lstObjhistory.Add(candidateModel.DateOfBirth);
                    lstObjhistory.Add(candidateModel.DateApply);
                    
                    var recruimentHistory = baseService.ActionData<Rec_RecruitmentHistoryEntity>(lstObjhistory, ConstantSql.hrm_rec_sp_checkduplidaterecruimentHistory, true, UserLogin, ref status).FirstOrDefault();
                    if (recruimentHistory != null)
                    {
                        recruimentHistory.CandidateName = candidateModel.CandidateName;
                        recruimentHistory.DateOfBirth = candidateModel.DateOfBirth;
                        recruimentHistory.Gender = candidateModel.Gender;
                        recruimentHistory.Phone = candidateModel.Phone;
                        recruimentHistory.Mobile = candidateModel.Mobile;
                        recruimentHistory.Email = candidateModel.Email;
                        recruimentHistory.YearOfExperience = candidateModel.YearOfExperience.Value != null ? candidateModel.YearOfExperience.Value : 0;
                        recruimentHistory.PositionID = candidateModel.PositionID;
                        recruimentHistory.JobVacancyID = candidateModel.JobVacancyID;
                        recruimentHistory.DateApply = candidateModel.DateApply;
                        recruimentHistory.ScorePotential = candidateModel.ScorePotential;
                        recruimentHistory.HealthStatus = candidateModel.HealthStatus;
                        recruimentHistory.IdentifyNumber = candidateModel.IdentifyNumber;
                        baseService.Edit(recruimentHistory);
                    }
                    else
                    {
                        Rec_RecruitmentHistoryEntity recruimentHistoryentity = new Rec_RecruitmentHistoryEntity();
                        recruimentHistoryentity.CandidateID = candidateModel.ID;
                        recruimentHistoryentity.CandidateName = candidateModel.CandidateName;
                        recruimentHistoryentity.DateOfBirth = candidateModel.DateOfBirth;
                        recruimentHistoryentity.Gender = candidateModel.Gender;
                        recruimentHistoryentity.Phone = candidateModel.Phone;
                        recruimentHistoryentity.Mobile = candidateModel.Mobile;
                        recruimentHistoryentity.Email = candidateModel.Email;
                        recruimentHistoryentity.YearOfExperience = candidateModel.YearOfExperience.Value != null ? candidateModel.YearOfExperience.Value : 0;
                        recruimentHistoryentity.PositionID = candidateModel.PositionID;
                        recruimentHistoryentity.JobVacancyID = candidateModel.JobVacancyID;
                        recruimentHistoryentity.DateApply = candidateModel.DateApply;
                        recruimentHistoryentity.ScorePotential = candidateModel.ScorePotential;
                        recruimentHistoryentity.HealthStatus = candidateModel.HealthStatus;
                        recruimentHistoryentity.PassFilterResume = candidateModel.PassFilterResume;
                        recruimentHistoryentity.Status = candidateModel.Status;
                        recruimentHistoryentity.IdentifyNumber = candidateModel.IdentifyNumber;
                        baseService.Add(recruimentHistoryentity);
                    } 
                }
                repo.SaveChanges();

            }
        }
开发者ID:dtafe,项目名称:vnr,代码行数:73,代码来源:Rec_RecruitmentHistoryServices.cs

示例5: AddCustomer

        public CommandResultViewModel AddCustomer(CustomerInfoVM customerVM)
        {
            CommandResultViewModel vm = new CommandResultViewModel();
            try
            {
                UserService serv = new UserService();
                bool isExists = serv.ExistsUser(customerVM.UserInfo.UserName);
                if (isExists)
                {
                    vm.CommandResult = EnumCommandResult.MisMatchCondition;
                    vm.Msg = string.Format("用户名" + customerVM.UserInfo.UserName + "已经存在,请重新输入!");
                    return vm;
                }
                EMTenantService tenantServ = new EMTenantService();
                var tempTenant = tenantServ.SelectByName(customerVM.Tenant.TenantName);
                if (tempTenant != null)
                {
                    vm.CommandResult = EnumCommandResult.MisMatchCondition;
                    vm.Msg = string.Format("客户名称" + customerVM.Tenant.TenantName + "已经存在,请重新输入!");
                    return vm;
                }

                IdentityNoService identityNoServ = new IdentityNoService();
                string tenantCode = identityNoServ.GetTenantSerialNo();
                EMTenant tenant = GetEMTenant(tenantCode,customerVM.Tenant);
                EMUserGroup userGroup = GetEMUserGroup(identityNoServ, tenantCode,customerVM.UserInfo);
                EMVehicleGroup vehicleGroup = GetEMVehicleGroup(identityNoServ, customerVM.UserInfo.UserName, tenantCode);
                EMUser user = GetEMUser(identityNoServ, customerVM.UserInfo, tenant, userGroup);
                IBaseService baseServ = new BaseService();
                tenant.RegisterUserCode = user.UserCode;
                tenant.RegisterUserName = user.UserName;
                baseServ.Add<EMTenant>(tenant);
                baseServ.Add<EMUserGroup>(userGroup);
                baseServ.Add<EMVehicleGroup>(vehicleGroup);
                baseServ.Add<EMUser>(user);

                vm.CommandResult = EnumCommandResult.Success;
                vm.Msg = "新增用户成功!";
                return vm;
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message, ex);
                vm.CommandResult = EnumCommandResult.Failed;
                vm.Msg = ex.Message;
                return vm;
            }
        }
开发者ID:hhahh2011,项目名称:CH.Gps,代码行数:48,代码来源:OperateManagerWCFService.cs

示例6: ApplyPerformance

        public string ApplyPerformance(Guid? profileID, Guid? rankdetailID, DateTime? dateEffect,string userLogin)
        {
            using (var context = new VnrHrmDataContext())
            {
                string result = ConstantMessages.Succeed;
                var profileservices = new Hre_ProfileServices();
                BaseService service = new BaseService();
                string message = string.Empty;
                string status = string.Empty;
                var contractservices = new Hre_ContractServices();
                var basicSalaryServices = new Sal_BasicSalaryServices();
                var InsuranceSalaryServices = new Sal_InsuranceSalaryServices();
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repoCandidate = new Rec_CandidateRepository(unitOfWork);
                var repoHistory = new Rec_RecruitmentHistoryRepository(unitOfWork);
                var profile = service.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(profileID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();
                var salaryRank = service.GetData<Cat_SalaryRankEntity>(Common.DotNetToOracle(rankdetailID.ToString()), ConstantSql.hrm_cat_sp_get_SalaryRankById, userLogin, ref status).FirstOrDefault();

                Guid? _AbilitiTitleID = null;
                if (salaryRank != null && salaryRank.SalaryClassID != null)
                {
                    var abilityTitleBySalaryClass = service.GetData<Cat_AbilityTileEntity>(Common.DotNetToOracle(salaryRank.SalaryClassID.ToString()), ConstantSql.hrm_cat_sp_get_AbilityTileBySalaryClassId, userLogin, ref status).FirstOrDefault();
                    if (abilityTitleBySalaryClass != null)
                    {
                        _AbilitiTitleID = abilityTitleBySalaryClass.ID;
                    }
                }

                // theo task 0049950 - không làm gì liên quan đến hđ hết.
                //var contractybyProfile = service.GetData<Hre_ContractEntity>(Common.DotNetToOracle(profileID.ToString()), ConstantSql.hrm_hr_sp_get_ContractsByProfileId, userLogin, ref status)
                //    .OrderByDescending(s => s.DateUpdate).FirstOrDefault();

                ////if (contractybyProfile == null)
                ////{
                ////    result = ConstantDisplay.HRM_Common_ProfileNotHaveContract.ToString();
                ////    return result;
                ////}
                ////if (contractybyProfile != null && contractybyProfile.ContractNextID == null)
                ////{
                ////    result = ConstantDisplay.HRM_Common_ProfileNotHaveNextContract.ToString();
                ////    return result;
                ////}
                //if (contractybyProfile != null && contractybyProfile.ContractNextID != null)
                //{
                    //var contractype = service.GetData<Cat_ContractTypeEntity>(Guid.Parse(Common.DotNetToOracle(contractybyProfile.ContractNextID.ToString())), ConstantSql.hrm_cat_sp_get_ContractTypeById, userLogin, ref status).FirstOrDefault();
                    //if (contractype == null)
                    //{
                    //    result = ConstantDisplay.HRM_Common_ProfileNotHaveNextContract.ToString();
                    //    return result;
                    //}
                    //Hre_ContractEntity contract = new Hre_ContractEntity();
                    //contract.ProfileID = profile.ID;
                    //contract.DateStart = dateEffect.Value;
                    //contract.DateSigned = dateEffect;
                    //contract.RankRateID = rankdetailID;
                    //contract.ClassRateID = salaryRank != null ? salaryRank.SalaryClassID : null;
                    //contract.Salary = salaryRank != null ? salaryRank.SalaryStandard : null;
                    //contract.ContractTypeID = contractype.ID;
                    //if (!string.IsNullOrEmpty(contractype.Formula))
                    //{
                    //    contract = SetNewDateEndContract(contract,userLogin);
                    //}

                    //if (contractybyProfile.DateEndNextContract != null)
                    //{
                    //    contractybyProfile.DateEnd = contractybyProfile.DateEndNextContract.Value;
                    //}
                    //contractservices.Add(contract);

                    // Thêm mới lương cơ bản + lương BHXH
                    string defaultcur = null;
                    string ConfigHre = AppConfig.HRM_HRE_CONFIG.ToString();
                    List<object> lstOb = new List<object>();
                    lstOb.Add(ConfigHre);
                    lstOb.Add(null);
                    lstOb.Add(null);
                    var config = GetData<Sys_AllSettingEntity>(lstOb, ConstantSql.hrm_sys_sp_get_AllSetting, userLogin, ref status);
                    string valueConfig = AppConfig.HRM_HRE_CONFIG_DEFAULTCURRENCY.ToString();
                    if (config != null)
                    {
                        defaultcur = config.Where(s => s.Name == valueConfig).Select(s => s.Value1).FirstOrDefault().ToString();
                        List<object> listObjCurrency = new List<object>();
                        listObjCurrency.Add(null);
                        listObjCurrency.Add(defaultcur);
                        listObjCurrency.Add(1);
                        listObjCurrency.Add(Int32.MaxValue - 1);
                        var lstCurrency = service.GetData<Cat_CurrencyEntity>(listObjCurrency, ConstantSql.hrm_cat_sp_get_Currency, userLogin, ref status).FirstOrDefault();

                        var basicsalarybyprofile = service.GetData<Sal_BasicSalaryEntity>(Common.DotNetToOracle(profileID.ToString()), ConstantSql.hrm_sal_sp_get_BasicSalaryByProfileIds, userLogin, ref status)
                            .OrderByDescending(s => s.DateOfEffect).FirstOrDefault();
                        var insuransalarybyprofile = service.GetData<Sal_InsuranceSalaryEntity>(Common.DotNetToOracle(profileID.ToString()), ConstantSql.hrm_sal_sp_get_InsuranceSalaryByProfileIds, userLogin, ref status)
                     .OrderByDescending(s => s.DateEffect).FirstOrDefault();

                        if (basicsalarybyprofile != null && salaryRank != null && basicsalarybyprofile.RankRateID != rankdetailID && salaryRank.SalaryClassID == basicsalarybyprofile.ClassRateID)
                        {
                            Sal_BasicSalaryEntity basicSalary = new Sal_BasicSalaryEntity();
                            basicSalary.ProfileID = profile.ID;
                            basicSalary.GrossAmount = (salaryRank != null && salaryRank.SalaryStandard != null) ? salaryRank.SalaryStandard.Value.ToString() : null;
                            basicSalary.Amount = basicSalary.GrossAmount != null ? basicSalary.GrossAmount.Encrypt() : "";
                            basicSalary.InsuranceAmount = (salaryRank != null && salaryRank.SalaryStandard != null) ? salaryRank.SalaryStandard.Value : 0;
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Eva_PerformanceServices.cs

示例7: SaveListLeave

 public string SaveListLeave(List<ImportLeavedayModel> listLeaveImport)
 {
     var ImportLeave = listLeaveImport.CopyData<Att_LeaveDayEntity>();
     BaseService _ba = new BaseService();
     var result = _ba.Add<Att_LeaveDayEntity>(ImportLeave);
     return result;
 }
开发者ID:dtafe,项目名称:vnr,代码行数:7,代码来源:Att_LeavedayServices.cs

示例8: SaveListRoster

        public string SaveListRoster(List<ImportRosterModel> listRosterImport)
        {
            var ImportRoster = listRosterImport.CopyData<Att_RosterEntity>();
            BaseService _ba = new BaseService();
            var result = _ba.Add<Att_RosterEntity>(ImportRoster);


            // DataErrorCode errCode= DataErrorCode.Error;
            //using (var context = new VnrHrmDataContext())
            //{
            //    var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
            //    var repo = new CustomBaseRepository<Att_Roster>(unitOfWork);
            //    repo.Add(ImportRoster);
            //    errCode  =  repo.SaveChanges();
            //    if(errCode== DataErrorCode.Success)
            //    {
            //        NotificationType.Success.ToString();
            //    }
            //    else
            //    {
            //        NotificationType.Error.ToString();
            //    }
            //}



            return result;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:28,代码来源:Att_RosterServices.cs

示例9: CreateInCellLateEarly

        public ActionResult CreateInCellLateEarly([Bind(Prefix = "models")] List<CatLateEarlyRuleModel> model, Guid id)
        {
            var service = new BaseService();
            string status = string.Empty;
            //var t = service.GetAllUserEntity<Cat_GradeMultiEntity>(ref status);
            var GradeCfg = GetData<CatLateEarlyRuleMultiModel, Cat_GradeMultiEntity>("", ConstantSql.hrm_cat_sp_get_Grade_multi);
            //var service = new RestServiceClient<CatLateEarlyRuleModel>();
            //service.SetCookies(this.Request.Cookies, _hrm_Cat_Service);

            if (model != null)
            {
                if (GradeCfg != null && GradeCfg.Count > 0 && id != Guid.Empty)
                {
                    foreach (var i in model)
                    {
                        i.GradeCfgID = GradeCfg.FirstOrDefault().ID;
                        i.GradeAttID = id;
                        //item = service.Add<Cat_LateEarlyRuleEntity, CatLateEarlyRuleModel>(i);
                        service.Add<Cat_LateEarlyRuleEntity>(i.CopyData<Cat_LateEarlyRuleEntity>());
                    }
                }

            }
            return Json("");

        }
开发者ID:dtafe,项目名称:vnr,代码行数:26,代码来源:Cat_GetDataController.cs

示例10: SaveContractAndNextSalaryApprovedEvaluation

        public string SaveContractAndNextSalaryApprovedEvaluation(Hre_ContractEntity contract, string userLogin)
        {

            using (var context = new VnrHrmDataContext())
            {
                var contractServices = new Hre_ContractServices();
                string message = string.Empty;
                var baseServices = new BaseService();
                string status = string.Empty;
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));

                if (contract.DateEndNextContract == null)
                {
                    return string.Empty;
                }

                #region Lấy WorkHistory
                var repoWorkhistory = new Hre_WorkHistoryRepository(unitOfWork);
                var lstWorkhistory = new List<Hre_WorkHistory>().Select(d => new
                {
                    d.ProfileID,
                    d.SalaryClassID
                }).ToList();

                lstWorkhistory.AddRange(repoWorkhistory.FindBy(s => s.IsDelete == null).Select(d => new
                        {
                            d.ProfileID,
                            d.SalaryClassID
                        }).ToList());
                #endregion

                // Lấy biến Dateend này gắn cho quá trình công tác khi cập nhật quá trinh công tác ở dưới
                DateTime? dateEnd = contract.DateEnd;

                var profile = baseServices.GetData<Hre_ProfileEntity>(contract.ProfileID, ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();

                var lstObjSalaryRank = new List<object>();
                lstObjSalaryRank.Add(null);
                lstObjSalaryRank.Add(null);
                lstObjSalaryRank.Add(1);
                lstObjSalaryRank.Add(int.MaxValue - 1);
                var lstSalaryRank = baseServices.GetData<Cat_SalaryRankEntity>(lstObjSalaryRank, ConstantSql.hrm_cat_sp_get_SalaryRank, userLogin, ref status).ToList();

                #region Lấy Att_Grade
                var att_GradeRepository = new Att_GradeRepository(unitOfWork);
                var lstAttGrade = new List<Att_Grade>().Select(d => new
                {
                    d.ProfileID,
                    d.MonthEnd
                }).ToList();

                lstAttGrade.AddRange(att_GradeRepository.FindBy(s => s.IsDelete == null).Select(d => new
                {
                    d.ProfileID,
                    d.MonthEnd
                }).ToList());
                #endregion

                #region Lấy Sal_Grade
                var salGradeRepository = new Sal_GradeRepository(unitOfWork);
                var lstSalGrade = new List<Sal_Grade>().Select(d => new
                {
                    d.ProfileID,
                    d.MonthEnd
                }).ToList();

                lstSalGrade.AddRange(salGradeRepository.FindBy(s => s.IsDelete == null).Select(d => new
                {
                    d.ProfileID,
                    d.MonthEnd
                }).ToList());

                #endregion

                var lstObjGradePayroll = new List<object>();
                lstObjGradePayroll.Add(null);
                lstObjGradePayroll.Add(null);
                lstObjGradePayroll.Add(1);
                lstObjGradePayroll.Add(int.MaxValue - 1);
                var lstGradePayroll = baseServices.GetData<Cat_GradePayrollEntity>(lstObjGradePayroll, ConstantSql.hrm_cat_sp_get_GradePayroll, userLogin, ref status).ToList();

                var lstObjGradeAtt = new List<object>();
                lstObjGradeAtt.AddRange(new object[10]);
                lstObjGradeAtt[8] = 1;
                lstObjGradeAtt[9] = int.MaxValue - 1;
                var lstGradeAtt = baseServices.GetData<Cat_GradeAttendanceEntity>(lstObjGradeAtt, ConstantSql.hrm_cat_sp_get_Cat_GradeAttendance, userLogin, ref status).ToList();

                var lstObjCurrency = new List<object>();
                lstObjCurrency.Add(null);
                lstObjCurrency.Add(null);
                lstObjCurrency.Add(1);
                lstObjCurrency.Add(int.MaxValue - 1);
                var lstCurrency = baseServices.GetData<Cat_CurrencyEntity>(lstObjCurrency, ConstantSql.hrm_cat_sp_get_Currency, userLogin, ref status).ToList();
                var lstCurrencyNew = lstCurrency.Where(s => s.CurrencyName == "VND").FirstOrDefault();

                var lstObjContractType = new List<object>();
                lstObjContractType.Add(null);
                lstObjContractType.Add(null);
                lstObjContractType.Add(null);
                lstObjContractType.Add(null);
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Hre_ProfileServices.cs

示例11: UserReg

        public CommandResultViewModel UserReg(string userName, string pwd, string email, string QQ, string companyName)
        {
            CommandResultViewModel vm = new CommandResultViewModel();
            try
            {
                IUserService serv = new UserService();
                bool isExists = serv.ExistsUser(userName);
                if (isExists)
                {
                    vm.CommandResult = EnumCommandResult.MisMatchCondition;
                    vm.Msg = string.Format("用户名" + userName + "已经存在,请重新输入!");
                    return vm;
                }

                IEMTenantService tenantServ = new EMTenantService();
                var tempTenant = tenantServ.SelectByName(companyName);
                if (tempTenant != null)
                {
                    vm.CommandResult = EnumCommandResult.MisMatchCondition;
                    vm.Msg = string.Format("姓名/公司名" + companyName + "已经存在,请重新输入!");
                    return vm;
                }
                
                IdentityNoService identityNoServ = new IdentityNoService();
                string tenantCode = identityNoServ.GetTenantSerialNo();
                EMTenant tenant = GetTenant(tenantCode,email,QQ,companyName,userName);
                EMUserGroup userGroup = GetEMUserGroup(identityNoServ, tenantCode);
                EMVehicleGroup vehicleGroup = GetEMVehicleGroup(identityNoServ,userName, tenantCode);
                EMUser user = GetEMUser(identityNoServ,userName, pwd, email,QQ, tenant, userGroup);
                IBaseService baseServ = new BaseService();
                tenant.RegisterUserCode = user.UserCode;
                baseServ.Add<EMTenant>(tenant);
                baseServ.Add<EMUserGroup>(userGroup);
                baseServ.Add<EMVehicleGroup>(vehicleGroup);
                baseServ.Add<EMUser>(user);

                vm.CommandResult = EnumCommandResult.Success;
                return vm;
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message, ex);
                vm.CommandResult = EnumCommandResult.Failed;
                vm.Msg = ex.Message;
                return vm;
            }
        }
开发者ID:hhahh2011,项目名称:CH.Gps,代码行数:47,代码来源:UserWCFService.cs


注:本文中的BaseService.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。