public IList <HREmployeeNoticeEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <HREmployeeNoticeEntity> hREmployeeNoticeEntityList = new List <HREmployeeNoticeEntity>();

            try
            {
                if (pageSize == -1)
                {
                    pageSize = 1000000000;
                }

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeeNoticeEntity.FLD_NAME_EmployeeNoticeID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

                startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1;

                hREmployeeNoticeEntityList = FCCHREmployeeNotice.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

                if (hREmployeeNoticeEntityList != null && hREmployeeNoticeEntityList.Count > 0)
                {
                    totalRowCount = hREmployeeNoticeEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(hREmployeeNoticeEntityList ?? new List <HREmployeeNoticeEntity>());
        }
        private void SaveHREmployeeNoticeEntity()
        {
            if (IsValid)
            {
                try
                {
                    HREmployeeNoticeEntity hREmployeeNoticeEntity = BuildHREmployeeNoticeEntity();

                    Int64 result = -1;

                    if (hREmployeeNoticeEntity.IsNew)
                    {
                        result = FCCHREmployeeNotice.GetFacadeCreate().Add(hREmployeeNoticeEntity, DatabaseOperationType.Add, TransactionRequired.No);
                        SendMail(hREmployeeNoticeEntity);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeNoticeEntity.FLD_NAME_EmployeeNoticeID, hREmployeeNoticeEntity.EmployeeNoticeID.ToString(), SQLMatchType.Equal);
                        result = FCCHREmployeeNotice.GetFacadeCreate().Update(hREmployeeNoticeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeNoticeID       = 0;
                        _HREmployeeNoticeEntity = new HREmployeeNoticeEntity();
                        PrepareInitialView();
                        BindHREmployeeNoticeList();

                        if (hREmployeeNoticeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Notice Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Notice Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (hREmployeeNoticeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Notice Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Notice Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
예제 #3
0
        private void CheckNewNotice()
        {
            Int64  countNewNotice = 0;
            String fe             = "SendToEmployeeID = " + OverviewEmployeeID + " and ViewCount <= 0";
            IList <HREmployeeNoticeEntity> list = FCCHREmployeeNotice.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (list != null && list.Count > 0)
            {
                countNewNotice           = list.Count;
                this.messageDetails.Text = "You have " + countNewNotice + " new Issue send by HR. Please read new issues.";
                this.MPE.Show();
            }
        }
        protected void lvHREmployeeNotice_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeNoticeID;

            Int64.TryParse(e.CommandArgument.ToString(), out EmployeeNoticeID);

            if (EmployeeNoticeID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _EmployeeNoticeID = EmployeeNoticeID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeNoticeEntity.FLD_NAME_EmployeeNoticeID, EmployeeNoticeID.ToString(), SQLMatchType.Equal);

                        HREmployeeNoticeEntity hREmployeeNoticeEntity = new HREmployeeNoticeEntity();


                        result = FCCHREmployeeNotice.GetFacadeCreate().Delete(hREmployeeNoticeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeNoticeID       = 0;
                            _HREmployeeNoticeEntity = new HREmployeeNoticeEntity();
                            PrepareInitialView();
                            BindHREmployeeNoticeList();

                            MiscUtil.ShowMessage(lblMessage, "Employee Notice has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Notice.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
예제 #5
0
        private void PrepareInitialView()
        {
            BuildDropDownList();

            DateTime seenNotice = DateTime.Now.Date;
            Int64    viewCount  = 1;

            HREmployeeNoticeEntity entity = CurrentHREmployeeNoticeEntity;

            lblNoticeTextView.Text = Server.HtmlDecode(CurrentHREmployeeNoticeEntity.Text.ToString());
            if (CurrentHREmployeeNoticeEntity.ViewCount <= 0)
            {
                entity.SeenNotice = seenNotice;
                entity.ViewCount  = viewCount;
                String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeNoticeEntity.FLD_NAME_EmployeeNoticeID, entity.EmployeeNoticeID.ToString(), SQLMatchType.Equal);
                FCCHREmployeeNotice.GetFacadeCreate().Update(entity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
            }
        }
        public IList <HREmployeeNoticeEntity> GetData()
        {
            IList <HREmployeeNoticeEntity> hREmployeeNoticeEntityList = new List <HREmployeeNoticeEntity>();

            try
            {
                hREmployeeNoticeEntityList = FCCHREmployeeNotice.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

                if (hREmployeeNoticeEntityList != null && hREmployeeNoticeEntityList.Count > 0)
                {
                    totalRowCount = hREmployeeNoticeEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(hREmployeeNoticeEntityList ?? new List <HREmployeeNoticeEntity>());
        }
예제 #7
0
        private void GetAllLetters()
        {
            String fe = "SendToEmployeeID = " + OverviewEmployeeID + "";
            IList <HREmployeeNoticeEntity> hREmployeeNoticeList = FCCHREmployeeNotice.GetFacadeCreate().GetIL(1000, 1, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (hREmployeeNoticeList != null && hREmployeeNoticeList.Count > 0)
            {
                foreach (HREmployeeNoticeEntity entity in hREmployeeNoticeList)
                {
                    if (entity.TemplateID == MasterDataConstants.HREmployeeNoticeTemplate.JOINLETTER)
                    {
                        lblJoinLetter.Text += Server.HtmlDecode(entity.Text.ToString()) + "<hr><br/>";
                    }
                    else if (entity.TemplateID == MasterDataConstants.HREmployeeNoticeTemplate.APPOINTMENTLETTER)
                    {
                        lblAppointmentLetter.Text += Server.HtmlDecode(entity.Text.ToString()) + "<hr><br/>";
                    }
                    else if (entity.TemplateID == MasterDataConstants.HREmployeeNoticeTemplate.CHANGEOFDESIGNATIONLETTER)
                    {
                        lblChangeOfDesignationLetter.Text += Server.HtmlDecode(entity.Text.ToString()) + "<hr><br/>";
                    }
                    else if (entity.TemplateID == MasterDataConstants.HREmployeeNoticeTemplate.SALARYENHANCEMENTLETTER)
                    {
                        lblSalaryEnhancementLetter.Text += Server.HtmlDecode(entity.Text.ToString()) + "<hr><br/>";
                    }
                    else if (entity.TemplateID == MasterDataConstants.HREmployeeNoticeTemplate.CONFIRMATIONLETTER)
                    {
                        lblConfirmationLetter.Text += Server.HtmlDecode(entity.Text.ToString()) + "<hr><br/>";
                    }
                    else if (entity.TemplateID == MasterDataConstants.HREmployeeNoticeTemplate.OFFICEMEMO)
                    {
                        lblOfficeMemo.Text += Server.HtmlDecode(entity.Text.ToString()) + "<hr><br/>";
                    }
                }
            }
        }