public IActionResult NewCR(NetCorePSAV.Models.NCRModel.newCRView NCR, string hiddenEle) { GCCorePSAV.Data.clsQuery cls = new GCCorePSAV.Data.clsQuery(); if (ModelState.IsValid) { NCR.sadic = hiddenEle; //get send items to sum ammounts string[] arrayServAdic = hiddenEle.Split(','); double valor = 0; foreach (string str in arrayServAdic) { valor = valor + cls.GetServAdicAmmount(str); } NCR.LB = valor.ToString(); //end get items cls.SaveNCR(NCR); return(RedirectToAction("CaptureRatio")); } else { //get all data from DB //DET ViewBag.DET = cls.GetDETs(); //SAles Manager ViewBag.RepVtas = cls.RepVtas(); //Location - Cascade ViewBag.Locations = cls.GetNLocations(); ViewBag.datasourceC = cls.GetCiudades(); ViewBag.datasourceI = cls.GetNuLocations(); //Etiqueta ViewBag.Etiquetas = cls.GetEtiquetas(); //TipoEvento ViewBag.TipoEvento = cls.GetTipoEventos(); //MotivoLb ViewBag.LBMotivo = cls.GetMotivos(); //Sadic ViewBag.sadic = cls.GetSadics(); return(View()); } }
public IActionResult NewCR() { GCCorePSAV.Data.clsQuery cls = new GCCorePSAV.Data.clsQuery(); //get all data from DB //DET ViewBag.DET = cls.GetDETs(); //SAles Manager ViewBag.RepVtas = cls.RepVtas(); //Location - Cascade ViewBag.Locations = cls.GetNLocations(); ViewBag.datasourceC = cls.GetCiudades(); ViewBag.datasourceI = cls.GetNuLocations(); //Etiqueta ViewBag.Etiquetas = cls.GetEtiquetas(); //TipoEvento ViewBag.TipoEvento = cls.GetTipoEventos(); //MotivoLb ViewBag.LBMotivo = cls.GetMotivos(); //Sadic ViewBag.sadic = cls.GetSadics(); return(View()); }