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


C# BaseService.Edit方法代码示例

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


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

示例1: 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

示例2: 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

示例3: ApplyPerformance


//.........这里部分代码省略.........
                    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;
                            basicSalary.DateOfEffect = dateEffect.Value;
                            basicSalary.CurrencyID = lstCurrency.ID;
                            basicSalary.Status = EnumDropDown.Sal_BasicSalaryStatus.E_WATTING_APPROVED.ToString();
                            basicSalary.AmountTotal = salaryRank != null ? salaryRank.SalaryStandard : null;
                            basicSalary.ClassRateID = salaryRank.SalaryClassID;
                            basicSalary.RankRateID = salaryRank.ID;
                            basicSalaryServices.Add(basicSalary);

                            if(insuransalarybyprofile != null)
                            {
                                Sal_InsuranceSalaryEntity insuranceSalary = new Sal_InsuranceSalaryEntity();
                                insuranceSalary.ProfileID = profile.ID;
                                insuranceSalary.InsuranceAmount = salaryRank != null ? salaryRank.SalaryStandard : null;
                                insuranceSalary.DateEffect = dateEffect;
                                insuranceSalary.CurrencyID = lstCurrency.ID;
                                insuranceSalary.IsSocialIns = insuransalarybyprofile.IsSocialIns;
                                insuranceSalary.IsMedicalIns = insuransalarybyprofile.IsMedicalIns;
                                insuranceSalary.IsUnimploymentIns = insuransalarybyprofile.IsUnimploymentIns;
                                InsuranceSalaryServices.Add(insuranceSalary);
                            }
                          
                        }
                        else
                        {
                            profile.SalaryClassID = salaryRank == null ? Guid.Empty : salaryRank.SalaryClassID;
                            profile.AbilityTileID = _AbilitiTitleID;
                            profile.DateOfEffect = dateEffect;
                            service.Edit(profile);

                            var workHistoryEntity = service.GetData<Hre_WorkHistoryEntity>(Common.DotNetToOracle(profileID.ToString()), ConstantSql.hrm_hr_sp_get_WorkHistoryByProfileId, userLogin, ref status)
                                .OrderByDescending(s => s.DateEffective).FirstOrDefault();


                            if (workHistoryEntity == null || workHistoryEntity.DateEffective != dateEffect)
                            {
                                var workHistory = new Hre_WorkHistoryEntity();
                                workHistory.ProfileID = profile.ID;
                                workHistory.SalaryClassID = salaryRank != null ? salaryRank.SalaryClassID : null;
                                workHistory.DateEffective = dateEffect != null ? dateEffect.Value : DateTime.Now;
                                workHistory.AbilityTileID = _AbilitiTitleID;
                                service.Add(workHistory);
                            }
                            else
                            {
                                workHistoryEntity.SalaryClassID = salaryRank != null ? salaryRank.SalaryClassID : null;
                                workHistoryEntity.DateEffective = dateEffect != null ? dateEffect.Value : DateTime.Now;
                                workHistoryEntity.AbilityTileID = _AbilitiTitleID;
                                service.Edit(workHistoryEntity);
                            }

                            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;
                            basicSalary.AmountTotal = salaryRank != null ? salaryRank.SalaryStandard : null;
                            basicSalary.DateOfEffect = dateEffect.Value;
                            basicSalary.CurrencyID = lstCurrency.ID;
                            basicSalary.Status = EnumDropDown.Sal_BasicSalaryStatus.E_WATTING_APPROVED.ToString();
                            basicSalaryServices.Add(basicSalary);

                            if (insuransalarybyprofile != null)
                            {
                                Sal_InsuranceSalaryEntity insuranceSalary = new Sal_InsuranceSalaryEntity();
                                insuranceSalary.ProfileID = profile.ID;
                                insuranceSalary.InsuranceAmount = salaryRank != null ? salaryRank.SalaryStandard : null;
                                insuranceSalary.DateEffect = dateEffect;
                                insuranceSalary.CurrencyID = lstCurrency.ID;
                                insuranceSalary.IsSocialIns = insuransalarybyprofile.IsSocialIns;
                                insuranceSalary.IsMedicalIns = insuransalarybyprofile.IsMedicalIns;
                                insuranceSalary.IsUnimploymentIns = insuransalarybyprofile.IsUnimploymentIns;
                                InsuranceSalaryServices.Add(insuranceSalary);
                            }
                        }
                }
                return result;
            }
        }
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Eva_PerformanceServices.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: SaveContractAndNextSalaryApprovedEvaluation


//.........这里部分代码省略.........
                                    ProfileName = contract.ProfileName,
                                    DateStart = contract.DateEnd.Value.AddDays(1),
                                    DateSigned = contract.DateEnd.Value.AddDays(1),
                                    JobTitleID = contract.JobTitleID,
                                    PositionID = contract.PositionID,
                                    Salary = lstSalaryRankNew == null ? 0 : lstSalaryRankNew.SalaryStandard,
                                    RankRateID = lstSalaryRankNew == null ? contract.RankRateID : lstSalaryRankNew.ID,
                                    ClassRateID = lstSalaryRankNew == null ? Guid.Empty : lstSalaryRankNew.SalaryClassID,
                                    ClassRateName = lstSalaryRankNew == null ? string.Empty : lstSalaryRankNew.SalaryClassName,
                                    SalaryRankName = lstSalaryRankNew == null ? string.Empty : lstSalaryRankNew.SalaryRankName,
                                    ContractTypeID = contractTypeEntity.ID
                                };

                                if (contract.DateEndNextContract != null)
                                {
                                    contractEntity.DateEnd = contract.DateEndNextContract.Value;
                                }

                                contractEntity.DateExtend = contract.DateEnd;
                                contractEntity.StatusEvaluation = "E_APPROVED";

                                if (!string.IsNullOrEmpty(contractEntity.ErrorMessage))
                                {
                                    return string.Empty;
                                }

                                message = contractServices.Add(contractEntity);
                                dateEffect = contractEntity.DateStart;
                            }
                        }

                        //Edit lai StatusEvaluation 
                        contract.StatusEvaluation = "E_APPROVED";
                        message = contractServices.Edit(contract);

                        #endregion

                        #region Xử Lý Sal_BasicSalary
                        var salaryEntity = new Sal_BasicSalaryEntity
                        {
                            ProfileID = contract.ProfileID,
                            ClassRateID = lstSalaryRankNew == null ? Guid.Empty : lstSalaryRankNew.SalaryClassID,
                            RankRateID = lstSalaryRankNew == null ? Guid.Empty : lstSalaryRankNew.ID,
                            GrossAmount = lstSalaryRankNew == null ? string.Empty : lstSalaryRankNew.SalaryStandard.ToString(),
                            DateOfEffect = dateEffect,
                            CurrencyID = lstCurrencyNew.ID,
                            Note = contract.Remark,
                            Status = "E_APPROVED"
                        };
                        message = baseServices.Add(salaryEntity);

                        #endregion

                        #region Xử Lý Hre_Profile
                        var profileEntity = profile.CopyData<Hre_ProfileEntity>();
                        Guid? _AbilityTileID = null;
                        profileEntity.SalaryClassID = lstSalaryRankNew == null ? Guid.Empty : lstSalaryRankNew.SalaryClassID;
                        if (profileEntity.SalaryClassID != null)
                        {
                            var abilityTitleBySalaryClass = baseServices.GetData<Cat_AbilityTileEntity>(Common.DotNetToOracle(profileEntity.SalaryClassID.ToString()), ConstantSql.hrm_cat_sp_get_AbilityTileBySalaryClassId, userLogin, ref status).FirstOrDefault();
                            if (abilityTitleBySalaryClass != null)
                            {
                                _AbilityTileID = abilityTitleBySalaryClass.ID;
                                profileEntity.AbilityTileID = _AbilityTileID;
                            }
                        }
开发者ID:dtafe,项目名称:vnr,代码行数:67,代码来源:Hre_ProfileServices.cs


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