Ejemplo n.º 1
0
 public static void SetBillingPeriodValueMethodCmdReferesh(BillingPeriodprop value)
 {
     if (OnSetBillingPeriodValueEvtCmdReferesh != null)
     {
         OnSetBillingPeriodValueEvtCmdReferesh(value);
     }
 }
Ejemplo n.º 2
0
 public static void SetBillingPeriodValueMethod(BillingPeriodprop value)
 {
     if (OnSetBillingPeriodValueEvt != null)
     {
         OnSetBillingPeriodValueEvt(value);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Function to Search the Billing Period List.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>void</returns>
        /// <createdBy></createdBy>
        /// <createdOn>May 20,2016</createdOn>
        public void FindBillingPeriod(object obj)
        {
            CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            try
            {
                if (obj == null)
                {
                    CurrentPageIndex = 0;
                }
                if (CurrentPageIndex == 0)
                {
                    Application.Current.Properties["FindUserGridLastScrollOffset"] = 0;
                    Application.Current.Properties["FindUserGridCurrentPageIndex"] = 0;
                }

                BillingPeriodprop objBillingPeriodprop = new BillingPeriodprop();
                objBillingPeriodprop.CalendarYear     = CalendarYear;
                objBillingPeriodprop.PeriodClosedInd  = PeriodClosedInd;
                objBillingPeriodprop.CurrentPageIndex = CurrentPageIndex;
                objBillingPeriodprop.PageSize         = CurrentPageIndex > 0 ? _gridPageSizeOnScroll : _gridPageSize;;
                objBillingPeriodprop.DefaultPageSize  = _gridPageSize;
                var list = new ObservableCollection <BillingPeriodprop>(_serviceInstance.FindBillingPeriod(objBillingPeriodprop));

                if (CurrentPageIndex == 0)
                {
                    BillingPeriodList = null;
                    BillingPeriodList = new ObservableCollection <BillingPeriodprop>(list);
                }
                else
                {
                    if (BillingPeriodList != null && BillingPeriodList.Count > 0)
                    {
                        foreach (BillingPeriodprop ud in new ObservableCollection <BillingPeriodprop>(list))
                        {
                            BillingPeriodList.Add(ud);
                        }
                    }
                }
            }
            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));
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// This function is used to Delete Billing Period Admin Record
        /// </summary>
        /// <param name="obj"></param>
        public void DeleteBillingPeriodAdminRecord(object obj)
        {
            bool result = false;

            try
            {
                CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));

                MessageBoxResult messageBoxResult = MessageBox.Show(Resources.MsgDeleteConfirm, Resources.msgTitleMessageBoxDelete, MessageBoxButton.YesNo);

                if (messageBoxResult == MessageBoxResult.Yes)
                {
                    BillingPeriodprop objBillingPeriodprop = new BillingPeriodprop();

                    objBillingPeriodprop.BillingPeriodID = BillingPeriodID;

                    result = _serviceInstance.DeleteBillingPeriodAdminDetails(objBillingPeriodprop.BillingPeriodID);

                    if (result)
                    {
                        MessageBox.Show(Resources.msgDeleteSuccessfully, Resources.msgTitleMessageBox);
                        ResetFindBillingPeriodWindow();
                        PeriodNumber      = 0;
                        Text              = Resources.btnSave;
                        EnabledCancel     = false;
                        EnabledDelete     = false;
                        EnabledFind       = true;
                        EnabledModify     = false;
                        EnabledNew        = true;
                        EnabledSaveUpdate = false;
                    }

                    AcceptChanges();
                }
            }
            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));
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// This Function is to bind all field of billing form for modify and delete functionality
        /// </summary>
        /// <param name="billingPeriodInfo"></param>
        public void GetBillingPeriodValue(BillingPeriodprop billingPeriodInfo)
        {
            CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            try
            {
                if (billingPeriodInfo != null)
                {
                    Text                 = Resources.btnUpdate;
                    IsReadOnlyButton     = false;
                    IsReadOnlyButtonSave = false;
                    IsReadOnly           = false;
                    EnabledCancel        = false;
                    EnabledDelete        = false;
                    EnabledFind          = true;
                    EnabledModify        = true;
                    EnabledNew           = true;
                    EnabledSaveUpdate    = false;

                    BillingPeriodID  = billingPeriodInfo.BillingPeriodID;
                    CalendarYear     = billingPeriodInfo.CalendarYear;
                    PeriodNumber     = billingPeriodInfo.PeriodNumber;
                    PeriodClosedInd  = billingPeriodInfo.PeriodClosedInd;
                    PeriodEndDate    = billingPeriodInfo.PeriodEndDate;
                    PeriodClosedBy   = billingPeriodInfo.PeriodClosedBy;
                    PeriodClosedDate = billingPeriodInfo.PeriodClosedDate;
                    CreationDate     = billingPeriodInfo.CreationDate;
                    CreatedBy        = billingPeriodInfo.CreatedBy;
                    UpdatedBy        = billingPeriodInfo.UpdatedBy;
                    UpdatedDate      = billingPeriodInfo.UpdatedDate;
                    IsSelected       = PeriodClosedInd == 0 ? false : true;
                }
            }
            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));
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// This Method to update Billing Period Admin Details
 /// </summary>
 /// <param name="objBillingPeriodprop"></param>
 /// <returns></returns>
 /// <createdOn>May-23,2016</createdOn>
 public bool UpdateBillingPeriodAdminDetails(BillingPeriodprop objBillingPeriodprop)
 {
     try
     {
         CommonDAL.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "Called {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
         BillingDAL objBillingDAL = new BillingDAL();
         return(objBillingDAL.UpdateBillingPeriodAdminDetails(objBillingPeriodprop));
     }
     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));
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// To Find Billing Period Record
        /// </summary>
        /// <param name="objBillingPeriod"></param>
        /// <returns>IList<BillingPeriod></returns>
        /// <createdBy></createdBy>
        /// <createdOn>May-20,2016</createdOn>
        public IList <BillingPeriodprop> FindBillingPeriod(BillingPeriodprop objBillingPeriod)
        {
            IList <BillingPeriodprop> listBillingPeriodprop;
            BillingDAL objBillingDAL = new BillingDAL();  /// Creating The Object of BillingDAL

            CommonDAL.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "Called {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            try
            {
                listBillingPeriodprop = objBillingDAL.FindBillingPeriod(objBillingPeriod); /// sending the new record model to the data access layer.
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                objBillingDAL = null;
                CommonDAL.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "End {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            }
            return(listBillingPeriodprop);
        }
Ejemplo n.º 8
0
        /// <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));
            }
        }