/// <summary> /// Function to Cancle Find Period Popup & Fill selected to the buffer. /// </summary> /// <param name="obj"></param> /// <returns>void</returns> /// <createdBy></createdBy> /// <createdOn>May 21,2016</createdOn> private void Continue(object obj) { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); try { if (SelectedDisRecipientGridItem != null) { DelegateEventBillingPeriod.SetBillingPeriodValueMethod(SelectedDisRecipientGridItem); //DelegateEventVehicle.SetValueMethodCmd("Add"); OnCloseWindowRequested(); } else { MessageBox.Show(Resources.MsgSelectUser); } } catch (Exception ex) { LogHelper.LogErrorToDb(ex); bool displayErrorOnUI = false; CommonSettings.logger.LogError(this.GetType(), ex); if (displayErrorOnUI) { throw; } } finally { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); } }
///// <summary> ///// Method FillTVehicalRecordStatus to fill the vehicle status dropdown. ///// </summary> ///// <param name="NA"></param> ///// <returns>void</returns> ///// <createdBy></createdBy> ///// <createdOn>Apr-13,2016</createdOn> //public void DriverTypeDdl(object obj) //{ // CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); // try // { // List<string> List = _serviceInstance.DriverList().ToList(); // List.Insert(0, "All"); // DriverList = null; // DriverList = List; // } // catch (Exception ex) // { // bool displayErrorOnUI = false; // CommonSettings.logger.LogError(this.GetType(), ex); // if (displayErrorOnUI) // { throw; } // } // finally // { // CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); // } //} ///// <summary> ///// Method FillTVehicalRecordStatus to fill the vehicle status dropdown. ///// </summary> ///// <param name="NA"></param> ///// <returns>void</returns> ///// <createdBy></createdBy> ///// <createdOn>Apr-13,2016</createdOn> //public void OutsideCarrierDdl(object obj) //{ // CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); // try // { // List<string> List = _serviceInstance.OutsideCarrier().ToList(); // List.Insert(0, "All"); // OutsideCarrierList = null; // OutsideCarrierList = List; // } // catch (Exception ex) // { // bool displayErrorOnUI = false; // CommonSettings.logger.LogError(this.GetType(), ex); // if (displayErrorOnUI) // { throw; } // } // finally // { // CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); // } //} #endregion /// <summary> /// Function to FIll Customer Data on row selection. /// </summary> /// <param name="objLoginProp"></param> /// <returns>void</returns> /// <createdBy></createdBy> /// <createdOn>May 10,2016</createdOn> private void FillData(object obj) { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); try { ObservableCollection <object> objSel = (ObservableCollection <object>)SelectedItems; List <BillingFindVM> objList = new List <BillingFindVM>(); foreach (BillingModel Vl in objSel) { BillingFindVM objBillingFind = new BillingFindVM(null); objBillingFind.BillingID = Vl.BillingID; objBillingFind.CustomerName = Vl.CustomerName; objBillingFind.BillingID = Vl.BillingID; objBillingFind.InvoiceNumber = Vl.InvoiceNumber; objBillingFind.CustomerName = Vl.CustomerName; objBillingFind.CustomerNumber = Vl.CustomerNumber; objBillingFind.Vin = Vl.VIN; objBillingFind.CustIndent = Vl.CustIndent; objBillingFind.InvoiceDate = Vl.InvoiceDate; objBillingFind.InvoiceStatus = Vl.InvoiceStatus; objBillingFind.InvoiceType = Vl.InvoiceType; objBillingFind.Address = Vl.Address; TotalPageCount = Vl.TotalPageCount; objList.Add(objBillingFind); //objBillingFind.Driver = Vl.Driver; //objBillingFind.LoadNumber = Vl.LoadNumber; //objBillingFind.OutsideCarrier = Vl.OutsideCarrier; //objBillingFind.PONumber = Vl.PONumber; //objBillingFind.OrderNumber = Vl.OrderNumber; //objBillingFind.CarrierName = Vl.CarrierName; } DelegateEventBillingPeriod.SetValueListMethod(objList); } catch (Exception ex) { LogHelper.LogErrorToDb(ex); bool displayErrorOnUI = false; CommonSettings.logger.LogError(this.GetType(), ex); if (displayErrorOnUI) { throw; } } finally { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); } }
/// <summary> /// Function to FIll Customer Data on row selection. /// </summary> /// <param name="objLoginProp"></param> /// <returns>void</returns> /// <createdBy></createdBy> /// <createdOn>May 10,2016</createdOn> private void FillData(object obj) { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); try { DelegateEventBillingPeriod.SetBillingPeriodValueMethod(SelectedDisRecipientGridItem); } catch (Exception ex) { LogHelper.LogErrorToDb(ex); bool displayErrorOnUI = false; CommonSettings.logger.LogError(this.GetType(), ex); if (displayErrorOnUI) { throw; } } finally { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); } }
/// <summary> /// Method Continue to get the details of selected item. /// </summary> /// <param name="obj"></param> /// <returns>void</returns> /// <createdBy></createdBy> /// <createdOn>Apr-13,2016</createdOn> public void Continue(object obj) { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); try { if (SelectedItems.Count > 0) { ObservableCollection <object> objSel = (ObservableCollection <object>)SelectedItems; List <BillingFindVM> objList = new List <BillingFindVM>(); foreach (BillingModel Vl in objSel) { BillingFindVM objBillingFind = new BillingFindVM(null); objBillingFind.BillingID = Vl.BillingID; objBillingFind.CustomerName = Vl.CustomerName; objBillingFind.BillingID = Vl.BillingID; objBillingFind.InvoiceNumber = Vl.InvoiceNumber; objBillingFind.CustomerName = Vl.CustomerName; objBillingFind.CustomerNumber = Vl.CustomerNumber; objBillingFind.Vin = Vl.VIN; objBillingFind.CustIndent = Vl.CustIndent; objBillingFind.InvoiceDate = Vl.InvoiceDate; objBillingFind.InvoiceStatus = Vl.InvoiceStatus; objBillingFind.InvoiceType = Vl.InvoiceType; objBillingFind.Address = Vl.Address; TotalPageCount = Vl.TotalPageCount; objList.Add(objBillingFind); //objBillingFind.PONumber = Vl.PONumber; //objBillingFind.OrderNumber = Vl.OrderNumber; //objBillingFind.LoadNumber = Vl.LoadNumber; //objBillingFind.OutsideCarrier = Vl.OutsideCarrier; //objBillingFind.Driver = Vl.Driver; } DelegateEventBillingPeriod.SetValueListMethod(objList); foreach (Window window in Application.Current.Windows) { if (window.Title.Equals("Invoice Record Find", StringComparison.OrdinalIgnoreCase)) { window.Close(); } } } else { MessageBox.Show(Resources.MsgSelectUser); } } catch (Exception ex) { LogHelper.LogErrorToDb(ex); bool displayErrorOnUI = false; CommonSettings.logger.LogError(this.GetType(), ex); if (displayErrorOnUI) { throw; } } finally { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); } }
/// <summary> /// This Method is used to Insert biilling detaills from form /// </summary> /// <param name="obj"></param> public void InsertBillingPeriod(object obj) { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); try { BillingPeriodprop objBillingPeriodprop = new BillingPeriodprop(); objBillingPeriodprop.BillingPeriodID = BillingPeriodID; objBillingPeriodprop.CalendarYear = CalendarYear; objBillingPeriodprop.PeriodNumber = PeriodNumber; objBillingPeriodprop.CreationDate = CreationDate; objBillingPeriodprop.PeriodEndDate = PeriodEndDate; objBillingPeriodprop.PeriodClosedInd = PeriodClosedInd; objBillingPeriodprop.CreatedBy = CreatedBy; if (BillingPeriodID > 0) { objBillingPeriodprop.UpdatedBy = Application.Current.Properties["LoggedInUserName"].ToString(); objBillingPeriodprop.UpdatedDate = DateTime.Now; if (CalendarYear > 0) { if (PeriodNumber > 0) { bool result = _serviceInstance.UpdateBillingPeriodAdminDetails(objBillingPeriodprop); if (result) { MessageBox.Show(Resources.msgUpdatedSuccessfully, Resources.msgTitleMessageBox); DelegateEventBillingPeriod.SetBillingPeriodValueMethodCmdReferesh(objBillingPeriodprop); EnabledCancel = false; EnabledFind = true; EnabledNew = true; EnabledSaveUpdate = false; if (BillingPeriodID > 0) { EnabledModify = true; EnabledDelete = false; } else { EnabledModify = false; EnabledDelete = false; } //ResetFindBillingPeriodWindow(); IsReadOnly = false; IsReadOnlyButton = false; isReadOnlyButtonSave = false; Text = Resources.btnSave; AcceptChanges(); } } else { MessageBox.Show(Resources.msgPeriodNumberReq); } } else { MessageBox.Show(Resources.msgCalanderYearReq); } } else { if (CalendarYear > 0) { if (PeriodNumber > 0) { bool isValid = _serviceInstance.CheckDuplicateCalenderAndPeriod((int)CalendarYear, (int)PeriodNumber); if (isValid) { var data = _serviceInstance.AddBillingPeriod(objBillingPeriodprop); if (data > 0) { BillingPeriodID = data; MessageBox.Show(Resources.msgInsertedSuccessfully); EnabledCancel = false; EnabledFind = true; if (BillingPeriodID > 0) { EnabledModify = true; EnabledDelete = false; } else { EnabledModify = false; EnabledDelete = false; } EnabledNew = true; IsReadOnly = false; IsReadOnlyButton = false; isReadOnlyButtonSave = false; Text = Resources.btnSave; AcceptChanges(); } else { MessageBox.Show(Resources.ErrorInserted); BtnOK = false; } } else { MessageBox.Show(Resources.msgCalanderYearPerodNumberAlredy); } } else { MessageBox.Show(Resources.msgPeriodNumberReq); } } else { MessageBox.Show(Resources.msgCalanderYearReq); } } } catch (Exception ex) { LogHelper.LogErrorToDb(ex); bool displayErrorOnUI = false; CommonSettings.logger.LogError(this.GetType(), ex); if (displayErrorOnUI) { throw; } } finally { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); } }