Exemple #1
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.BillBLL.BLLBill_TFactory BillFactory = new HPS.BLL.BillBLL.BLLBill_TFactory();

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


                HPS.BLL.BillBLL.BLLBill_TFactory Bill_TFactory = new HPS.BLL.BillBLL.BLLBill_TFactory();
                HPS.BLL.BillBLL.BLLBill_TKeys    BillKey       = new HPS.BLL.BillBLL.BLLBill_TKeys();

                BillKey.BillID_int = (Int32)BillGridView.CurrentRow.Cells["colBillID_int"].Value;
                BillFactory.Delete(BillKey);

                DataRow[] dr = ((DataTable)this.BillGridView.DataSource).Select(HPS.BLL.BillBLL.BLLBill_T.Bill_TField.BillID_int.ToString() + "='" + BillKey.BillID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.BillGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Exemple #2
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.BillBLL.BLLBill_TFactory BillID_intFactory = new HPS.BLL.BillBLL.BLLBill_TFactory();
                DataTable BillID_intDataTable = new DataTable();
                BillID_intFactory.GetAll(ref BillID_intDataTable);
                this.BillID_intComboBox.DisplayMember = HPS.BLL.BillBLL.BLLBill_T.Bill_TField.BillType_nvc.ToString();
                this.BillID_intComboBox.ValueMember   = HPS.BLL.BillBLL.BLLBill_T.Bill_TField.BillID_int.ToString();
                this.BillID_intComboBox.DataSource    = BillID_intDataTable;
                this.BillID_intComboBox.SelectedIndex = -1;

                HPS.BLL.SaloonBLL.BLLSaloon_TFactory Saloon_TFactory = new HPS.BLL.SaloonBLL.BLLSaloon_TFactory();
                DataTable Saloon_TDataTable = new DataTable();
                Saloon_TFactory.GetAll(ref Saloon_TDataTable);
                this.SaloonID_intComboBox.DisplayMember = HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.Saloon_nvc.ToString();
                this.SaloonID_intComboBox.ValueMember   = HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.SaloonID_int.ToString();
                this.SaloonID_intComboBox.DataSource    = Saloon_TDataTable;
                this.SaloonID_intComboBox.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
 private void AllInReportForm_Load(object sender, EventArgs e)
 {
     HPS.BLL.BillBLL.BLLBill_TFactory Factory = new HPS.BLL.BillBLL.BLLBill_TFactory();
     //  ToTimeTextBox.Text = Factory.ServerTime.ToString();
     this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
     this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
 }
Exemple #4
0
        protected override void Edit()
        {
            HPS.BLL.BillBLL.BLLBill_TFactory BillFactory = new HPS.BLL.BillBLL.BLLBill_TFactory();
            try
            {
                HPS.BLL.BillBLL.BLLBill_T BillEntity = new HPS.BLL.BillBLL.BLLBill_T();
                BillEntity.BillType_nvc      = Hepsa.Core.Common.PersentationController.GetEntityValue(BillType_nvcTextBox.Text, TypeCode.String).ToString();
                BillEntity.TrafficTypeID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(TrafficTypeID_intComboBox.SelectedValue, TypeCode.Int32);

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    BillFactory.BeginProc();
                    BillFactory.Update(BillEntity, (HPS.BLL.BillBLL.BLLBill_TKeys)Key);
                    BillFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.BillBLL.BLLBill_T.Bill_TField.BillID_int.ToString() + "='" + ((HPS.BLL.BillBLL.BLLBill_TKeys)Key).BillID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.BillBLL.BLLBill_T.Bill_TField.BillType_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(BillEntity.BillType_nvc, TypeCode.String);
                            dr[0]["TrafficTypeID_intTrafficType_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(TrafficTypeID_intComboBox);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                BillFactory.RollBackProc();
                throw ex;
            }
        }
Exemple #5
0
        protected override void Insert()
        {
            HPS.BLL.BillBLL.BLLBill_TFactory BillFactory = new HPS.BLL.BillBLL.BLLBill_TFactory();
            try
            {
                HPS.BLL.BillBLL.BLLBill_T BillEntity = new HPS.BLL.BillBLL.BLLBill_T();
                BillEntity.BillType_nvc      = Hepsa.Core.Common.PersentationController.GetEntityValue(BillType_nvcTextBox.Text, TypeCode.String).ToString();
                BillEntity.TrafficTypeID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(TrafficTypeID_intComboBox.SelectedValue, TypeCode.Int32);

                BillFactory.BeginProc();
                BillFactory.Insert(BillEntity);
                BillFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.BillBLL.BLLBill_T.Bill_TField.BillID_int.ToString()]        = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(BillEntity.BillID_int, TypeCode.Int32);
                    dr[HPS.BLL.BillBLL.BLLBill_T.Bill_TField.BillType_nvc.ToString()]      = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(BillEntity.BillType_nvc, TypeCode.String);
                    dr[HPS.BLL.BillBLL.BLLBill_T.Bill_TField.TrafficTypeID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(BillEntity.TrafficTypeID_int, TypeCode.Int32);
                    dr["TrafficTypeID_intTrafficType_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(TrafficTypeID_intComboBox);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                BillFactory.RollBackProc();
                throw ex;
            }
        }
Exemple #6
0
        protected override void Delete()
        {
            HPS.BLL.BillBLL.BLLBill_TFactory BillFactory = new HPS.BLL.BillBLL.BLLBill_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    BillFactory.BeginProc();
                    BillFactory.Delete((HPS.BLL.BillBLL.BLLBill_TKeys)Key);
                    BillFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.BillBLL.BLLBill_T.Bill_TField.BillID_int.ToString() + "='" + ((HPS.BLL.BillBLL.BLLBill_TKeys)Key).BillID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                BillFactory.RollBackProc();
                throw ex;
            }
        }
Exemple #7
0
 protected override void ShowForm()
 {
     this.FillCombo();
     HPS.BLL.BillBLL.BLLBill_TFactory BillFactory = new HPS.BLL.BillBLL.BLLBill_TFactory();
     HPS.BLL.BillBLL.BLLBill_T        BillEntity  = BillFactory.GetBy((HPS.BLL.BillBLL.BLLBill_TKeys)Key);
     if (BillEntity == null)
     {
         throw new HPS.Exceptions.BillNotFound();
     }
     BillType_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(BillEntity.BillType_nvc, TypeCode.String));
     Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref TrafficTypeID_intComboBox, BillEntity.TrafficTypeID_int, TypeCode.Int32);
 }
Exemple #8
0
 private void LoadBill()
 {
     try
     {
         HPS.BLL.BillBLL.BLLBill_TFactory BillFactory = new HPS.BLL.BillBLL.BLLBill_TFactory();
         DataTable BillDataTable = new DataTable();
         BillFactory.GetAll(ref BillDataTable);
         this.BillGridView.DataSource = BillDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Exemple #9
0
 private void RefreshHourbutton_Click(object sender, EventArgs e)
 {
     HPS.BLL.BillBLL.BLLBill_TFactory Factory = new HPS.BLL.BillBLL.BLLBill_TFactory();
     this.ToTimeTextBox.Text = Factory.ServerTime;
 }
Exemple #10
0
 private void AcceptedTurnWithoutLadBillCreditDevidedByLaderTypeAndDateForm_Load(object sender, EventArgs e)
 {
     HPS.BLL.BillBLL.BLLBill_TFactory Factory = new HPS.BLL.BillBLL.BLLBill_TFactory();
     this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate.ToString());
     this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate.ToString());
 }