Esempio n. 1
0
        protected override void Insert()
        {
            HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory TurnCancelCommentFactory = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory();
            try
            {
                HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T TurnCancelCommentEntity = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T();
                TurnCancelCommentEntity.TurnCancelComment_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(TurnCancelComment_nvcTextBox.Text, TypeCode.String).ToString();
                TurnCancelCommentEntity.UserGroupID_int       = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(UserGroupID_intComboBox.SelectedValue, TypeCode.Int32);

                TurnCancelCommentFactory.BeginProc();
                TurnCancelCommentFactory.Insert(TurnCancelCommentEntity);
                TurnCancelCommentFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T.TurnCancelComment_TField.TurnCancelCommentID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TurnCancelCommentEntity.TurnCancelCommentID_int, TypeCode.Int32);
                    dr[HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T.TurnCancelComment_TField.TurnCancelComment_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TurnCancelCommentEntity.TurnCancelComment_nvc, TypeCode.String);
                    dr[HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T.TurnCancelComment_TField.UserGroupID_int.ToString()]         = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TurnCancelCommentEntity.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)
            {
                TurnCancelCommentFactory.RollBackProc();
                throw ex;
            }
        }
Esempio n. 2
0
        protected override void Edit()
        {
            HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory TurnCancelCommentFactory = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory();
            try
            {
                HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T TurnCancelCommentEntity = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T();
                TurnCancelCommentEntity.TurnCancelComment_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(TurnCancelComment_nvcTextBox.Text, TypeCode.String).ToString();
                TurnCancelCommentEntity.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)
                {
                    TurnCancelCommentFactory.BeginProc();
                    TurnCancelCommentFactory.Update(TurnCancelCommentEntity, (HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys)Key);
                    TurnCancelCommentFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T.TurnCancelComment_TField.TurnCancelCommentID_int.ToString() + "='" + ((HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys)Key).TurnCancelCommentID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T.TurnCancelComment_TField.TurnCancelComment_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TurnCancelCommentEntity.TurnCancelComment_nvc, TypeCode.String);
                            dr[0]["UserGroupID_intUserGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(UserGroupID_intComboBox);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                TurnCancelCommentFactory.RollBackProc();
                throw ex;
            }
        }
Esempio n. 3
0
        protected override void Delete()
        {
            HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory TurnCancelCommentFactory = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    TurnCancelCommentFactory.BeginProc();
                    TurnCancelCommentFactory.Delete((HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys)Key);
                    TurnCancelCommentFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T.TurnCancelComment_TField.TurnCancelCommentID_int.ToString() + "='" + ((HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys)Key).TurnCancelCommentID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                TurnCancelCommentFactory.RollBackProc();
                throw ex;
            }
        }