private void btnSave_Click(object sender, RoutedEventArgs e) { if (data.ProductName == null) { MessageBox.Show(string.Format(Message.PL.Empty_Record, "Product")); } else if (data.Id == 0 && !BLL.UserAccount.AllowInsert(FormName)) { MessageBox.Show(string.Format(Message.PL.DenyInsert, FormName)); } else if (data.Id != 0 && !BLL.UserAccount.AllowUpdate(FormName)) { MessageBox.Show(string.Format(Message.PL.DenyUpdate, FormName)); } else { if (data.Save() == true) { MessageBox.Show(Message.PL.Saved_Alert); data.Clear(); } else { MessageBox.Show(string.Format(Message.PL.Existing_Data, data.ProductName)); } } }
public static void SaveList(List <HCMIS.Desktop.DirectoryServices.Product> list) { BLL.Product bv = new BLL.Product(); foreach (HCMIS.Desktop.DirectoryServices.Product v in list) { // try to load by primary key bv.LoadByPrimaryKey(v.ID.Value); // if the entry doesn't exist, create it if (bv.RowCount == 0) { bv.AddNew(); } // populate the contents of v on the to the database list if (v.ID.HasValue) { bv.ID = v.ID.Value; } if (v.Name != "" && v.Name != null) { bv.IIN = v.Name; } if (v.TypeID.HasValue) { bv.TypeID = v.TypeID.Value; } bv.Save(); } }
public static void DeleteList(List <int> list) { BLL.Product bv = new BLL.Product(); foreach (int v in list) { // try to load by primary key bv.LoadByPrimaryKey(v); // if the entry doesn't exist, create it if (bv.RowCount > 0) { bv.MarkAsDeleted(); bv.Save(); } // populate the contents of v on the to the database list } }
public static void DeleteList(List<int> list) { BLL.Product bv = new BLL.Product(); foreach (int v in list) { // try to load by primary key bv.LoadByPrimaryKey(v); // if the entry doesn't exist, create it if (bv.RowCount > 0) { bv.MarkAsDeleted(); bv.Save(); } // populate the contents of v on the to the database list } }
public static void SaveList(List<HCMIS.Desktop.DirectoryServices.Product> list) { BLL.Product bv = new BLL.Product(); foreach (HCMIS.Desktop.DirectoryServices.Product v in list) { // try to load by primary key bv.LoadByPrimaryKey(v.ID.Value); // if the entry doesn't exist, create it if (bv.RowCount == 0) { bv.AddNew(); } // populate the contents of v on the to the database list if( v.ID.HasValue ) bv.ID = v.ID.Value; if( v.Name != "" && v.Name != null ) bv.IIN = v.Name; if( v.TypeID.HasValue ) bv.TypeID = v.TypeID.Value; bv.Save(); } }