private bool create_new_category() { try { category newCat = new category(); newCat.category_name = txtCategoryName.Text; newCat.code = txtCode.Text; newCat.description = txtDescription.Text; newCat.owner = 0; newCat.created_at = DateTime.Now; Database.CRM.categories.InsertOnSubmit(newCat); Database.CRM.SubmitChanges(); return true; } catch (Exception newCatError) { MessageBox.Show(newCatError.Message); return false; } }
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(); }
partial void Deletecategory(category instance);
partial void Updatecategory(category instance);
partial void Insertcategory(category instance);