コード例 #1
0
        protected override void Insert()
        {
            HPS.BLL.ClassBLL.BLLClass_TFactory ClassFactory = new HPS.BLL.ClassBLL.BLLClass_TFactory();
            try
            {
                HPS.BLL.ClassBLL.BLLClass_T ClassEntity = new HPS.BLL.ClassBLL.BLLClass_T();
                ClassEntity.ClassName_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(ClassName_nvcTextBox.Text, TypeCode.String).ToString();

                ClassFactory.BeginProc();
                ClassFactory.Insert(ClassEntity);
                ClassFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.ClassBLL.BLLClass_T.Class_TField.ClassID_int.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(ClassEntity.ClassID_int, TypeCode.Int32);
                    dr[HPS.BLL.ClassBLL.BLLClass_T.Class_TField.ClassName_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(ClassEntity.ClassName_nvc, TypeCode.String);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                ClassFactory.RollBackProc();
                throw ex;
            }
        }
コード例 #2
0
        protected override void Edit()
        {
            HPS.BLL.ClassBLL.BLLClass_TFactory ClassFactory = new HPS.BLL.ClassBLL.BLLClass_TFactory();
            try
            {
                HPS.BLL.ClassBLL.BLLClass_T ClassEntity = new HPS.BLL.ClassBLL.BLLClass_T();
                ClassEntity.ClassName_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(ClassName_nvcTextBox.Text, TypeCode.String).ToString();

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    ClassFactory.BeginProc();
                    ClassFactory.Update(ClassEntity, (HPS.BLL.ClassBLL.BLLClass_TKeys)Key);
                    ClassFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.ClassBLL.BLLClass_T.Class_TField.ClassID_int.ToString() + "='" + ((HPS.BLL.ClassBLL.BLLClass_TKeys)Key).ClassID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.ClassBLL.BLLClass_T.Class_TField.ClassName_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(ClassEntity.ClassName_nvc, TypeCode.String);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.RollBackProc();
                throw ex;
            }
        }
コード例 #3
0
        protected override void Delete()
        {
            HPS.BLL.ClassBLL.BLLClass_TFactory ClassFactory = new HPS.BLL.ClassBLL.BLLClass_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    ClassFactory.BeginProc();
                    ClassFactory.Delete((HPS.BLL.ClassBLL.BLLClass_TKeys)Key);
                    ClassFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.ClassBLL.BLLClass_T.Class_TField.ClassID_int.ToString() + "='" + ((HPS.BLL.ClassBLL.BLLClass_TKeys)Key).ClassID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                ClassFactory.RollBackProc();
                throw ex;
            }
        }