public void GetBy(HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys keys, ref System.Data.DataTable dataTable) { try { _dataObject.SelectByPrimaryKey(keys, ref dataTable); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Delete(HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys keys) { try { _dataObject.Delete(keys); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_T GetBy(HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys keys) { try { return(_dataObject.SelectByPrimaryKey(keys)); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
private void LoadWithoutDriverCardNumber() { HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory DriverSpecificationFactory = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory(); DataTable DriverFieldTable = new DataTable(); DriverSpecificationFactory.SelectByDriverField(_FirstName, _LastName, _NationalCode, ref DriverFieldTable); if (DriverFieldTable != null && DriverFieldTable.Rows.Count > 0) { _DriverSpecificationID = (Int32)DriverFieldTable.Rows[0]["DriverSpecificationID_int"]; Key = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys(); Key.DriverSpecificationID_int = _DriverSpecificationID; DriverCardNumber_nvcTextBox.Text = DriverFieldTable.Rows[0]["DriverCardNumber_nvc"].ToString(); FirstName_nvcTextBox.Text = DriverFieldTable.Rows[0]["FirstName_nvc"].ToString(); LastName_nvcTextBox.Text = DriverFieldTable.Rows[0]["LastName_nvc"].ToString(); NationalCode_intNumericTextBox.Text = DriverFieldTable.Rows[0]["NationalCode_int"].ToString(); licenceNumber_nvcTextBox.Text = DriverFieldTable.Rows[0]["licenceNumber_nvc"].ToString(); LicenceEnd_nvcTextBox.Text = DriverFieldTable.Rows[0]["LicenceEnd_nvc"].ToString(); CarExaminationEndDate_nvcTextBox.Text = DriverFieldTable.Rows[0]["CarExaminationEndDate_nvc"].ToString(); InsuranceEndDate_nvcTextBox.Text = DriverFieldTable.Rows[0]["InsuranceEndDate_nvc"].ToString(); ClassID_intComboBox.SelectedValue = DriverFieldTable.Rows[0]["ClassID_int"]; HealthCardEndDate_nvcTextBox.Text = DriverFieldTable.Rows[0]["HealthCardEndDate_nvc"].ToString(); DriverCardSharjeEndDate_nvcTextBox.Text = DriverFieldTable.Rows[0]["DriverCardSharjeEndDate_nvc"].ToString(); } else { HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); string Condition = "Traffic_T.FirstName_nvc=N'" + _FirstName + "' AND Traffic_T.LastName_nvc=N'" + _LastName + "' AND Traffic_T.NationalCode_int='" + _NationalCode + "'"; List <HPS.BLL.TrafficBLL.BLLTraffic_T> TrafficList = TrafficFactory.GetAllByCondition(Condition); if (TrafficList != null && TrafficList.Count > 0) { DriverCardNumber_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].DriverCardNumber_nvc; FirstName_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].FirstName_nvc; LastName_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].LastName_nvc; NationalCode_intNumericTextBox.Text = Convert.ToString(TrafficList[TrafficList.Count - 1].NationalCode_int); licenceNumber_nvcTextBox.Text = Convert.ToString(TrafficList[TrafficList.Count - 1].licenceNumber_int); } else { HPS.BLL.DriverBLL.BLLDriver_TFactory DriverFactory = new HPS.BLL.DriverBLL.BLLDriver_TFactory(); List <HPS.BLL.DriverBLL.BLLDriver_T> DriverList = DriverFactory.GetAllBy(HPS.BLL.DriverBLL.BLLDriver_T.Driver_TField.DriverCardNumber_nvc, _DriverCardNumber); if (DriverList != null && DriverList.Count > 0) { DriverCardNumber_nvcTextBox.Text = DriverList[0].DriverCardNumber_nvc; FirstName_nvcTextBox.Text = DriverList[0].FirstName_nvc; LastName_nvcTextBox.Text = DriverList[0].LastName_nvc; NationalCode_intNumericTextBox.Text = Convert.ToString(DriverList[0].NationalCode_int); licenceNumber_nvcTextBox.Text = Convert.ToString(DriverList[0].licenceNumber_nvc); } } } }
private void LoadWithDriverCardNumber() { HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory DriverSpecificationFactory = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory(); List <HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_T> DriverSpecificationList = DriverSpecificationFactory.GetAllBy(HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_T.DriverSpecification_TField.NationalCode_int, _NationalCode); if (DriverSpecificationList != null && DriverSpecificationList.Count > 0) { _DriverSpecificationID = DriverSpecificationList[0].DriverSpecificationID_int; Key = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys(); Key.DriverSpecificationID_int = _DriverSpecificationID; DriverCardNumber_nvcTextBox.Text = DriverSpecificationList[0].DriverCardNumber_nvc; FirstName_nvcTextBox.Text = DriverSpecificationList[0].FirstName_nvc; LastName_nvcTextBox.Text = DriverSpecificationList[0].LastName_nvc; NationalCode_intNumericTextBox.Text = Convert.ToString(DriverSpecificationList[0].NationalCode_int); licenceNumber_nvcTextBox.Text = DriverSpecificationList[0].licenceNumber_nvc; LicenceEnd_nvcTextBox.Text = DriverSpecificationList[0].LicenceEnd_nvc; ClassID_intComboBox.SelectedValue = DriverSpecificationList[0].ClassID_int.HasValue?DriverSpecificationList[0].ClassID_int:0; HealthCardEndDate_nvcTextBox.Text = DriverSpecificationList[0].HealthCardEndDate_nvc; DriverCardSharjeEndDate_nvcTextBox.Text = DriverSpecificationList[0].DriverCardSharjeEndDate_nvc; SaveAndCloseButton.Visible = false; } else { Editbutton.Visible = false; HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); List <HPS.BLL.TrafficBLL.BLLTraffic_T> TrafficList = TrafficFactory.GetAllBy(HPS.BLL.TrafficBLL.BLLTraffic_T.Traffic_TField.NationalCode_int, _NationalCode); if (TrafficList != null && TrafficList.Count > 0) { DriverCardNumber_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].DriverCardNumber_nvc; FirstName_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].FirstName_nvc; LastName_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].LastName_nvc; NationalCode_intNumericTextBox.Text = Convert.ToString(TrafficList[TrafficList.Count - 1].NationalCode_int); licenceNumber_nvcTextBox.Text = Convert.ToString(TrafficList[TrafficList.Count - 1].licenceNumber_int); } else { HPS.BLL.DriverBLL.BLLDriver_TFactory DriverFactory = new HPS.BLL.DriverBLL.BLLDriver_TFactory(); List <HPS.BLL.DriverBLL.BLLDriver_T> DriverList = DriverFactory.GetAllBy(HPS.BLL.DriverBLL.BLLDriver_T.Driver_TField.NationalCode_int, _NationalCode); if (DriverList != null && DriverList.Count > 0) { DriverCardNumber_nvcTextBox.Text = DriverList[0].DriverCardNumber_nvc; FirstName_nvcTextBox.Text = DriverList[0].FirstName_nvc; LastName_nvcTextBox.Text = DriverList[0].LastName_nvc; NationalCode_intNumericTextBox.Text = Convert.ToString(DriverList[0].NationalCode_int); licenceNumber_nvcTextBox.Text = Convert.ToString(DriverList[0].licenceNumber_nvc); } } } }
private void LoadWithCarCardNumber() { HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory DriverSpecificationFactory = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory(); List <HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_T> DriverSpecificationList = DriverSpecificationFactory.GetAllBy(HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_T.DriverSpecification_TField.DriverCardNumber_nvc, _DriverCardNumber); DriverSpecificationList = DriverSpecificationFactory.GetAllByCondition(string.Format(" CarCardNumber_nvc={0} ", _CarCardNumber)); if (DriverSpecificationList != null && DriverSpecificationList.Count > 0) { _DriverSpecificationID = DriverSpecificationList[0].DriverSpecificationID_int; Key = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys(); Key.DriverSpecificationID_int = _DriverSpecificationID; CarExaminationEndDate_nvcTextBox.Text = DriverSpecificationList[0].CarExaminationEndDate_nvc; InsuranceEndDate_nvcTextBox.Text = DriverSpecificationList[0].InsuranceEndDate_nvc; SaveAndCloseButton.Visible = false; } else { Editbutton.Visible = false; } }
public void Update(HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_T businessObject, HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys businessObjectKey) { try { if (businessObject.DriverSpecificationID_int == businessObjectKey.DriverSpecificationID_int) { if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueDriverSpecificationID_int") == false) { throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString()); } } else { if (businessObject.IsValid() == false) { throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString()); } } _dataObject.Update(businessObject, businessObjectKey); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public DriverSpecificationEntityForm(Hepsa.Core.PL.BaseEntityParentForm.enmState State, DataTable DataTable, HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys Key) : base(State, DataTable, Key) { InitializeComponent(); }