protected override void Edit() { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); try { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T LadeCancelCommentEntity = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T(); LadeCancelCommentEntity.LadeCancelComment_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LadeCancelComment_nvcTextBox.Text, TypeCode.String).ToString(); LadeCancelCommentEntity.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) { LadeCancelCommentFactory.BeginProc(); LadeCancelCommentFactory.Update(LadeCancelCommentEntity, (HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys)Key); LadeCancelCommentFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCanceltCommentID_int.ToString() + "='" + ((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys)Key).LadeCanceltCommentID_int.ToString() + "'"); if (dr.Length > 0) { dr[0][HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCancelComment_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeCancelCommentEntity.LadeCancelComment_nvc, TypeCode.String); dr[0]["UserGroupID_intUserGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(UserGroupID_intComboBox); } DataTable.AcceptChanges(); } } } catch (Exception ex) { LadeCancelCommentFactory.RollBackProc(); throw ex; } }
protected override void Delete() { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true) { LadeCancelCommentFactory.BeginProc(); LadeCancelCommentFactory.Delete((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys)Key); LadeCancelCommentFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCanceltCommentID_int.ToString() + "='" + ((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys)Key).LadeCanceltCommentID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } DataTable.AcceptChanges(); } this.Close(); } } catch (Exception ex) { LadeCancelCommentFactory.RollBackProc(); throw ex; } }
protected override void Insert() { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); try { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T LadeCancelCommentEntity = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T(); LadeCancelCommentEntity.LadeCancelComment_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LadeCancelComment_nvcTextBox.Text, TypeCode.String).ToString(); LadeCancelCommentEntity.UserGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(UserGroupID_intComboBox.SelectedValue, TypeCode.Int32); LadeCancelCommentFactory.BeginProc(); LadeCancelCommentFactory.Insert(LadeCancelCommentEntity); LadeCancelCommentFactory.CommitProc(); if (DataTable != null) { DataRow dr = this.DataTable.NewRow(); dr[HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCanceltCommentID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeCancelCommentEntity.LadeCanceltCommentID_int, TypeCode.Int32); dr[HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCancelComment_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeCancelCommentEntity.LadeCancelComment_nvc, TypeCode.String); dr[HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.UserGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeCancelCommentEntity.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) { LadeCancelCommentFactory.RollBackProc(); throw ex; } }
private void FillCheckListBox() { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); try { List <HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T> LadeCancelCommentList = LadeCancelCommentFactory.GetAll(); if (LadeCancelCommentList != null && LadeCancelCommentList.Count > 0) { foreach (HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T item in LadeCancelCommentList) { if (item.LadeCanceltCommentID_int != 6) { LadeCancelCommentID_intCheckList.Items.Add(item, false); } } } this.LadeCancelCommentID_intCheckList.GetType().GetProperty("DisplayMember").SetValue(this.LadeCancelCommentID_intCheckList, HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCancelComment_nvc.ToString(), null); this.LadeCancelCommentID_intCheckList.GetType().GetProperty("ValueMember").SetValue(this.LadeCancelCommentID_intCheckList, HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCanceltCommentID_int.ToString(), null); } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
private void DeleteButton_Click(object sender, EventArgs e) { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false) { return; } HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelComment_TFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys LadeCancelCommentKey = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys(); LadeCancelCommentKey.LadeCanceltCommentID_int = (Int32?)LadeCancelCommentGridView.CurrentRow.Cells["colLadeCanceltCommentID_int"].Value; LadeCancelCommentFactory.Delete(LadeCancelCommentKey); DataRow[] dr = ((DataTable)this.LadeCancelCommentGridView.DataSource).Select(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCanceltCommentID_int.ToString() + "='" + LadeCancelCommentKey.LadeCanceltCommentID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } ((DataTable)this.LadeCancelCommentGridView.DataSource).AcceptChanges(); } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
protected override void ShowForm() { this.FillCombo(); HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T LadeCancelCommentEntity = LadeCancelCommentFactory.GetBy((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys)Key); if (LadeCancelCommentEntity == null) { throw new HPS.Exceptions.LadeCancelCommentNotFound(); } LadeCancelComment_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(LadeCancelCommentEntity.LadeCancelComment_nvc, TypeCode.String).ToString(); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref UserGroupID_intComboBox, LadeCancelCommentEntity.UserGroupID_int, TypeCode.Int32); }
private void LoadLadeCancelComment() { try { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); DataTable LadeCancelCommentDataTable = new DataTable(); LadeCancelCommentFactory.GetAll(ref LadeCancelCommentDataTable); this.LadeCancelCommentGridView.DataSource = LadeCancelCommentDataTable; } catch (System.Exception ex) { throw ex; } }
private void FillCombo() { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); DataTable LadeCancelCommentID_intDataTable = new DataTable(); LadeCancelCommentFactory.GetAll(ref LadeCancelCommentID_intDataTable); DataRow LadeCancelCommentdr = LadeCancelCommentID_intDataTable.NewRow(); LadeCancelCommentdr["LadeCanceltCommentID_int"] = 0; DataRow[] dr = LadeCancelCommentID_intDataTable.Select("LadeCanceltCommentID_int=6"); if (dr != null) { LadeCancelCommentID_intDataTable.Rows.Remove(dr[0]); } LadeCancelCommentID_intDataTable.Rows.InsertAt(LadeCancelCommentdr, 0); this.LadeCancelCommentID_intComboBox.DisplayMember = HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCancelComment_nvc.ToString(); this.LadeCancelCommentID_intComboBox.ValueMember = HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCanceltCommentID_int.ToString(); this.LadeCancelCommentID_intComboBox.DataSource = LadeCancelCommentID_intDataTable; this.LadeCancelCommentID_intComboBox.SelectedIndex = -1; }