示例#1
0
        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;
            }
        }
示例#2
0
        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;
            }
        }
示例#3
0
        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;
            }
        }