예제 #1
0
 private void CancelButton_Click(object sender, EventArgs e)
 {
     try
     {
         //ابطال نوبت
         HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory TurnManagementFactory = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory();
         if (TurnManagementGridView.Rows.Count != 0)
         {
             Int64?s = (Int64?)Hepsa.Core.Common.PersentationController.GetEntityValue(this.TurnManagementGridView.CurrentRow.Cells["colTurnManagementID_int"].Value, TypeCode.Int64);
             if (s.HasValue)
             {
                 string    condition = "([TurnManagement_T].[TurnManagementID_int]=" + s.ToString() + ")";
                 DataTable dt        = new DataTable();
                 TurnManagementFactory.GetAllByConditionWithTraffic(condition, ref dt);
                 if (Convert.ToBoolean(dt.Rows[0]["Return_bit"].ToString()) == false && !string.IsNullOrEmpty(Convert.ToString(dt.Rows[0]["TurnCancelCommantID_int"])))
                 {
                     Hepsa.Core.Common.MessageBox.InformationMessage("این نوبت باطل شده است");
                 }
             }
             HPS.BLL.TrafficBLL.BLLTraffic_TKeys TrafficKey = new HPS.BLL.TrafficBLL.BLLTraffic_TKeys();
             TrafficKey.TrafficID_bint = (Int64)Hepsa.Core.Common.PersentationController.GetEntityValue(this.TurnManagementGridView.CurrentRow.Cells[this.colTurnManagementTrafficID_bint.Name].Value, TypeCode.Int64);
             //if (_TurnStatus == 1)
             //{
             TurnManagementEntityForm TurnManagement = new TurnManagementEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.TurnManagementGridView.DataSource, TrafficKey, 0, 0);
             TurnManagement.ShowDialog();
             //}
             //else
             //{
             //    TurnManagementEntityForm TurnManagement = new TurnManagementEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.TurnManagementGridView.DataSource, TrafficKey, 0, null);
             //    TurnManagement.ShowDialog();
             //}
         }
         //HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory TurnManagementFactory = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory();
         //    HPS.BLL.TurnManagementBLL.BLLTurnManagement_T TurnManagementEntity = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_T();
         //TurnManagementEntity.TurnCancelCommantID_int =38;
         //TurnManagementEntity.TurnCancelCommment_nvc = "به دستور مديريت نوبت باطل گرديد";
         //TurnManagementEntity.Return_bit = false;
         //TurnManagementEntity.Date_nvc = TurnManagementFactory.ServerJalaliDate;
         //TurnManagementEntity.Time_nvc = TurnManagementFactory.ServerTime;
         //TurnManagementEntity.UserName_nvc = HPS.Common.CurrentUser.user.UserName_nvc;
         //TurnManagementEntity.TrafficID_bint = (Int64?)TurnManagementGridView.CurrentRow.Cells["TrafficID_bint"].Value;
         //TurnManagementFactory.Insert(TurnManagementEntity);
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
예제 #2
0
 private void NewButton_Click(object sender, EventArgs e)
 {
     try
     {
         HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory TurnManagementFactory = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory();
         if (TurnManagementGridView.Rows.Count != 0)
         {
             Int64?s = (Int64?)Hepsa.Core.Common.PersentationController.GetEntityValue(this.TurnManagementGridView.CurrentRow.Cells["colTurnManagementID_int"].Value, TypeCode.Int64);
             if (s.HasValue)
             {
                 string    condition = "([TurnManagement_T].[TurnManagementID_int]=" + s.ToString() + ")";
                 DataTable dt        = new DataTable();
                 TurnManagementFactory.GetAllByConditionWithTraffic(condition, ref dt);
                 if (Convert.ToBoolean(dt.Rows[0]["Return_bit"].ToString()) == false && !string.IsNullOrEmpty(Convert.ToString(dt.Rows[0]["TurnCancelCommantID_int"])))
                 {
                     Hepsa.Core.Common.MessageBox.InformationMessage("این نوبت باطل شده است");
                 }
             }
             HPS.BLL.TrafficBLL.BLLTraffic_TKeys TrafficKey = new HPS.BLL.TrafficBLL.BLLTraffic_TKeys();
             TrafficKey.TrafficID_bint = (Int64)Hepsa.Core.Common.PersentationController.GetEntityValue(this.TurnManagementGridView.CurrentRow.Cells[this.colTurnManagementTrafficID_bint.Name].Value, TypeCode.Int64);
             if (_TurnStatus == 1)
             {
                 TurnManagementEntityForm TurnManagement = new TurnManagementEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.TurnManagementGridView.DataSource, TrafficKey, 1, Convert.ToInt32(TurnManagementGridView.CurrentRow.Cells[this.colLadBillCreditID_int.Name].Value));
                 TurnManagement.ShowDialog();
             }
             else
             {
                 TurnManagementEntityForm TurnManagement = new TurnManagementEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.TurnManagementGridView.DataSource, TrafficKey, 0, null);
                 TurnManagement.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }