public ActionResult Index() { var entityPre = systemMgr.GetEntityPreferenceValue(Entity.SYS.EntityPreference.CodeEnum.ProdLineWarningColors, false); var colors = entityPre.Split('-'); WarningColor warningColor = new WarningColor(); warningColor.Range1 = float.Parse(colors[1]); warningColor.Range2 = float.Parse(colors[2]); warningColor.Range3 = float.Parse(colors[3]); warningColor.Range4 = float.Parse(colors[4]); warningColor.Range5 = float.Parse(colors[5]); warningColor.Range6 = float.Parse(colors[6]); return View(warningColor); }
public ActionResult Index(WarningColor warningColor) { if (ModelState.IsValid) { EntityPreference entityPreference = this.genericMgr.FindById<EntityPreference>((int)Entity.SYS.EntityPreference.CodeEnum.ProdLineWarningColors); StringBuilder str = new StringBuilder("0-"); str.Append(warningColor.Range1); str.Append("-"); str.Append(warningColor.Range2); str.Append("-"); str.Append(warningColor.Range3); str.Append("-"); str.Append(warningColor.Range4); str.Append("-"); str.Append(warningColor.Range5); str.Append("-"); str.Append(warningColor.Range6); str.Append("-99999999"); entityPreference.Value = str.ToString(); this.genericMgr.UpdateWithTrim(entityPreference); SaveSuccessMessage(Resources.EXT.ControllerLan.Con_SavedSuccessfully); } return View(warningColor); }