public override int?Save(string action) { var data = new MenuCategoryDataModel(); data.MenuCategoryId = SystemKeyId; data.Name = Name; data.Description = Description; data.SortOrder = SortOrder; if (action == "Insert") { var dtMenuCategory = MenuCategoryDataManager.DoesExist(data, SessionVariables.RequestProfile); if (dtMenuCategory.Rows.Count == 0) { MenuCategoryDataManager.Create(data, SessionVariables.RequestProfile); } else { throw new Exception("Record with given ID already exists."); } } else { MenuCategoryDataManager.Update(data, SessionVariables.RequestProfile); } return(data.MenuCategoryId); }
public void Update([FromBody] MenuCategoryDataModel data) { MenuCategoryDataManager.Update(data, SessionVariables.RequestProfile); }