public static string SaveRawDate(string column, int rowID, DateTime date) { using (var context = new CMER_DWEnt()) { PlanFact pf = context.PlanFact.Where(x => x.IDFact == rowID).FirstOrDefault(); if (pf != null) { if (column == "DateStart") pf.DateStart = date; if (column == "DateEnd") pf.DateEnd = date; context.Entry(pf).CurrentValues.SetValues(pf); } context.SaveChanges(); return ""; } }
public static string SaveRawValue(string column, int rowID, int value) { using (var context = new CMER_DWEnt()) { PlanFact pf = context.PlanFact.Where(x => x.IDFact == rowID).FirstOrDefault(); if (pf != null) { if (column == "Qty") pf.Qty = value; if (column == "Volume") pf.Volume = value; context.Entry(pf).CurrentValues.SetValues(pf); } context.SaveChanges(); return ""; } }
public static string SaveRaw(string column, int rowID, int id) { using (var context = new CMER_DWEnt()) { PlanFact pf = context.PlanFact.Where(x => x.IDFact == rowID).FirstOrDefault(); if (pf != null) { if (column == "kpvedName") pf.IDKpved = id; if (column == "ctgSName") pf.IDContragentSupplier = id; if (column == "ctgPName") pf.IDContragentPurchaser= id; if (column == "katoSName") pf.IDKatoSupplier = id; if (column == "katoPName") pf.IDKatoPurchaser = id; if (column == "mkeeName") pf.IDMkee = id; if (column == "skpName") pf.IDSkp = id; if (column == "countrySName") pf.IdCountrySupplier = id; if (column == "countryPName") pf.IdCountryPurchaser = id; if (column == "truType") pf.IDKpvedTRU = id; if (column == "srcName") pf.IDSource = id; context.Entry(pf).CurrentValues.SetValues(pf); } context.SaveChanges(); return ""; } }