本文整理汇总了C#中ActionService.GetById方法的典型用法代码示例。如果您正苦于以下问题:C# ActionService.GetById方法的具体用法?C# ActionService.GetById怎么用?C# ActionService.GetById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionService
的用法示例。
在下文中一共展示了ActionService.GetById方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetById
/// <summary>
/// [Tin.Nguyen] - Lấy dữ liệu Dân Tộc(Cat_ExportItem) theo Id
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public CatExportItemModel GetById(Guid id)
{
string status = string.Empty;
var model = new CatExportItemModel();
ActionService service = new ActionService(UserLogin);
var entity = service.GetById<Cat_ExportItemEntity>(id, ref status);
if (entity != null)
{
model = entity.CopyData<CatExportItemModel>();
}
model.ActionStatus = status;
return model;
}
示例2: GetById
/// <summary>
/// [Tin.Nguyen] - Lấy dữ liệu Tủ Đồ(Lau_Locker) theo Id
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Lau_MachineOfLineModel GetById(Guid id)
{
string status = string.Empty;
var model = new Lau_MachineOfLineModel();
ActionService service = new ActionService(UserLogin);
var entity = service.GetById<Lau_MachineOfLineEntity>(id, ref status);
if (entity != null)
{
model = entity.CopyData<Lau_MachineOfLineModel>();
}
model.ActionStatus = status;
return model;
}
示例3: GetById
/// <summary>
/// [Tin.Nguyen] - Lấy dữ liệu Dân Tộc(Cat_ExportItem) theo Id
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Sys_AutoBackupModel GetById(Guid id)
{
string status = string.Empty;
var model = new Sys_AutoBackupModel();
ActionService service = new ActionService(UserLogin);
var entity = service.GetById<Sys_AutoBackupEntity>(id, ref status);
if (entity != null)
{
model = entity.CopyData<Sys_AutoBackupModel>();
}
model.ActionStatus = status;
return model;
}
示例4: Post
public Can_MealRecordMissingModel Post([Bind]Can_MealRecordMissingModel model)
{
var mealRecordMissingModel = new Can_MealRecordMissingModel
{
ID = model.ID,
ProfileID = model.ProfileID,
TamScanReasonMissID = model.TamScanReasonMissID,
WorkDate = model.WorkDate,
Amount = model.Amount,
Status = model.Status,
MealAllowanceTypeSettingID = model.MealAllowanceTypeSettingID,
IsFullPay = model.IsFullPay,
Type= model.Type,
ActionStatus = model.ActionStatus
};
ActionService service = new ActionService(UserLogin);
if (mealRecordMissingModel.MealAllowanceTypeSettingID != null && mealRecordMissingModel.MealAllowanceTypeSettingID != Guid.Empty)
{
string status = string.Empty;
var mealAllowanceTypeSetting = service.GetByIdUseStore<Can_MealAllowanceTypeSettingEntity>(mealRecordMissingModel.MealAllowanceTypeSettingID.Value,ConstantSql.hrm_can_sp_get_mealallowtypebyid, ref status);
if (mealAllowanceTypeSetting.Amount!=null)
mealRecordMissingModel.Amount = (decimal)mealAllowanceTypeSetting.Amount;
}
else if (mealRecordMissingModel.TamScanReasonMissID != null && mealRecordMissingModel.TamScanReasonMissID != Guid.Empty)
{
string status = string.Empty;
var tamScanReasonMiss = service.GetById<Cat_TAMScanReasonMissEntity>(mealRecordMissingModel.TamScanReasonMissID.Value, ref status);
if (tamScanReasonMiss != null && tamScanReasonMiss.MealAllowanceTypeSettingID != null)
{
var mealAllowanceTypeSetting = service.GetById<Can_MealAllowanceTypeSettingEntity>(tamScanReasonMiss.MealAllowanceTypeSettingID.Value, ref status);
mealRecordMissingModel.MealAllowanceTypeSettingID = tamScanReasonMiss.MealAllowanceTypeSettingID;
mealRecordMissingModel.Amount =(decimal) mealAllowanceTypeSetting.Amount;
}
}
var data = service.UpdateOrCreate<Can_MealRecordMissingEntity, Can_MealRecordMissingModel>(mealRecordMissingModel);
if (data!=null)
{
var dataModel = new Can_MealRecordMissingModel
{
ID = data.ID,
ProfileID = data.ProfileID,
TamScanReasonMissID = model.TamScanReasonMissID,
WorkDate = data.WorkDate,
Amount = data.Amount,
Status = data.Status,
MealAllowanceTypeSettingID = data.MealAllowanceTypeSettingID,
IsFullPay = data.IsFullPay,
Type = data.Type,
EmpCode = data.EmpCode,
OrgStructureID = data.OrgStructureID,
OrgStructureName = data.OrgStructureName,
TamScanReasonMissName = data.TamScanReasonMissName,
MealAllowanceTypeSettingName = data.MealAllowanceTypeSettingName,
ActionStatus = data.ActionStatus
};
return dataModel;
}
return null;
}