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


C# ActionService.GetFirstData方法代码示例

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


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

示例1: Get

        public Sys_AllSettingModel Get(string id)
        {
            string status = string.Empty;
            ActionService service = new ActionService(UserLogin);
            var model = service.GetFirstData<Sys_AllSettingModel>(id, ConstantSql.hrm_sys_sp_get_AllSettingByKey, ref status);
            if (model != null)
            {
                return (Sys_AllSettingModel)model;
            }

            return null;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:12,代码来源:MenuOptionController.cs

示例2: GetCardCodeByProfileId

 /// [Hieu.Van] - 2014/07/02 Lấy Mã Thẻ(CardCode) theo mã Nhân Viên(Hre_Profile)
 public JsonResult GetCardCodeByProfileId(Guid id)
 {
     var service = new ActionService(UserLogin);
     var status = string.Empty;
     var fieldData = service.GetFirstData<Hre_ProfileCodeEntity>(id, ConstantSql.hrm_hre_sp_get_Profile_CardCodeByProfileID, ref status);
     List<object> listObj = new List<object>();
     listObj.Add(status);
     listObj.Add(fieldData);
     return Json(listObj, JsonRequestBehavior.AllowGet);
 }
开发者ID:dtafe,项目名称:vnr,代码行数:11,代码来源:Hre_GetDataController.cs

示例3: SetNewDateEndNextContractByContractAndNextContractID

        public Hre_ContractEntity SetNewDateEndNextContractByContractAndNextContractID(Hre_ContractEntity contractEntity, Guid nextContractID)
        {
            if (contractEntity != null)
            {
                var actionService = new ActionService(UserLogin);
                var status = string.Empty;
                var objContractType = actionService.GetFirstData<Cat_ContractTypeEntity>(Common.DotNetToOracle(nextContractID.ToString()), ConstantSql.hrm_cat_sp_get_ContractTypeById, ref status);
                if (objContractType != null)
                {
                    var contractTypeEntity = (Cat_ContractTypeEntity)objContractType;
                    if (!string.IsNullOrEmpty(contractTypeEntity.Formula))
                    {
                        var formula = contractTypeEntity.Formula.Replace("\n", "").Replace("\t", "").Replace("\r", "");
                        ElementFormula elementContactType = new ElementFormula("ContractType", contractTypeEntity.Type, 0);
                        ElementFormula elementUnitType = new ElementFormula("UnitType", contractTypeEntity.UnitTime, 0);
                        ElementFormula elementValueTime = new ElementFormula("ValueTime", contractTypeEntity.ValueTime, 0);
                        ElementFormula elementDateStart = new ElementFormula("DateStart", contractEntity.DateStart, 0);

                        var result = FormulaHelper.ParseFormula(formula, new List<ElementFormula>() { elementContactType, elementUnitType, elementDateStart, elementValueTime });

                        if (result != null && string.IsNullOrEmpty(result.ErrorMessage))
                        {
                            if (result.Value.GetType().Name == "DateTime")
                            {
                                contractEntity.DateEndNextContract = (DateTime)result.Value;
                            }
                            else
                            {
                                contractEntity.ErrorMessage = contractEntity.ProfileName;

                            }

                        }
                    }
                }

            }
            return contractEntity;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:39,代码来源:Hre_GetDataController.cs

示例4: SetNewCodeContract

        public Hre_ContractEntity SetNewCodeContract(Hre_ContractEntity contractEntity, string strIdConstract)
        {
            if (contractEntity != null)
            {
                var actionService = new ActionService(UserLogin);
                var status = string.Empty;
                var objContractType1 = actionService.GetFirstData<Cat_ContractTypeEntity>(Common.DotNetToOracle(contractEntity.ContractTypeID.ToString()), ConstantSql.hrm_cat_sp_get_ContractTypeById, ref status);
                var objProfile1 = actionService.GetFirstData<Hre_ProfileEntity>(Common.DotNetToOracle(contractEntity.ProfileID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, ref status);
                if (objContractType1 != null)
                {
                    var contractType = (Cat_ContractTypeEntity)objContractType1;
                    var profileEntity = (Hre_ProfileEntity)objProfile1;
                    if (!string.IsNullOrEmpty(contractType.Type))
                    {
                        var objSysConfig = actionService.GetFirstData<Sys_AllSettingEntity>(AppConfig.HRM_HRE_GENERATE_CODE_CONTRACT.ToString(), ConstantSql.hrm_sys_sp_get_AllSettingByKey, ref status);
                        if (objSysConfig != null)
                        {
                            var sysConfig = (Sys_AllSettingEntity)objSysConfig;
                            if (sysConfig != null && !string.IsNullOrEmpty(sysConfig.Value1))
                            {
                                ElementFormula elementContactType = new ElementFormula("ContactType", contractType.Type, 0);
                                ElementFormula elementCodeEmp = new ElementFormula("CodeEmp", profileEntity.CodeEmp, 0);
                                ElementFormula elementOrdinal = new ElementFormula("Ordinal", 1, 0);

                                var result = FormulaHelper.ParseFormula(sysConfig.Value1, new List<ElementFormula>() { elementContactType, elementCodeEmp });
                                if (result != null && string.IsNullOrEmpty(result.ErrorMessage))
                                {
                                    var value = result.Value;
                                    if (value != null)
                                    {
                                        string newCode = value.ToString();
                                        if (newCode.EndsWith("Ordinal"))
                                        {
                                            var strNewCode = newCode.Substring(0, newCode.Length - 7);
                                            if (!string.IsNullOrEmpty(strIdConstract))
                                            {
                                                var listContractType = actionService.GetData<Cat_ContractTypeEntity>(Common.DotNetToOracle(strIdConstract), ConstantSql.hrm_cat_sp_get_ContractTypeByIds, ref status);
                                                if (listContractType != null)
                                                {
                                                    var listContractTypeById = listContractType.Where(d => d.Type == contractType.Type).FirstOrDefault();
                                                    if (listContractTypeById != null)
                                                    {
                                                        var listId = strIdConstract.Split(',').ToList();
                                                        var count = listId.Where(s => listContractTypeById.ID.ToString() == s).Select(d => d == listContractTypeById.ToString()).Count();
                                                        //var count = listContractTypeById.Count();
                                                        newCode = strNewCode + "-" + (count + 1);
                                                    }
                                                    else
                                                    {
                                                        //var listId = strIdConstract.Split(',').ToList();
                                                        //var count = listId.Select(d => d == listContractTypeById.ID.ToString()).Count();
                                                        newCode = strNewCode + "-" + "1";
                                                    }
                                                }
                                                else
                                                {
                                                    newCode = strNewCode + "-" + 1;
                                                }
                                            }
                                            else
                                            {
                                                newCode = strNewCode + "-" + 1;
                                            }

                                        }
                                        contractEntity.ContractNo = newCode;
                                    }
                                }
                            }
                        }
                    }
                }
                contractEntity.ActionStatus = status;
            }
            return contractEntity;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:76,代码来源:Hre_GetDataController.cs


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