Example #1
0
        protected override void Edit()
        {
            HPS.BLL.BoundryBLL.BLLBoundry_TFactory BoundryFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();
            try
            {
                HPS.BLL.BoundryBLL.BLLBoundry_T BoundryEntity = new HPS.BLL.BoundryBLL.BLLBoundry_T();
                BoundryEntity.BoundryCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(BoundryCode_nvcTextBox.Text, TypeCode.String).ToString();
                BoundryEntity.Boundry_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(Boundry_nvcTextBox.Text, TypeCode.String).ToString();

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    BoundryFactory.BeginProc();
                    BoundryFactory.Update(BoundryEntity, (HPS.BLL.BoundryBLL.BLLBoundry_TKeys)Key);
                    BoundryFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.BoundryID_int.ToString() + "='" + ((HPS.BLL.BoundryBLL.BLLBoundry_TKeys)Key).BoundryID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.BoundryCode_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(BoundryEntity.BoundryCode_nvc, TypeCode.String);
                            dr[0][HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.Boundry_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(BoundryEntity.Boundry_nvc, TypeCode.String);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                BoundryFactory.RollBackProc();
                throw ex;
            }
        }
Example #2
0
        protected override void Insert()
        {
            HPS.BLL.BoundryBLL.BLLBoundry_TFactory BoundryFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();
            try
            {
                HPS.BLL.BoundryBLL.BLLBoundry_T BoundryEntity = new HPS.BLL.BoundryBLL.BLLBoundry_T();
                BoundryEntity.BoundryCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(BoundryCode_nvcTextBox.Text, TypeCode.String).ToString();
                BoundryEntity.Boundry_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(Boundry_nvcTextBox.Text, TypeCode.String).ToString();

                BoundryFactory.BeginProc();
                BoundryFactory.Insert(BoundryEntity);
                BoundryFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.BoundryID_int.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(BoundryEntity.BoundryID_int, TypeCode.Int32);
                    dr[HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.BoundryCode_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(BoundryEntity.BoundryCode_nvc, TypeCode.String);
                    dr[HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.Boundry_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(BoundryEntity.Boundry_nvc, TypeCode.String);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                BoundryFactory.RollBackProc();
                throw ex;
            }
        }
Example #3
0
        protected override void Delete()
        {
            HPS.BLL.BoundryBLL.BLLBoundry_TFactory BoundryFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    BoundryFactory.BeginProc();
                    BoundryFactory.Delete((HPS.BLL.BoundryBLL.BLLBoundry_TKeys)Key);
                    BoundryFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.BoundryID_int.ToString() + "='" + ((HPS.BLL.BoundryBLL.BLLBoundry_TKeys)Key).BoundryID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                BoundryFactory.RollBackProc();
                throw ex;
            }
        }
Example #4
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.BoundryBLL.BLLBoundry_TFactory BoundryFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false)
                {
                    return;
                }


                HPS.BLL.BoundryBLL.BLLBoundry_TFactory Boundry_TFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();
                HPS.BLL.BoundryBLL.BLLBoundry_TKeys    BoundryKey       = new HPS.BLL.BoundryBLL.BLLBoundry_TKeys();

                BoundryKey.BoundryID_int = (Int32)BoundryGridView.CurrentRow.Cells["colBoundryID_int"].Value;
                BoundryFactory.Delete(BoundryKey);

                DataRow[] dr = ((DataTable)this.BoundryGridView.DataSource).Select(HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.BoundryID_int.ToString() + "='" + BoundryKey.BoundryID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.BoundryGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Example #5
0
 protected override void ShowForm()
 {
     this.FillCombo();
     HPS.BLL.BoundryBLL.BLLBoundry_TFactory BoundryFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();
     HPS.BLL.BoundryBLL.BLLBoundry_T        BoundryEntity  = BoundryFactory.GetBy((HPS.BLL.BoundryBLL.BLLBoundry_TKeys)Key);
     if (BoundryEntity == null)
     {
         throw new HPS.Exceptions.BoundryNotFound();
     }
     BoundryCode_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(BoundryEntity.BoundryCode_nvc, TypeCode.String));
     Boundry_nvcTextBox.Text     = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(BoundryEntity.Boundry_nvc, TypeCode.String));
 }
Example #6
0
 private void LoadBoundry()
 {
     try
     {
         HPS.BLL.BoundryBLL.BLLBoundry_TFactory BoundryFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();
         DataTable BoundryDataTable = new DataTable();
         BoundryFactory.GetAll(ref BoundryDataTable);
         this.BoundryGridView.DataSource = BoundryDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }