示例#1
0
 public static void SaveCategory(crmCategoryView SelectedCategory)
 {
     category cat = CrmData.GetCategory(SelectedCategory.Id);
     cat.category_name = SelectedCategory.Name;
     cat.code = SelectedCategory.code;
     cat.description = SelectedCategory.description;
     cat.status = (bool)SelectedCategory.active;
     cat.modified_by = AppData.CurrentUser.id;
     cat.updated_at = DateTime.Now;
     Database.CRM.SubmitChanges();
 }
示例#2
0
 public static void AddCategory(crmCategoryView SelectedCategory)
 {
     category newCat = new category();
     newCat.category_name = SelectedCategory.Name;
     newCat.code = SelectedCategory.code;
     newCat.description = SelectedCategory.description;
     newCat.status = (bool)SelectedCategory.active;
     newCat.owner = AppData.CurrentUser.id;
     newCat.created_at = DateTime.Now;
     Database.CRM.categories.InsertOnSubmit(newCat);
     Database.CRM.SubmitChanges();
 }