public async Task <IHirePlanaModel> IndexAsync(HttpContext context, CancellationToken cancellationToken, string HirePlanaId) { _dal = new HirePlanaDAL(); IHirePlanaModel model = await _dal.SelectByIDAsync(Convert.ToInt64(HirePlanaId), userId, cancellationToken); await PoulateDropDownListAsync(model, cancellationToken); return(model); }
public async Task <IHirePlanaModel> SaveAsync(HttpContext context, IHirePlanaModel model, CancellationToken cancellationToken) { _dal = new HirePlanaDAL(); model.UserId = userId; if (model.HirePlanaId > 0) { context.Items[Constant.QuerySuccess] = Convert.ToBoolean(await _dal.UpdateAsync(model, cancellationToken)); context.Items[Constant.FormTitle] = "EDIT HirePlana"; } else { model.HirePlanaId = await _dal.SaveAsync(model, cancellationToken); context.Items[Constant.QuerySuccess] = Convert.ToBoolean(model.HirePlanaId); context.Items[Constant.FormTitle] = "ADD HirePlana"; } await PoulateDropDownListAsync(model, cancellationToken); return(model); }