本文整理汇总了C#中BaseService.GetFirstData方法的典型用法代码示例。如果您正苦于以下问题:C# BaseService.GetFirstData方法的具体用法?C# BaseService.GetFirstData怎么用?C# BaseService.GetFirstData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseService
的用法示例。
在下文中一共展示了BaseService.GetFirstData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetNewDateEndContract
public Hre_ContractEntity SetNewDateEndContract(Hre_ContractEntity contractEntity,string userLogin)
{
if (contractEntity != null)
{
var service = new BaseService();
var status = string.Empty;
var objContractType = service.GetFirstData<Cat_ContractTypeEntity>(contractEntity.ContractTypeID, ConstantSql.hrm_cat_sp_get_ContractTypeById, userLogin, 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.DateEnd = (DateTime)result.Value;
}
else
{
contractEntity.ErrorMessage += contractEntity.ProfileName + ",";
contractEntity.ActionStatus = ConstantMessages.WrongFormulaInContractType.ToString();
}
}
}
}
}
return contractEntity;
}
示例2: SetNewCodeContract
public Hre_ContractEntity SetNewCodeContract(Hre_ContractEntity contractEntity, string strIdConstract, string userLogin)
{
if (contractEntity != null)
{
var service = new BaseService();
var status = string.Empty;
var objContractType1 = service.GetFirstData<Cat_ContractTypeEntity>(contractEntity.ContractTypeID, ConstantSql.hrm_cat_sp_get_ContractTypeById, userLogin, ref status);
var objProfile1 = service.GetFirstData<Hre_ProfileEntity>(contractEntity.ProfileID, ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status);
if (objContractType1 != null)
{
var contractType = (Cat_ContractTypeEntity)objContractType1;
var profileEntity = (Hre_ProfileEntity)objProfile1;
if (!string.IsNullOrEmpty(contractType.Type))
{
var objSysConfig = service.GetFirstData<Sys_AllSettingEntity>(AppConfig.HRM_HRE_GENERATE_CODE_CONTRACT.ToString(), ConstantSql.hrm_sys_sp_get_AllSettingByKey, userLogin, 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 = service.GetData<Cat_ContractTypeEntity>(Common.DotNetToOracle(strIdConstract), ConstantSql.hrm_cat_sp_get_ContractTypeByIds, userLogin, 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.Select(d => d == listContractTypeById.ID.ToString()).Count();
newCode = strNewCode + "-" + (count + 1);
}
}
else
{
newCode = strNewCode + "-" + 1;
}
}
else
{
newCode = strNewCode + "-" + 1;
}
}
contractEntity.ContractNo = newCode;
}
}
}
}
}
}
contractEntity.ActionStatus = status;
}
return contractEntity;
}