Beispiel #1
0
 public static void SetRateAdminValueMethod(PortStorageRateList value)
 {
     if (OnSetRateAdminValueEvt != null)
     {
         OnSetRateAdminValueEvt(value);
     }
 }
Beispiel #2
0
 void RateAdminDelegate_OnSetRateAdminValueEvt(PortStorageRateList selectedItems)
 {
     CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
     try
     {
         if (selectedItems.PortStorageRatesID > 0)
         {
             EntryFee          = selectedItems.EntryFee;
             PerDiem           = selectedItems.PerDiem;
             PerDiemGraceDays  = selectedItems.PerDiemGraceDays;
             StartDate         = selectedItems.StartDate;
             EndDate           = selectedItems.EndDate;
             PortStorageRateID = selectedItems.PortStorageRatesID;
             UpdatedBy         = selectedItems.UpdatedBy;
             UpdatedDate       = selectedItems.UpdatedDate;
             CreatedBy         = selectedItems.CreatedBy;
             CreationDate      = selectedItems.CreationDate;
             CustomerID        = Convert.ToInt32(selectedItems.CustomerID);
             CustomerName      = selectedItems.CustomerName;
         }
         else
         {
             CustomerID       = Convert.ToInt32(selectedItems.CustomerID);
             EntryFee         = 0;
             PerDiem          = 0;
             PerDiemGraceDays = 0;
             CreatedBy        = Application.Current.Properties["LoggedInUserName"].ToString();
             CreationDate     = DateTime.Now;
             CustomerName     = selectedItems.CustomerName;
         }
     }
     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));
     }
 }
Beispiel #3
0
        /// <summary>
        /// To add the portstoragerate list for a perticular customer.
        /// </summary>
        /// <param name="customerID"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public bool UpdatePortStorageRate(PortStorageRateList portStorageRateProp)
        {
            CustomerDAL objCustomerDAL = new CustomerDAL();

            CommonDAL.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "Called {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            try
            {
                return(objCustomerDAL.UpdatePortStorageRate(portStorageRateProp));
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                CommonDAL.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "End {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            }
        }
Beispiel #4
0
 private void AddPortStorageRate(object obj)
 {
     CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
     try
     {
         var result = false;
         if (PortStorageRateID > 0)
         {
             if (StartDate.Equals(null))
             {
                 MessageBox.Show(Resources.msgStratDateReq);
             }
             else
             {
                 PortStorageRateList objPortStorageRateProp = new PortStorageRateList();
                 objPortStorageRateProp.PortStorageRatesID = PortStorageRateID;
                 objPortStorageRateProp.CustomerID         = CustomerID;
                 objPortStorageRateProp.EntryFee           = EntryFee;
                 objPortStorageRateProp.StartDate          = StartDate;
                 objPortStorageRateProp.EndDate            = EndDate;
                 objPortStorageRateProp.PerDiem            = PerDiem;
                 objPortStorageRateProp.PerDiemGraceDays   = PerDiemGraceDays;
                 objPortStorageRateProp.CreatedBy          = CreatedBy;
                 objPortStorageRateProp.CreationDate       = CreationDate;
                 objPortStorageRateProp.UpdatedDate        = DateTime.Now;
                 objPortStorageRateProp.UpdatedBy          = Application.Current.Properties["LoggedInUserName"].ToString();
                 result = _serviceInstance.UpdatePortStorageRate(objPortStorageRateProp);
                 if (result)
                 {
                     MessageBox.Show(Resources.MsgRecordUpdated);
                     Cancel(null);
                 }
             }
         }
         else
         {
             if (StartDate.Equals(null))
             {
                 MessageBox.Show(Resources.msgStratDateReq);
             }
             else
             {
                 PortStorageRateList objPortStorageRateProp = new PortStorageRateList();
                 objPortStorageRateProp.CustomerID       = CustomerID;
                 objPortStorageRateProp.EntryFee         = EntryFee;
                 objPortStorageRateProp.StartDate        = StartDate;
                 objPortStorageRateProp.EndDate          = EndDate;
                 objPortStorageRateProp.PerDiem          = PerDiem;
                 objPortStorageRateProp.PerDiemGraceDays = PerDiemGraceDays;
                 objPortStorageRateProp.CreatedBy        = Application.Current.Properties["LoggedInUserName"].ToString();
                 objPortStorageRateProp.CreationDate     = DateTime.Now;
                 objPortStorageRateProp.UpdatedDate      = null;
                 objPortStorageRateProp.UpdatedBy        = string.Empty;
                 result = _serviceInstance.AddPortStorageRate(objPortStorageRateProp);
                 if (result)
                 {
                     MessageBox.Show(Resources.msgInsertedSuccessfully);
                     Cancel(null);
                 }
             }
         }
         RateAdminDelegate.SetRateAdminModifiedMethod(result);
     }
     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));
     }
 }