public ActionResult ViewDetail(long counterPartyId = 0, string cifCounterParty = "") { CounterPartyGetDetailModel input = new CounterPartyGetDetailModel(); input.counterPartyId = counterPartyId; input.cifCounterParty = cifCounterParty; input.userId = RDAuthorize.UserId; var result = _counterPartyService.getDetailCounterParty(input); result.viewMode = ViewModeCons.VIEW; return(View("Create", result)); }
public ActionResult Create(string counterPartyGroup, long counterPartyId, string cifCounterParty) { CounterPartyGetDetailModel input = new CounterPartyGetDetailModel(); input.counterPartyId = counterPartyId; input.cifCounterParty = cifCounterParty; input.userId = RDAuthorize.UserId; var result = _counterPartyService.getDetailCounterParty(input); CPProductViewModel model = new CPProductViewModel(); Library.TransferData(result, ref model); TheSession.Remove(_strSectionProduct); //xóa section truoc return(View(model)); }
public CounterPartyDetailModel getDetailCounterParty(CounterPartyGetDetailModel input) { try { SqlParameter[] prms = new SqlParameter[] { new SqlParameter { ParameterName = "counterPartyId", DbType = DbType.Int64, Value = input.counterPartyId, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "cifCounterParty", DbType = DbType.String, Value = string.IsNullOrEmpty(input.cifCounterParty) ? (object)DBNull.Value : input.cifCounterParty, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "counterPartyGroup", DbType = DbType.String, Value = string.IsNullOrEmpty(input.counterPartyGroup) ? (object)DBNull.Value : input.counterPartyGroup, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "isInau", DbType = DbType.Int32, Value = input.isInau, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "userId", DbType = DbType.String, Value = input.userId == null ? (object)DBNull.Value : input.userId, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "resultMessage", DbType = DbType.String, Direction = ParameterDirection.Output, Size = Int32.MaxValue }, new SqlParameter { ParameterName = "resultCode", DbType = DbType.Int32, Direction = ParameterDirection.Output, Size = Int32.MaxValue } }; var result = _Repository.ExecWithStoreProcedureCommand(Store_getDetailCounterParty, prms); var resultObject = JsonConvert.DeserializeObject <CounterPartyDetailModel>(result.errorMessage); return(resultObject); } catch (Exception ex) { HDBH.Log.WriteLog.Error("CounterPartyService => getDetailCounterParty", ex); return(null); } }