public ActionResult EditingUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] tb_sucursal_FormaPago_x_fa_NivelDescuento_Info info_det) { tb_sucursal_FormaPago_x_fa_NivelDescuento_Info existe = new tb_sucursal_FormaPago_x_fa_NivelDescuento_Info(); //if (ModelState.IsValid) List <tb_sucursal_FormaPago_x_fa_NivelDescuento_Info> ListaDetalle = new List <tb_sucursal_FormaPago_x_fa_NivelDescuento_Info>(); ListaDetalle = FormaPago_x_NivelDescuento_List.get_list(Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual)); if (ListaDetalle.Count > 1) { existe = ListaDetalle.Where(q => q.IdCatalogo == info_det.IdCatalogo).FirstOrDefault(); } else { existe = null; } if (existe == null) { FormaPago_x_NivelDescuento_List.UpdateRow(info_det, Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual)); } List <tb_sucursal_FormaPago_x_fa_NivelDescuento_Info> model = new List <tb_sucursal_FormaPago_x_fa_NivelDescuento_Info>(); model = FormaPago_x_NivelDescuento_List.get_list(Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual)); cargar_combos_detalle(); return(PartialView("_GridViewPartial_Sucursal_x_NivelDescuento", model)); }
public void UpdateRow(tb_sucursal_FormaPago_x_fa_NivelDescuento_Info info_det, decimal IdTransaccionSession) { tb_sucursal_FormaPago_x_fa_NivelDescuento_Info edited_info = get_list(IdTransaccionSession).Where(m => m.Secuencia == info_det.Secuencia).First(); edited_info.IdNivel = info_det.IdNivel; edited_info.IdCatalogo = info_det.IdCatalogo; }
public tb_sucursal_FormaPago_x_fa_NivelDescuento_Info get_info(int IdEmpresa, int IdSucursal, string IdCatalogo) { try { tb_sucursal_FormaPago_x_fa_NivelDescuento_Info info = new tb_sucursal_FormaPago_x_fa_NivelDescuento_Info(); using (Entities_general Context = new Entities_general()) { tb_sucursal_FormaPago_x_fa_NivelDescuento Entity = Context.tb_sucursal_FormaPago_x_fa_NivelDescuento.Where(q => q.IdEmpresa == IdEmpresa && q.IdSucursal == IdSucursal && q.IdCatalogo == IdCatalogo).FirstOrDefault(); if (Entity == null) { return(null); } info = new tb_sucursal_FormaPago_x_fa_NivelDescuento_Info { IdEmpresa = Entity.IdEmpresa, IdSucursal = Entity.IdSucursal, Secuencia = Entity.Secuencia, IdCatalogo = Entity.IdCatalogo, IdNivel = Entity.IdNivel }; } return(info); } catch (Exception) { throw; } }
public JsonResult Get_NivelDescuento_x_FormaPago(int IdEmpresa = 0, int IdSucursal = 0, string IdCatalogo_FormaPago = "") { tb_sucursal_FormaPago_x_fa_NivelDescuento_Info info_NivelDescuento_x_FormaPago = new tb_sucursal_FormaPago_x_fa_NivelDescuento_Info(); info_NivelDescuento_x_FormaPago = bus_formapago_x_niveldescuento.GetInfo(IdEmpresa, IdSucursal, IdCatalogo_FormaPago); var IdNivel = info_NivelDescuento_x_FormaPago == null ? 0 : info_NivelDescuento_x_FormaPago.IdNivel; return(Json(IdNivel, JsonRequestBehavior.AllowGet)); }
public void AddRow(tb_sucursal_FormaPago_x_fa_NivelDescuento_Info info_det, decimal IdTransaccionSession) { List <tb_sucursal_FormaPago_x_fa_NivelDescuento_Info> list = get_list(IdTransaccionSession); info_det.Secuencia = list.Count == 0 ? 1 : list.Max(q => q.Secuencia) + 1; info_det.IdNivel = info_det.IdNivel; info_det.IdCatalogo = info_det.IdCatalogo; list.Add(info_det); }
public tb_sucursal_FormaPago_x_fa_NivelDescuento_Info GetInfo(int IdEmpresa, int IdSucursal, string IdCatalogo) { try { tb_sucursal_FormaPago_x_fa_NivelDescuento_Info info = new tb_sucursal_FormaPago_x_fa_NivelDescuento_Info(); info = odata_detalle.get_info(IdEmpresa, IdSucursal, IdCatalogo); return(info); } catch (Exception) { throw; } }