private void DeleteButton_Click(object sender, EventArgs e) { HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory LadeCommentFactory = new HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false) { return; } HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory LadeComment_TFactory = new HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory(); HPS.BLL.LadeCommentBLL.BLLLadeComment_TKeys LadeCommentKey = new HPS.BLL.LadeCommentBLL.BLLLadeComment_TKeys(); LadeCommentKey.LadeCommentID_int = (Int32?)LadeCommentGridView.CurrentRow.Cells["colLadeCommentID_int"].Value; LadeCommentFactory.Delete(LadeCommentKey); DataRow[] dr = ((DataTable)this.LadeCommentGridView.DataSource).Select(HPS.BLL.LadeCommentBLL.BLLLadeComment_T.LadeComment_TField.LadeCommentID_int.ToString() + "='" + LadeCommentKey.LadeCommentID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } ((DataTable)this.LadeCommentGridView.DataSource).AcceptChanges(); } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
protected override void Edit() { HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory LadeCommentFactory = new HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory(); try { HPS.BLL.LadeCommentBLL.BLLLadeComment_T LadeCommentEntity = new HPS.BLL.LadeCommentBLL.BLLLadeComment_T(); LadeCommentEntity.LadeComment_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LadeComment_nvcTextBox.Text, TypeCode.String).ToString(); LadeCommentEntity.UserGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(UserGroupID_intComboBox.SelectedValue, TypeCode.Int32); if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true) { LadeCommentFactory.BeginProc(); LadeCommentFactory.Update(LadeCommentEntity, (HPS.BLL.LadeCommentBLL.BLLLadeComment_TKeys)Key); LadeCommentFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.LadeCommentBLL.BLLLadeComment_T.LadeComment_TField.LadeCommentID_int.ToString() + "='" + ((HPS.BLL.LadeCommentBLL.BLLLadeComment_TKeys)Key).LadeCommentID_int.ToString() + "'"); if (dr.Length > 0) { dr[0][HPS.BLL.LadeCommentBLL.BLLLadeComment_T.LadeComment_TField.LadeComment_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeCommentEntity.LadeComment_nvc, TypeCode.String); dr[0]["UserGroupID_intUserGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(UserGroupID_intComboBox); } DataTable.AcceptChanges(); } } } catch (Exception ex) { LadeCommentFactory.RollBackProc(); throw ex; } }
protected override void Insert() { HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory LadeCommentFactory = new HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory(); try { HPS.BLL.LadeCommentBLL.BLLLadeComment_T LadeCommentEntity = new HPS.BLL.LadeCommentBLL.BLLLadeComment_T(); LadeCommentEntity.LadeComment_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LadeComment_nvcTextBox.Text, TypeCode.String).ToString(); LadeCommentEntity.UserGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(UserGroupID_intComboBox.SelectedValue, TypeCode.Int32); LadeCommentFactory.BeginProc(); LadeCommentFactory.Insert(LadeCommentEntity); LadeCommentFactory.CommitProc(); if (DataTable != null) { DataRow dr = this.DataTable.NewRow(); dr[HPS.BLL.LadeCommentBLL.BLLLadeComment_T.LadeComment_TField.LadeCommentID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeCommentEntity.LadeCommentID_int, TypeCode.Int32); dr[HPS.BLL.LadeCommentBLL.BLLLadeComment_T.LadeComment_TField.LadeComment_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeCommentEntity.LadeComment_nvc, TypeCode.String); dr[HPS.BLL.LadeCommentBLL.BLLLadeComment_T.LadeComment_TField.UserGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeCommentEntity.UserGroupID_int, TypeCode.Int32); dr["UserGroupID_intUserGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(UserGroupID_intComboBox); DataTable.Rows.Add(dr); DataTable.AcceptChanges(); } this.ClearForm(this); } catch (Exception ex) { LadeCommentFactory.RollBackProc(); throw ex; } }
protected override void Delete() { HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory LadeCommentFactory = new HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true) { LadeCommentFactory.BeginProc(); LadeCommentFactory.Delete((HPS.BLL.LadeCommentBLL.BLLLadeComment_TKeys)Key); LadeCommentFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.LadeCommentBLL.BLLLadeComment_T.LadeComment_TField.LadeCommentID_int.ToString() + "='" + ((HPS.BLL.LadeCommentBLL.BLLLadeComment_TKeys)Key).LadeCommentID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } DataTable.AcceptChanges(); } this.Close(); } } catch (Exception ex) { LadeCommentFactory.RollBackProc(); throw ex; } }
protected override void ShowForm() { this.FillCombo(); HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory LadeCommentFactory = new HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory(); HPS.BLL.LadeCommentBLL.BLLLadeComment_T LadeCommentEntity = LadeCommentFactory.GetBy((HPS.BLL.LadeCommentBLL.BLLLadeComment_TKeys)Key); if (LadeCommentEntity == null) { throw new HPS.Exceptions.LadeCommentNotFound(); } LadeComment_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(LadeCommentEntity.LadeComment_nvc, TypeCode.String).ToString(); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref UserGroupID_intComboBox, LadeCommentEntity.UserGroupID_int, TypeCode.Int32); }
private void LoadLadeComment() { try { HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory LadeCommentFactory = new HPS.BLL.LadeCommentBLL.BLLLadeComment_TFactory(); DataTable LadeCommentDataTable = new DataTable(); LadeCommentFactory.GetAll(ref LadeCommentDataTable); this.LadeCommentGridView.DataSource = LadeCommentDataTable; } catch (System.Exception ex) { throw ex; } }