public static List <PlanCommission> getListPlanCommission(String query) { NpgsqlConnection con = Connexion.Connection(); try { List <PlanCommission> l = new List <PlanCommission>(); NpgsqlCommand Lcmd = new NpgsqlCommand(query, con); NpgsqlDataReader lect = Lcmd.ExecuteReader(); if (lect.HasRows) { while (lect.Read()) { PlanCommission a = new PlanCommission(); a.Id = Convert.ToInt64(lect["id"].ToString()); a.Nature = lect["nature_commission"].ToString(); a.Reference = lect["reference"].ToString(); a.Commissions = BLL.CommissionBll.Liste("select * from yvs_com_commission where plan = " + a.Id); a.Update = true; l.Add(a); } lect.Close(); } return(l); } catch (NpgsqlException e) { Messages.Exception(e); return(null); } finally { Connexion.Deconnection(con); } }
public static PlanCommission getOnePlanCommission(long id) { NpgsqlConnection con = Connexion.Connection(); try { String search = "select * from yvs_com_plan_commission where id = " + id + ""; NpgsqlCommand Lcmd = new NpgsqlCommand(search, con); NpgsqlDataReader lect = Lcmd.ExecuteReader(); PlanCommission a = new PlanCommission(); if (lect.HasRows) { while (lect.Read()) { a.Id = Convert.ToInt64(lect["id"].ToString()); a.Nature = lect["nature_commission"].ToString(); a.Reference = lect["reference"].ToString(); a.Commissions = BLL.CommissionBll.Liste("select * from yvs_com_commission where plan = " + a.Id); a.Update = true; } lect.Close(); } return(a); } catch (NpgsqlException e) { Messages.Exception(e); return(null); } finally { Connexion.Deconnection(con); } }
public void InsertPlanCommission(PlanCommission plancommission) { Guard.NotNull(plancommission, nameof(plancommission)); _planCommissionRepository.Insert(plancommission); _requestCache.RemoveByPattern(PLANCOMMISSION_PATTERN_KEY); }
public ActionResult PlanCommission(PlanModel model) { try { PlanCommission planCommission = new PlanCommission(); planCommission.PlanId = model.PlanId; planCommission.CommissionPercentage = model.Commission; planCommission.Id = model.Id; planCommission.LevelId = model.LevelId; _planService.InsertPlanCommission(planCommission); NotifySuccess(T("Plan.PlancommissionSave")); } catch (Exception ex) { NotifyError(T("Plan.PlancommissionSaveError")); } return(View(model)); }
public static PlanCommission getAjoutPlanCommission(PlanCommission a) { NpgsqlConnection con = Connexion.Connection(); try { string insert = ""; NpgsqlCommand cmd = new NpgsqlCommand(insert, con); cmd.ExecuteNonQuery(); a.Id = getCurrent(); return(a); } catch { return(null); } finally { Connexion.Deconnection(con); } }
public static bool getUpdatePlanCommission(PlanCommission a) { NpgsqlConnection con = Connexion.Connection(); try { string update = ""; NpgsqlCommand Ucmd = new NpgsqlCommand(update, con); Ucmd.ExecuteNonQuery(); return(true); } catch (Exception e) { Messages.Exception(e); return(false); } finally { Connexion.Deconnection(con); } }
public void UpdatePlanCommission(PlanCommission plancommission) { Guard.NotNull(plancommission, nameof(plancommission)); _planCommissionRepository.Update(plancommission); }
public PlanCommissionBll(PlanCommission unPlanCommission) { plan = unPlanCommission; }