Ejemplo n.º 1
0
        public IList <HREmployeeEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <HREmployeeEntity> hREmployeeEntityList = new List <HREmployeeEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeeEntity.FLD_NAME_EmployeeID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hREmployeeEntityList = FCCHREmployee.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hREmployeeEntityList ?? new List <HREmployeeEntity>());
        }
Ejemplo n.º 2
0
        private void LoadEmployee(TreeNode parentSubCategory)
        {
            Int64 designationID = Int64.Parse(parentSubCategory.Value);

            String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_DesignationID, designationID.ToString(), SQLMatchType.Equal);
            IList <HREmployeeEntity> childItemCategoryList = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (childItemCategoryList != null && childItemCategoryList.Count > 0)
            {
                foreach (HREmployeeEntity ent in childItemCategoryList)
                {
                    TreeNode childItemCategory = new TreeNode();

                    childItemCategory.Text         = ent.EmployeeCode;
                    childItemCategory.Value        = ent.EmployeeID.ToString();
                    childItemCategory.SelectAction = TreeNodeSelectAction.Select;
                    childItemCategory.ImageUrl     = ImageConstants.EMPLOYEE_IMG;

                    if (ShowCheckBoxesInAllNodes == true || ShowCheckBoxAtLastNode == true)
                    {
                        childItemCategory.ShowCheckBox = true;
                    }

                    parentSubCategory.ChildNodes.Add(childItemCategory);
                }
            }
        }
Ejemplo n.º 3
0
        private void BindList()
        {
            Int64 employeeID = 0;

            String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_MemberID, this.CurrentMember.MemberID.ToString(), SQLMatchType.Equal);
            IList <HREmployeeEntity> lstEmployee = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (lstEmployee != null && lstEmployee.Count > 0)
            {
                employeeID = lstEmployee[0].EmployeeID;
            }

            //if (PageAPType == 0)
            //{
            //    lvAPMemberFeedback.DataSource = APRobot.GetApprovalRequests_DetailedByMember(employeeID);
            //}
            //else if(PageAPType == MasterDataConstants.APFeedback.FEEDBACK_REQUESTED)
            //{
            //    lvAPMemberFeedback.DataSource = APRobot.GetAllApprovalRequests_DetailedToMemberFeedback(employeeID);
            //}
            //else
            //{
            //    lvAPMemberFeedback.DataSource = APRobot.GetApprovalRequests_DetailedByMemberAndStatus(employeeID, PageAPType);
            //}

            lvAPMemberFeedback.DataSource = APRobot.GetMyAPForwardInfo_DetailedByEmployee(employeeID);

            lvAPMemberFeedback.DataBind();
        }
Ejemplo n.º 4
0
        private void GetEmployeeNameAndCode()
        {
            HREmployeeEntity entity = FCCHREmployee.GetFacadeCreate().GetByID(_CurrentEmployeeEvaluatedID);
            HRMemberEntity   ent    = FCCHRMember.GetFacadeCreate().GetByID(entity.MemberID);

            txtEmployeeCode.Text = entity.EmployeeCode;
            txtEmployeeName.Text = ent.FirstName + " " + ent.MiddleName + " " + ent.LastName;
        }
        private void CalculateLeave()
        {
            if (chbxFilter.Checked)
            {
                HREmployeeEntity            hREmployeeEntity      = FCCHREmployee.GetFacadeCreate().GetByID(Int64.Parse(ddlEmployeeID.SelectedValue));
                ACFiscalYearEntity          aCFiscalYearEntity    = FCCACFiscalYear.GetFacadeCreate().GetByID(Int64.Parse(ddlFiscalYearID.SelectedValue));
                MDLeaveCategoryEntity       mDLeaveCategoryEntity = FCCMDLeaveCategory.GetFacadeCreate().GetByID(Int64.Parse(ddlLeaveCategoryID.SelectedValue));
                IList <MDLeavePolicyEntity> mDLeavePolicyList     = FCCMDLeavePolicy.GetFacadeCreate().GetIL(1000, 1, String.Empty, String.Empty, DatabaseOperationType.Load);
                Decimal leaveInDays = 0;
                if (mDLeavePolicyList.Count > 0 && mDLeavePolicyList != null)
                {
                    mDLeavePolicyList[0] = mDLeavePolicyList.Single(x => (x.LeaveCategoryID == mDLeaveCategoryEntity.LeaveCategoryID && x.FiscalYearID == aCFiscalYearEntity.FiscalYearID && x.EmployeeJobTypeID == hREmployeeEntity.EmployeeJobTypeID));

                    if (mDLeavePolicyList[0].LeaveCategoryID == mDLeaveCategoryEntity.LeaveCategoryID && mDLeavePolicyList[0].FiscalYearID == aCFiscalYearEntity.FiscalYearID)
                    {
                        leaveInDays = mDLeavePolicyList[0].LeaveInDays;
                    }

                    if (hREmployeeEntity.EmployeeJobTypeID == MasterDataConstants.MDEmployeeJobType.FULLTIME && hREmployeeEntity.ConfirmDate <= aCFiscalYearEntity.BeginDate)
                    {
                        txtEarnedDays.Text = leaveInDays.ToString().Trim();;
                    }
                    else if (hREmployeeEntity.EmployeeJobTypeID == MasterDataConstants.MDEmployeeJobType.PARTTIMENOTLESS75PERCENT)
                    {
                        txtEarnedDays.Text = leaveInDays.ToString().Trim();
                    }
                    else if (hREmployeeEntity.EmployeeJobTypeID == MasterDataConstants.MDEmployeeJobType.FULLTIME && hREmployeeEntity.ConfirmDate == null)
                    {
                        txtEarnedDays.Text = "0.0";
                    }
                    else if (hREmployeeEntity.EmployeeJobTypeID == MasterDataConstants.MDEmployeeJobType.PARTTIMENOTLESS50PERCENT)
                    {
                        txtEarnedDays.Text = leaveInDays.ToString().Trim();
                    }
                    else if (hREmployeeEntity.EmployeeJobTypeID == MasterDataConstants.MDEmployeeJobType.FULLTIME && (hREmployeeEntity.ConfirmDate <= aCFiscalYearEntity.BeginDate && hREmployeeEntity.ConfirmDate >= aCFiscalYearEntity.EndDate))
                    {
                        DateTime s = aCFiscalYearEntity.EndDate;
                        DateTime e = (DateTime)hREmployeeEntity.ConfirmDate;

                        Decimal Month = s.Subtract(e).Days / (365 / 12);
                        Month = (leaveInDays / 12) * Month;
                        txtEarnedDays.Text = Month.ToString().Trim();;
                    }
                    else
                    {
                        txtEarnedDays.Text = "0";
                    }
                }
                else
                {
                    MiscUtil.ShowMessage(lblMessage, "There is no policy in this fiscal year and may be not active please insert data in Leave Policy.", false);
                }
            }
            else
            {
                txtEarnedDays.Text = String.Empty;
            }
        }
Ejemplo n.º 6
0
        private void SendMail(HREmployeeLeaveApplicationEntity hREmployeeLeaveApplicationEntity)
        {
            HREmployeeLeaveApplicationEntity entity = hREmployeeLeaveApplicationEntity;

            String fe = "EmployeeID = " + entity.BackupEmployeeID + "";
            IList <HREmployee_DetailedEntity> listEmployee = FCCHREmployee_Detailed.GetFacadeCreate().GetIL(1000, 1, String.Empty, fe);
            String EmployeeName     = listEmployee[0].EmployeeFullName;
            String EmployeeCode     = listEmployee[0].EmployeeCode;
            Int64  BackupEmployeeID = (Int64)entity.BackupEmployeeID;


            #region Notice Mail

            String MailBody = String.Empty;
            String Subject  = String.Empty;
            //int count = 0;

            StringBuilder sb = new StringBuilder();

            sb.Append("Dear Sir,");
            sb.Append("<br/>");
            sb.Append("This is a auto generated mail from the ERP.");
            sb.Append("<br/>");
            sb.Append("Employee Name: " + EmployeeName + " Code :" + EmployeeCode + " is going to take " + entity.TotalLeaveDays + " days leave. And you are the back employee or assigned to his/her work. .");
            sb.Append("<br/>");
            sb.Append("Please contact with him/her if you have any problem.");
            sb.Append("<br/>");
            sb.Append("-");
            sb.Append("<br/>");
            sb.Append("Thanks");
            sb.Append("<br/>");
            sb.Append("ERP System");
            MailBody = sb.ToString();
            Subject  = "ERP, Leave";

            String[] sendToMail = new String[1];

            HREmployeeEntity _hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(BackupEmployeeID);

            if (_hREmployeeEntity != null)
            {
                sendToMail[0] = _hREmployeeEntity.PrimaryEmail;
            }

            MiscUtil.SendMail(sendToMail, Subject, MailBody);

            #endregion
        }
Ejemplo n.º 7
0
        public static HREmployeeEntity GetStoreInCharge(Int64 storeID)
        {
            HREmployeeEntity ent = new HREmployeeEntity();

            try
            {
                INVStoreEntity store = FCCINVStore.GetFacadeCreate().GetByID(storeID);

                ent = FCCHREmployee.GetFacadeCreate().GetByID(store.StoreInChargeEmployeeID);
            }
            catch (Exception ex)
            {
            }

            return(ent);
        }
Ejemplo n.º 8
0
        private void BuildDropDownList()
        {
            MiscUtil.PopulateHRMember(ddlPreparedByMemberID, false);

            if (ddlPreparedByMemberID != null && ddlPreparedByMemberID.Items.Count > 0)
            {
                String fe = SqlExpressionBuilder.PrepareFilterExpression(HRMemberEntity.FLD_NAME_MemberID, this.CurrentMember.MemberID.ToString(), SQLMatchType.Equal);
                IList <HREmployeeEntity> lstEmployee = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                if (lstEmployee != null && lstEmployee.Count > 0)
                {
                    ddlPreparedByMemberID.SelectedValue = lstEmployee[0].MemberID.ToString();
                }
            }

            MiscUtil.PopulateMDBOQStatus(ddlBOQStatusID, true);
        }
Ejemplo n.º 9
0
        private void PrepareInitialView()
        {
            BuildDropDownList();

            txtFirstName.Text  = String.Empty;
            txtMiddleName.Text = String.Empty;
            txtLastName.Text   = String.Empty;

            txtEmployeeCode.Text   = String.Empty;
            txtConfirmDate.Text    = String.Empty;
            txtJoinDate.Text       = String.Empty;
            txtDOB.Text            = String.Empty;
            txtPrimaryEmail.Text   = String.Empty;
            txtSecondaryEmail.Text = String.Empty;
            txtInitials.Text       = String.Empty;
            txtSalaryLevel.Text    = String.Empty;

            btnSubmit.Text              = "Add";
            btnAddNew.Visible           = false;
            pnlDiscontinuedDate.Visible = false;


            #region Employee Info

            IList <HREmployeeEntity> lstHREmployee = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, String.Empty, DatabaseOperationType.Load);

            if (lstHREmployee != null && lstHREmployee.Count > 0)
            {
                lblTotalEmployee.Text = lstHREmployee.Count.ToString();

                lblActiveEmployee.Text = (from s in lstHREmployee
                                          where s.EmploymentStatusID == MasterDataConstants.MDEmploymentStatus.ACTIVE
                                          select s).Count().ToString();
            }

            else
            {
                lblTotalEmployee.Text = "0";

                lblActiveEmployee.Text = "0";
            }


            #endregion
        }
Ejemplo n.º 10
0
        public IList <HREmployeeEntity> GetData()
        {
            IList <HREmployeeEntity> hREmployeeEntityList = new List <HREmployeeEntity>();

            try
            {
                hREmployeeEntityList = FCCHREmployee.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hREmployeeEntityList ?? new List <HREmployeeEntity>());
        }
        private DMSFileMovementRegisterEntity BuildDMSFileMovementRegisterEntity()
        {
            DMSFileMovementRegisterEntity dMSFileMovementRegisterEntity = CurrentDMSFileMovementRegisterEntity;

            if (ddlFileTrackingID.Items.Count > 0)
            {
                if (ddlFileTrackingID.SelectedValue == "0")
                {
                }
                else
                {
                    dMSFileMovementRegisterEntity.FileTrackingID = Int64.Parse(ddlFileTrackingID.SelectedValue);
                }
            }

            if (ddlGivenToEmployeeID.Items.Count > 0)
            {
                if (ddlGivenToEmployeeID.SelectedValue == "0")
                {
                }
                else
                {
                    dMSFileMovementRegisterEntity.GivenToEmployeeID = Int64.Parse(ddlGivenToEmployeeID.SelectedValue);
                }
            }

            String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_MemberID, this.CurrentMember.MemberID.ToString(), SQLMatchType.Equal);
            IList <HREmployeeEntity> lstEmployee = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (lstEmployee != null && lstEmployee.Count > 0)
            {
                dMSFileMovementRegisterEntity.GivenByEmployeeID = lstEmployee[0].EmployeeID;
            }

            if (txtMovementDateTime.Text.Trim().IsNotNullOrEmpty())
            {
                dMSFileMovementRegisterEntity.MovementDateTime = MiscUtil.ParseToDateTime(txtMovementDateTime.Text);
            }

            dMSFileMovementRegisterEntity.FileMovementPlace = txtFileMovementPlace.Text.Trim();

            return(dMSFileMovementRegisterEntity);
        }
        private void SendMail(HREmployeeNoticeEntity noticeEntity)
        {
            HREmployeeNoticeEntity entity = noticeEntity;


            #region Notice Mail

            String MailBody = String.Empty;
            String Subject  = String.Empty;

            StringBuilder sb = new StringBuilder();

            sb.Append("Dear Sir,");
            sb.Append("<br/>");
            sb.Append("This is a auto generated mail from the ERP.");
            sb.Append("<br/>");
            sb.Append("A " + entity.Memo + " Have Been send By HR. Please go to your profile and Check " + entity.Memo + ".");
            sb.Append("<br/>");
            sb.Append("-");
            sb.Append("<br/>");
            sb.Append("Thanks");
            sb.Append("<br/>");
            sb.Append("ERP System");
            MailBody = sb.ToString();
            Subject  = "ERP, Notice Reply";

            String[] sendToMail = new String[1];

            HREmployeeEntity _hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(entity.SendToEmployeeID);

            if (_hREmployeeEntity != null)
            {
                sendToMail[0] = _hREmployeeEntity.PrimaryEmail;
            }

            MiscUtil.SendMail(sendToMail, Subject, MailBody);

            #endregion
        }
Ejemplo n.º 13
0
        protected void btnForward_Click(object sender, EventArgs e)
        {
            if (chbxAutoForwardTo.Checked)
            {
                APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.BILL, CMBillID);

                IList <APMemberFeedbackEntity> feedbackList = APRobot.GetAllMemberFeedbacks(aPApprovalProcessEntity.APApprovalProcessID);

                IList <APMemberFeedbackEntity> ordered_list = feedbackList.OrderBy(x => x.SequenceNo).ToList();

                APPanelForwardMemberEntity aPPanelForwardMemberEntity = APRobot.GetAPPanelForwardMemberByID(Int64.Parse(ddlForwardTo.SelectedValue));

                var existsInfo = (from s in ordered_list
                                  where s.EmployeeID.ToString() == aPPanelForwardMemberEntity.EmployeeID.ToString()
                                  select s);

                if (existsInfo != null && existsInfo.Count() > 0)
                {
                    MiscUtil.ShowMessage(lblMessage, "Member Already Exists in the Approval Panel", true);
                    return;
                }

                APMemberFeedbackEntity currentEmployeeInfo = (from r in ordered_list
                                                              where r.EmployeeID.ToString() == MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember).ToString()
                                                              select r).FirstOrDefault();

                if (currentEmployeeInfo != null)
                {
                    ordered_list = (from m in ordered_list
                                    where m.SequenceNo > currentEmployeeInfo.SequenceNo
                                    select m).ToList();



                    APMemberFeedbackEntity aPMemberFeedbackEntity = new APMemberFeedbackEntity();

                    aPMemberFeedbackEntity.APApprovalProcessID      = aPApprovalProcessEntity.APApprovalProcessID;
                    aPMemberFeedbackEntity.DepartmentID             = aPPanelForwardMemberEntity.DepartmentID;
                    aPMemberFeedbackEntity.EmployeeID               = aPPanelForwardMemberEntity.EmployeeID;
                    aPMemberFeedbackEntity.SequenceNo               = currentEmployeeInfo.SequenceNo + 1;
                    aPMemberFeedbackEntity.APFeedbackID             = MasterDataConstants.APFeedback.NOT_YET_REQUESTED;
                    aPMemberFeedbackEntity.FeedbackRequestDate      = DateTime.Now;
                    aPMemberFeedbackEntity.FeedbackLastResponseDate = null;
                    aPMemberFeedbackEntity.FeedbackSubmitDate       = null;
                    aPMemberFeedbackEntity.IsProxyEmployeeEnabled   = false;
                    aPMemberFeedbackEntity.ProxyEmployeeID          = null;

                    Int64 aPMemberFeedbackID = FCCAPMemberFeedback.GetFacadeCreate().Add(aPMemberFeedbackEntity, DatabaseOperationType.Add, TransactionRequired.No);

                    foreach (APMemberFeedbackEntity ent in ordered_list)
                    {
                        String fe = SqlExpressionBuilder.PrepareFilterExpression(APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), SQLMatchType.Equal);
                        ent.SequenceNo += 1;
                        FCCAPMemberFeedback.GetFacadeCreate().Update(ent, fe, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    APRobot.UpdateApprovalProcessFeedback(APMemberFeedbackID, MasterDataConstants.APFeedback.APPROVED, MasterDataConstants.APType.BILL, CMBillID);

                    String remarks = txtRemarks.Text.Trim();

                    if (remarks.IsNullOrEmpty())
                    {
                        remarks = "Approved";
                    }

                    remarks = AddProxyMemberInfo(remarks);

                    APRobot.AddAPMemberFeedbackRemarks(APMemberFeedbackID, remarks);

                    EnableDisableApprovalButtons();

                    MiscUtil.ShowMessage(lblMessage, "You have Approved Successfully", UIConstants.MessageType.GREEN);

                    PrepareInitialView();
                    BindList();
                    RedirectPageToPendingList();
                }
            }

            //Previous Code

            else
            {
                if (ddlRejectTo.Items.Count > 0)
                {
                    APRobot.UpdateMemberFeedbackFeedback(APMemberFeedbackID, MasterDataConstants.APFeedback.FORWARDED);
                    APRobot.UpdateMemberFeedbackLastResponseDate(APMemberFeedbackID, DateTime.Now);

                    String remarks = txtRemarks.Text.Trim();

                    if (remarks.IsNullOrEmpty())
                    {
                        remarks = "Forwarded";
                    }

                    remarks = AddProxyMemberInfo(remarks);

                    Int64 aPMemberFeedbackRemarksID = APRobot.AddAPMemberFeedbackRemarks(APMemberFeedbackID, remarks);

                    Int64 aPPanelForwardMemberID = Int64.Parse(ddlForwardTo.SelectedValue);

                    APPanelForwardMemberEntity aPPanelForwardMemberEntity = APRobot.GetAPPanelForwardMemberByID(aPPanelForwardMemberID);

                    APForwardInfoEntity aPForwardInfoEntity = new APForwardInfoEntity();

                    aPForwardInfoEntity.APMemberFeedbackID        = APMemberFeedbackID;
                    aPForwardInfoEntity.APApprovalProcessID       = APApprovalProcessID;
                    aPForwardInfoEntity.APMemberFeedbackRemarksID = aPMemberFeedbackRemarksID;
                    aPForwardInfoEntity.DepartmentID           = aPPanelForwardMemberEntity.DepartmentID;
                    aPForwardInfoEntity.EmployeeID             = aPPanelForwardMemberEntity.EmployeeID;
                    aPForwardInfoEntity.CommentRequestDate     = DateTime.Now;
                    aPForwardInfoEntity.CommentSubmitDate      = null;
                    aPForwardInfoEntity.APMemberComment        = txtForwardRemarks.Text.Trim();
                    aPForwardInfoEntity.APForwardMemberComment = String.Empty;

                    FCCAPForwardInfo.GetFacadeCreate().Add(aPForwardInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);

                    MiscUtil.ShowMessage(lblMessage, "You have forwarded the thread successfully", UIConstants.MessageType.GREEN);

                    PrepareInitialView();
                    BindList();

                    #region Forwarded Mail

                    String MailBody = String.Empty;
                    String Subject  = String.Empty;

                    StringBuilder sb = new StringBuilder();

                    sb.Append("Dear Sir,");
                    sb.Append("<br/>");
                    sb.Append("This is a auto generated mail from the ERP.");
                    sb.Append("<br/>");
                    sb.Append("A Bill Request is Forwarded Request is waiting for your approval");
                    sb.Append("<br/>");
                    sb.Append("<br/>");
                    sb.Append("-");
                    sb.Append("<br/>");
                    sb.Append("Thanks");
                    sb.Append("<br/>");
                    sb.Append("ERP System");
                    MailBody = sb.ToString();
                    Subject  = "ERP, Bill, Forwarded";
                    MailBody = @"Please note that a Bill is Forwarded.-Thanks ERP System";

                    HREmployeeEntity _hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(aPForwardInfoEntity.EmployeeID);

                    if (_hREmployeeEntity != null)
                    {
                        String[] sendToMail = new String[] { _hREmployeeEntity.PrimaryEmail };
                        MiscUtil.SendMail(sendToMail, Subject, MailBody);
                    }

                    #endregion


                    //RedirectPageToForwardList();
                }
                else
                {
                    MiscUtil.ShowMessage(lblMessage, "Failed to forward", UIConstants.MessageType.RED);
                }
            }
        }
Ejemplo n.º 14
0
        protected void lvOTIssue_Detailed_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                OTIssue_DetailedEntity ent = (OTIssue_DetailedEntity)dataItem.DataItem;

                Label lblIssuePriorityNameLV = (Label)e.Item.FindControl("lblIssuePriorityNameLV");
                Label lblExpectedEndDateLV   = (Label)e.Item.FindControl("lblExpectedEndDateLV");
                Label lblSupervisorAgreedLV  = (Label)e.Item.FindControl("lblSupervisorAgreedLV");

                if (ent.IssuePriorityID == MasterDataConstants.MDIssuePriority.CRITICAL && ent.IssueStatusID != MasterDataConstants.MDIssueStatus.COMPLETED)
                {
                    lblIssuePriorityNameLV.ForeColor = System.Drawing.Color.Red;
                }

                if (ent.IssueStatusID != MasterDataConstants.MDIssueStatus.COMPLETED && ent.ExpectedEndDate < System.DateTime.Now)
                {
                    lblExpectedEndDateLV.ForeColor = System.Drawing.Color.Red;
                }

                if (ent.SupervisorAgreed == false)
                {
                    lblSupervisorAgreedLV.ForeColor = System.Drawing.Color.Red;
                }

                HyperLink  hypEdit              = (HyperLink)e.Item.FindControl("hypEdit");
                HyperLink  hypEditDetails       = (HyperLink)e.Item.FindControl("hypEditDetails");
                HyperLink  hypAddSubIssue       = (HyperLink)e.Item.FindControl("hypAddSubIssue");
                HyperLink  hypAddReferenceIssue = (HyperLink)e.Item.FindControl("hypAddReferenceIssue");
                HyperLink  hypAssignedResource  = (HyperLink)e.Item.FindControl("hypAssignedResource");
                HyperLink  hypIssueReport       = (HyperLink)e.Item.FindControl("hypIssueReport");
                Button     btnCompletedLV       = (Button)e.Item.FindControl("btnCompletedLV");
                LinkButton lnkBtnDelete         = (LinkButton)e.Item.FindControl("lnkBtnDelete");

                //Stopped By Rayan vaiya
                //hypIssueReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.ISSUE_REPORT, UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();

                hypAssignedResource.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTIssueAssignedResource.aspx", string.Empty, UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();

                #region Bind Edit Hyperlink

                switch (PageAPType)
                {
                case MasterDataConstants.IssuePageType.ADHOC_ISSUE:
                    hypEdit.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTAdhocIssue.aspx", string.Empty, "do", "Edit", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                    break;

                case MasterDataConstants.IssuePageType.PROJECT_ADHOC_ISSUE:
                    hypEdit.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTProjectAdhocIssue.aspx", string.Empty, "do", "Edit", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                    break;

                case MasterDataConstants.IssuePageType.MY_ISSUE_LIST:
                    if (ent.ReferenceID != null)
                    {
                        hypEdit.NavigateUrl        = UrlHelper.BuildSecureUrl("~/OT/OTProjectAdhocIssue.aspx", string.Empty, "do", "Edit", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                        hypEditDetails.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTProjectAdhocIssue.aspx", string.Empty, "do", "EditDetails", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                    }
                    else
                    {
                        hypEdit.NavigateUrl        = UrlHelper.BuildSecureUrl("~/OT/OTAdhocIssue.aspx", string.Empty, "do", "Edit", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                        hypEditDetails.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTProjectAdhocIssue.aspx", string.Empty, "do", "EditDetails", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                    }
                    break;
                }

                if (ent.ReferenceID != null)
                {
                    hypEdit.NavigateUrl        = UrlHelper.BuildSecureUrl("~/OT/OTProjectAdhocIssue.aspx", string.Empty, "do", "Edit", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                    hypEditDetails.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTProjectAdhocIssue.aspx", string.Empty, "do", "EditDetails", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                    hypIssueReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTProjectAdhocIssue.aspx", string.Empty, "do", "ViewIssue", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                }
                else
                {
                    hypEdit.NavigateUrl        = UrlHelper.BuildSecureUrl("~/OT/OTAdhocIssue.aspx", string.Empty, "do", "Edit", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                    hypEditDetails.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTAdhocIssue.aspx", string.Empty, "do", "EditDetails", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                    hypIssueReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTAdhocIssue.aspx", string.Empty, "do", "ViewIssue", UrlConstants.OVERVIEW_ISSUE_ID, ent.IssueID.ToString()).ToString();
                }

                #endregion


                #region Link Build Logic

                if (CurrentemployeeID > 0)
                {
                    String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_MemberID, ent.CreatedByMemberID.ToString(), SQLMatchType.Equal);
                    IList <HREmployeeEntity> lstEmployeeEntity = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                    if (CurrentemployeeID == ent.SupervisorEmployeeID ||
                        lstEmployeeEntity[0].EmployeeID == CurrentemployeeID)
                    {
                        hypEdit.Visible             = true;
                        hypEditDetails.Visible      = true;
                        hypAssignedResource.Visible = true;
                        btnCompletedLV.Enabled      = true;
                    }

                    else if (CurrentemployeeID == ent.AssignedToEmployeeID &&
                             CurrentemployeeID != ent.SupervisorEmployeeID &&
                             lstEmployeeEntity[0].EmployeeID != CurrentemployeeID)
                    {
                        hypEdit.Visible             = true;
                        hypEditDetails.Visible      = false;
                        hypAssignedResource.Visible = true;
                        btnCompletedLV.Enabled      = true;
                    }

                    else
                    {
                        hypEdit.Visible             = false;
                        hypEditDetails.Visible      = false;
                        hypAssignedResource.Visible = false;
                        btnCompletedLV.Enabled      = false;
                    }

                    if (CurrentemployeeID == ent.SupervisorEmployeeID ||
                        CurrentemployeeID == lstEmployeeEntity[0].EmployeeID)
                    {
                        lnkBtnDelete.Visible = true;
                    }
                    else
                    {
                        lnkBtnDelete.Visible = false;
                    }
                }

                if (ent.IssueStatusID == MasterDataConstants.MDIssueStatus.COMPLETED)
                {
                    hypEdit.Visible             = false;
                    hypEditDetails.Visible      = false;
                    hypAssignedResource.Visible = false;
                    btnCompletedLV.Enabled      = false;
                }
                #endregion


                //hypAddSubIssue.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTIssueEditor.aspx", string.Empty, "do", "AddSubIssue", "ParentIssueID", ent.IssueID.ToString()).ToString();
                //hypAddReferenceIssue.NavigateUrl = UrlHelper.BuildSecureUrl("~/OT/OTIssueEditor.aspx", string.Empty, "do", "AddReferenceIssue", "ReferenceIssueID", ent.IssueID.ToString()).ToString();

                hypEdit.Target        = "_blank";
                hypIssueReport.Target = "_blank";
            }
        }
        private DMSReferenceLibraryEntity BuildDMSReferenceLibraryEntity()
        {
            DMSReferenceLibraryEntity dMSReferenceLibraryEntity = CurrentDMSReferenceLibraryEntity;

            if (ddlReferenceLibraryCategoryID.Items.Count > 0)
            {
                if (ddlReferenceLibraryCategoryID.SelectedValue == "0")
                {
                }
                else
                {
                    dMSReferenceLibraryEntity.ReferenceLibraryCategoryID = Int64.Parse(ddlReferenceLibraryCategoryID.SelectedValue);
                }
            }

            dMSReferenceLibraryEntity.Url         = txtUrl.Text.Trim();
            dMSReferenceLibraryEntity.Description = txtDescription.Text.Trim();

            #region FileUpload Info

            String HoverImageUrlpath;

            if (fuImageUrl.HasFile == true && dMSReferenceLibraryEntity.FileName.IsNotNullOrEmpty())
            {
                if (File.Exists(Server.MapPath(dMSReferenceLibraryEntity.FileName)))
                {
                    File.Delete(Server.MapPath(dMSReferenceLibraryEntity.FileName));
                }
                HoverImageUrlpath = FileUploadConstants.DMS.DMS_REFERENCE + Guid.NewGuid() + fuImageUrl.FileName;
                fuImageUrl.SaveAs(Server.MapPath(HoverImageUrlpath));
                dMSReferenceLibraryEntity.FileName = HoverImageUrlpath;
            }

            if (dMSReferenceLibraryEntity.FileName.IsNotNullOrEmpty() && fuImageUrl.HasFile == false)
            {
                dMSReferenceLibraryEntity.FileName = dMSReferenceLibraryEntity.FileName;
            }

            if (fuImageUrl.HasFile == false && dMSReferenceLibraryEntity.FileName.IsNullOrEmpty())
            {
                dMSReferenceLibraryEntity.FileName = null;
            }

            if (fuImageUrl.HasFile == true && dMSReferenceLibraryEntity.FileName.IsNullOrEmpty())
            {
                HoverImageUrlpath = FileUploadConstants.DMS.DMS_REFERENCE + Guid.NewGuid() + fuImageUrl.FileName;
                fuImageUrl.SaveAs(Server.MapPath(HoverImageUrlpath));
                dMSReferenceLibraryEntity.FileName = HoverImageUrlpath;
            }

            #endregion

            dMSReferenceLibraryEntity.Extension        = Path.GetExtension(fuImageUrl.FileName);
            dMSReferenceLibraryEntity.Path             = FileUploadConstants.DMS.DMS_REFERENCE + dMSReferenceLibraryEntity.CurrentFileName;
            dMSReferenceLibraryEntity.OriginalFileName = Path.GetFileName(fuImageUrl.FileName);
            dMSReferenceLibraryEntity.CurrentFileName  = Guid.NewGuid().ToString() + Path.GetExtension(fuImageUrl.FileName);
            dMSReferenceLibraryEntity.FileType         = "";

            String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_MemberID, this.CurrentMember.MemberID.ToString(), SQLMatchType.Equal);
            IList <HREmployeeEntity> lstEmployee = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (lstEmployee != null && lstEmployee.Count > 0)
            {
                dMSReferenceLibraryEntity.CreatedByEmployeeID = lstEmployee[0].EmployeeID;
            }


            if (ddlReferencedByEmployeeID.Items.Count > 0)
            {
                if (ddlReferencedByEmployeeID.SelectedValue == "0")
                {
                    dMSReferenceLibraryEntity.ReferencedByEmployeeID = null;
                }
                else
                {
                    dMSReferenceLibraryEntity.ReferencedByEmployeeID = Int64.Parse(ddlReferencedByEmployeeID.SelectedValue);
                }
            }
            dMSReferenceLibraryEntity.Remarks = txtRemarks.Text.Trim();

            return(dMSReferenceLibraryEntity);
        }
        private void GetSalaryLevel()
        {
            HREmployeeEntity entity = FCCHREmployee.GetFacadeCreate().GetByID(Int64.Parse(ddlSendToEmployeeID.SelectedValue));

            txtMemo.Text = entity.SalaryLevel.ToString().Trim();
        }
Ejemplo n.º 17
0
        private void SaveHREmployeeEntity()
        {
            if (IsValid)
            {
                try
                {
                    #region Member

                    HRMemberEntity hRMemberEntity = BuildHRMemberEntity();

                    Int64 result = -1;

                    if (hRMemberEntity.IsNew)
                    {
                        result = FCCHRMember.GetFacadeCreate().Add(hRMemberEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HRMemberEntity.FLD_NAME_MemberID, hRMemberEntity.MemberID.ToString(), SQLMatchType.Equal);
                        result = FCCHRMember.GetFacadeCreate().Update(hRMemberEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    #endregion

                    if (result > 0)
                    {
                        _MemberID       = 0;
                        _HRMemberEntity = new HRMemberEntity();
                    }

                    if (result > 0)
                    {
                        HREmployeeEntity hREmployeeEntity = BuildHREmployeeEntity();

                        Int64 resultC = -1;

                        if (hREmployeeEntity.IsNew)
                        {
                            hREmployeeEntity.MemberID = result;

                            resultC = FCCHREmployee.GetFacadeCreate().Add(hREmployeeEntity, DatabaseOperationType.Add, TransactionRequired.No);
                        }
                        else
                        {
                            String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_EmployeeID, hREmployeeEntity.EmployeeID.ToString(), SQLMatchType.Equal);
                            resultC = FCCHREmployee.GetFacadeCreate().Update(hREmployeeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                        }

                        #region Create Six Task For HR

                        try
                        {
                            StringBuilder xmlStr      = new StringBuilder();
                            Int64         employeeID  = MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember);
                            Int64         referenceID = 49;
                            DateTime      joinDate    = (DateTime)hREmployeeEntity.JoinDate;
                            String        fe          = "DepartmentID = " + MasterDataConstants.MDDepartment.HR_DEPARTMENTID + "";

                            IList <HREmployeeEntity> lst = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                            #region Delete Old Task

                            String filter = "IssueIdentityCategoryID = " + MasterDataConstants.MDIssueIdentityCategory.HRMETTINGWITHEMPLOYEE + " and SupervisorEmployeeID = " + hREmployeeEntity.EmployeeID + "";
                            IList <OTIssueEntity> issueList = FCCOTIssue.GetFacadeCreate().GetIL(null, null, String.Empty, filter, DatabaseOperationType.LoadWithFilterExpression);
                            if (issueList != null && issueList.Count > 0)
                            {
                                OTIssueEntity oTIssueEntity = new OTIssueEntity();
                                FCCOTIssue.GetFacadeCreate().Delete(oTIssueEntity, filter, DatabaseOperationType.Delete, TransactionRequired.No);
                            }

                            #endregion

                            String title = "Employee Name: " + hRMemberEntity.FirstName + " " + hRMemberEntity.MiddleName + " " + hRMemberEntity.LastName + ", Code: " + hREmployeeEntity.EmployeeCode + " join Date: " + hREmployeeEntity.JoinDate + " has metting with you";

                            xmlStr.Append("<m>");
                            if (lst != null && lst.Count > 0)
                            {
                                foreach (HREmployeeEntity e in lst)
                                {
                                    for (int i = 1; i <= 6; i++)
                                    {
                                        String subXmlStr = null;
                                        subXmlStr = subXmlStr + "<i><a>" + title + "</a><b>" + hREmployeeEntity.EmployeeID + "</b><c>" + e.EmployeeID + "</c><d>" + CurrentMember.MemberID + "</d><e>" + referenceID + "</e><f>" + joinDate.AddDays(i * 30) + "</f><g>" + joinDate.AddDays((i * 30) + 1) + "</g></i>";
                                        xmlStr.Append(subXmlStr.ToString());
                                    }
                                }
                            }
                            xmlStr.Append("</m>");

                            FCCBulkInsertXML.GetFacadeCreate().GetIL(xmlStr.ToString(), CommonConstants.CreateSixTaskForHR);

                            MiscUtil.ShowMessage(lblMessage, "Six Task has created for HR Successfully.", false);
                        }
                        catch (Exception ex)
                        {
                            MiscUtil.ShowMessage(lblMessage, "An Error Occoured.", true);
                        }

                        #endregion

                        if (resultC > 0)
                        {
                            _EmployeeID       = 0;
                            _HREmployeeEntity = new HREmployeeEntity();
                            PrepareInitialView();
                            BindHREmployeeList();

                            if (hREmployeeEntity.IsNew)
                            {
                                ResourceEntity resourceEntity = new ResourceEntity();

                                resourceEntity.ReferenceID        = resultC; // means new employee id
                                resourceEntity.ResourceCategoryID = MasterDataConstants.ResourceCategory.EMPLOYEE;

                                FCCResource.GetFacadeCreate().Add(resourceEntity, DatabaseOperationType.Add, TransactionRequired.No);
                            }

                            if (hREmployeeEntity.IsNew)
                            {
                                MiscUtil.ShowMessage(lblMessage, "Employee Information has been added successfully.", false);
                            }
                            else
                            {
                                MiscUtil.ShowMessage(lblMessage, "Employee Information has been updated successfully.", false);
                            }
                        }
                        else
                        {
                            if (hREmployeeEntity.IsNew)
                            {
                                MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Information.", false);
                            }
                            else
                            {
                                MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Information.", false);
                            }
                        }
                    }
                    else
                    {
                        if (hRMemberEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Member Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Member Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 18
0
        private void SaveHREmployeeEntity()
        {
            if (IsValid)
            {
                try
                {
                    #region Member

                    HRMemberEntity hRMemberEntity = BuildHRMemberEntity();

                    Int64 result = -1;

                    if (hRMemberEntity.IsNew)
                    {
                        result = FCCHRMember.GetFacadeCreate().Add(hRMemberEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HRMemberEntity.FLD_NAME_MemberID, hRMemberEntity.MemberID.ToString(), SQLMatchType.Equal);
                        result = FCCHRMember.GetFacadeCreate().Update(hRMemberEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    #endregion

                    if (result > 0)
                    {
                        _MemberID       = 0;
                        _HRMemberEntity = new HRMemberEntity();
                    }

                    if (result > 0)
                    {
                        HREmployeeEntity hREmployeeEntity = BuildHREmployeeEntity();

                        Int64 resultC = -1;

                        if (hREmployeeEntity.IsNew)
                        {
                            hREmployeeEntity.MemberID = result;

                            resultC = FCCHREmployee.GetFacadeCreate().Add(hREmployeeEntity, DatabaseOperationType.Add, TransactionRequired.No);
                        }
                        else
                        {
                            String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_EmployeeID, hREmployeeEntity.EmployeeID.ToString(), SQLMatchType.Equal);
                            resultC = FCCHREmployee.GetFacadeCreate().Update(hREmployeeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                        }



                        if (resultC > 0)
                        {
                            _EmployeeID       = 0;
                            _HREmployeeEntity = new HREmployeeEntity();
                            PrepareEditView();

                            if (hREmployeeEntity.IsNew)
                            {
                                ResourceEntity resourceEntity = new ResourceEntity();

                                resourceEntity.ReferenceID        = resultC; // means new contractor id
                                resourceEntity.ResourceCategoryID = MasterDataConstants.ResourceCategory.EMPLOYEE;

                                FCCResource.GetFacadeCreate().Add(resourceEntity, DatabaseOperationType.Add, TransactionRequired.No);
                            }

                            if (hREmployeeEntity.IsNew)
                            {
                                MiscUtil.ShowMessage(lblMessage, "Employee Information has been added successfully.", false);
                            }
                            else
                            {
                                MiscUtil.ShowMessage(lblMessage, "Employee Information has been updated successfully.", false);
                            }
                        }
                        else
                        {
                            if (hREmployeeEntity.IsNew)
                            {
                                MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Information.", false);
                            }
                            else
                            {
                                MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Information.", false);
                            }
                        }
                    }
                    else
                    {
                        if (hRMemberEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Member Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Member Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 19
0
        protected void lvHREmployee_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeID;

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

            if (EmployeeID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _EmployeeID = EmployeeID;
                    _MemberID   = CurrentHREmployeeEntity.MemberID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        HREmployeeEntity tempEmployee = FCCHREmployee.GetFacadeCreate().GetByID(EmployeeID);

                        #region Resource Delete

                        Int64 resultOne = -1;

                        String fe1_re = SqlExpressionBuilder.PrepareFilterExpression(ResourceEntity.FLD_NAME_ReferenceID, EmployeeID.ToString(), SQLMatchType.Equal);
                        String fe2_re = SqlExpressionBuilder.PrepareFilterExpression(ResourceEntity.FLD_NAME_ResourceCategoryID, MasterDataConstants.ResourceCategory.EMPLOYEE.ToString(), SQLMatchType.Equal);
                        String fe_re  = SqlExpressionBuilder.PrepareFilterExpression(fe1_re, SQLJoinType.AND, fe2_re);

                        IList <ResourceEntity> resourceList = FCCResource.GetFacadeCreate().GetIL(null, null, String.Empty, fe_re, DatabaseOperationType.LoadWithFilterExpression);

                        foreach (ResourceEntity ent in resourceList)
                        {
                            String fe_re_delete = SqlExpressionBuilder.PrepareFilterExpression(ResourceEntity.FLD_NAME_ResourceID, ent.ResourceID.ToString(), SQLMatchType.Equal);

                            resultOne = FCCResource.GetFacadeCreate().Delete(ent, fe_re_delete, DatabaseOperationType.Delete, TransactionRequired.No);
                        }

                        #endregion

                        #region Employee Delete

                        Int64 resultTwo = -1;

                        if (resultOne == 0)
                        {
                            String fe_con_delete = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_EmployeeID, EmployeeID.ToString(), SQLMatchType.Equal);

                            HREmployeeEntity hREmployeeEntity = new HREmployeeEntity();

                            resultTwo = FCCHREmployee.GetFacadeCreate().Delete(hREmployeeEntity, fe_con_delete, DatabaseOperationType.Delete, TransactionRequired.No);
                        }

                        #endregion

                        #region Member Delete

                        Int64 resultThree = -1;

                        if (resultTwo == 0)
                        {
                            String fe_mem_delete = SqlExpressionBuilder.PrepareFilterExpression(HRMemberEntity.FLD_NAME_MemberID, tempEmployee.MemberID.ToString(), SQLMatchType.Equal);

                            HRMemberEntity hRMemberEntity = new HRMemberEntity();

                            resultThree = FCCHRMember.GetFacadeCreate().Delete(hRMemberEntity, fe_mem_delete, DatabaseOperationType.Delete, TransactionRequired.No);
                        }

                        #endregion

                        if (resultOne == 0 && resultTwo == 0 && resultThree == 0)
                        {
                            _EmployeeID       = 0;
                            _HREmployeeEntity = new HREmployeeEntity();
                            _MemberID         = 0;
                            _HRMemberEntity   = new HRMemberEntity();

                            PrepareInitialView();
                            BindHREmployeeList();

                            MiscUtil.ShowMessage(lblMessage, "Employee has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Ejemplo n.º 20
0
        private DMSFileTrackingEntity BuildDMSFileTrackingEntity()
        {
            DMSFileTrackingEntity dMSFileTrackingEntity = CurrentDMSFileTrackingEntity;

            dMSFileTrackingEntity.FileNo   = txtFileNo.Text.Trim();
            dMSFileTrackingEntity.FileName = txtFileName.Text.Trim();
            if (ddlDepartmentID.Items.Count > 0)
            {
                if (ddlDepartmentID.SelectedValue == "0")
                {
                }
                else
                {
                    dMSFileTrackingEntity.DepartmentID = Int64.Parse(ddlDepartmentID.SelectedValue);
                }
            }

            String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_MemberID, this.CurrentMember.MemberID.ToString(), SQLMatchType.Equal);
            IList <HREmployeeEntity> lstEmployee = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (lstEmployee != null && lstEmployee.Count > 0)
            {
                dMSFileTrackingEntity.CreatedByEmployeeID = lstEmployee[0].EmployeeID;
            }

            if (txtCreatedDateTime.Text.Trim().IsNotNullOrEmpty())
            {
                dMSFileTrackingEntity.CreatedDateTime = MiscUtil.ParseToDateTime(txtCreatedDateTime.Text);
            }

            dMSFileTrackingEntity.FileParmanentPlace = txtFileParmanentPlace.Text.Trim();
            dMSFileTrackingEntity.FileCurrentPlace   = txtFileCurrentPlace.Text.Trim();

            #region File Upload

            String HoverImageUrlpath;

            if (fuImageUrl.HasFile == true && dMSFileTrackingEntity.SoftFileName.IsNotNullOrEmpty())
            {
                if (File.Exists(Server.MapPath(dMSFileTrackingEntity.SoftFileName)))
                {
                    File.Delete(Server.MapPath(dMSFileTrackingEntity.SoftFileName));
                }
                HoverImageUrlpath = FileUploadConstants.DMS.FILE + Guid.NewGuid() + fuImageUrl.FileName;
                fuImageUrl.SaveAs(Server.MapPath(HoverImageUrlpath));
                dMSFileTrackingEntity.SoftFileName = HoverImageUrlpath;
            }

            if (dMSFileTrackingEntity.SoftFileName.IsNotNullOrEmpty() && fuImageUrl.HasFile == false)
            {
                dMSFileTrackingEntity.SoftFileName = dMSFileTrackingEntity.SoftFileName;
            }

            if (fuImageUrl.HasFile == false && dMSFileTrackingEntity.SoftFileName.IsNullOrEmpty())
            {
                dMSFileTrackingEntity.SoftFileName = null;
            }

            if (fuImageUrl.HasFile == true && dMSFileTrackingEntity.SoftFileName.IsNullOrEmpty())
            {
                HoverImageUrlpath = FileUploadConstants.DMS.FILE + Guid.NewGuid() + fuImageUrl.FileName;
                fuImageUrl.SaveAs(Server.MapPath(HoverImageUrlpath));
                dMSFileTrackingEntity.SoftFileName = HoverImageUrlpath;
            }

            #endregion

            dMSFileTrackingEntity.Extension = Path.GetExtension(fuImageUrl.FileName);

            if (dMSFileTrackingEntity.CurrentFileName != null)
            {
                dMSFileTrackingEntity.Path = FileUploadConstants.DMS.FILE + dMSFileTrackingEntity.CurrentFileName;
            }
            else
            {
                dMSFileTrackingEntity.Path = null;
            }
            dMSFileTrackingEntity.OriginalFileName = Path.GetFileName(fuImageUrl.FileName);
            dMSFileTrackingEntity.CurrentFileName  = Guid.NewGuid().ToString() + Path.GetExtension(fuImageUrl.FileName);
            dMSFileTrackingEntity.FileType         = "";

            return(dMSFileTrackingEntity);
        }
Ejemplo n.º 21
0
        protected void lvHREmployeeEvaluation_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                HREmployeeEvaluationIndividual_CustomEntity ent = (HREmployeeEvaluationIndividual_CustomEntity)dataItem.DataItem;

                HyperLink hypBtnDoEvaluation      = (HyperLink)e.Item.FindControl("hypBtnDoEvaluation");
                HyperLink hypReport               = (HyperLink)e.Item.FindControl("hypReport");
                Label     lblRequestInfo          = (Label)e.Item.FindControl("lblRequestInfo");
                Label     lblEmployeeSubmitInfo   = (Label)e.Item.FindControl("lblEmployeeSubmitInfo");
                Label     lblSupervisorSubmitInfo = (Label)e.Item.FindControl("lblSupervisorSubmitInfo");
                HyperLink hypBtnDoHREvaluation    = (HyperLink)e.Item.FindControl("hypBtnDoHREvaluation");
                HyperLink hypHRReport             = (HyperLink)e.Item.FindControl("hypHRReport");


                String sname = "Employee";

                if (ent.SupervisorEmployeeID == MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember))
                {
                    sname = "Supervisor";
                }

                if (!ent.EmployeeSubmitDate.HasValue && !ent.SupervisorSubmitDate.HasValue)
                {
                    lblRequestInfo.Text = "Requested Only";
                }

                #region SupervisorSubmited or not

                if (!ent.SupervisorSubmitDate.HasValue && ent.SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.PBR)
                {
                    lblRequestInfo.Text = "Supervisor Please Submit your marks";
                }

                #endregion

                if (ent.EmployeeSubmitDate.HasValue)
                {
                    lblEmployeeSubmitInfo.Text = "<br/>Employee Submitted";
                }

                if (ent.SupervisorSubmitDate.HasValue)
                {
                    lblSupervisorSubmitInfo.Text = "<br/>Supervisor Submitted";
                }

                if (PageAPType == MasterDataConstants.MDEvaluationSessionCategory.HEALTH_CHECKUP)
                {
                    hypBtnDoEvaluation.Text = "Give Answer";
                }

                //hypBtnDoHREvaluation.NavigateUrl = UrlHelper.BuildSecureUrl("~/HR/HREmployeeEvaluationReport.aspx", string.Empty, "do", sname, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString(), UrlConstants.OVERVIEW_EMPLOYEE_ID, ent.EmployeeID.ToString()).ToString();
                //hypHRReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.HR_EMPLOYEE_EVALUATIONREPORT_REPORT, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString(), UrlConstants.OVERVIEW_EMPLOYEE_ID, ent.EmployeeID.ToString()).ToString();
                hypReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.HR_EMPLOYEE_EVALUATION_REPORT, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString(), UrlConstants.OVERVIEW_EMPLOYEE_ID, ent.EmployeeID.ToString()).ToString();

                lblEmployeeSubmitInfo.Visible = false;
                hypBtnDoHREvaluation.Visible  = false;
                hypHRReport.Visible           = false;
                #region IsSupervisor

                Int64            supervisorID      = MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember);
                HREmployeeEntity currentHREmployee = FCCHREmployee.GetFacadeCreate().GetByID(supervisorID);
                if (ent.SupervisorEmployeeID == supervisorID && ent.SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.PBR || CurrentMember.MemberID == 25 || CurrentMember.MemberID == 182 || CurrentMember.MemberID == 317 || CurrentMember.MemberID == 20520 || CurrentMember.MemberID == 27 || CurrentMember.MemberID == 181)
                {
                    //hypReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.HR_EMPLOYEE_EVALUATION_REPORT, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString(), UrlConstants.OVERVIEW_EMPLOYEE_ID, ent.EmployeeID.ToString()).ToString();
                    hypBtnDoEvaluation.NavigateUrl = UrlHelper.BuildSecureUrl("~/HR/HREmployeeEvaluationMigration.aspx", string.Empty, "do", sname, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString(), UrlConstants.OVERVIEW_EMPLOYEE_ID, ent.EmployeeID.ToString(), UrlConstants.OVERVIEW_SUEPRVISOR_EMPLOYEE_ID, ent.SupervisorEmployeeID.ToString()).ToString();
                }
                else if (ent.SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.PBR)
                {
                    //hypReport.Enabled = false;
                    hypBtnDoEvaluation.Enabled = false;
                    chbxShowAll.Visible        = false;
                }
                else
                {
                    //hypReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.HR_EMPLOYEE_EVALUATION_REPORT, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString(), UrlConstants.OVERVIEW_EMPLOYEE_ID, ent.EmployeeID.ToString()).ToString();
                    hypBtnDoEvaluation.NavigateUrl = UrlHelper.BuildSecureUrl("~/HR/HREmployeeEvaluationMigration.aspx", string.Empty, "do", sname, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString(), UrlConstants.OVERVIEW_EMPLOYEE_ID, ent.EmployeeID.ToString(), UrlConstants.OVERVIEW_SUEPRVISOR_EMPLOYEE_ID, ent.SupervisorEmployeeID.ToString()).ToString();
                }
                if (CurrentMember.MemberID == 182 || CurrentMember.MemberID == 25 || CurrentMember.MemberID == 317 || CurrentMember.MemberID == 20520 || CurrentMember.MemberID == 27 || CurrentMember.MemberID == 181)
                {
                    chbxShowAll.Visible = true;
                }

                if ((CurrentMember.MemberID == 182 || CurrentMember.MemberID == 25 || CurrentMember.MemberID == 317 || CurrentMember.MemberID == 20520 || CurrentMember.MemberID == 27 || CurrentMember.MemberID == 181) && ent.SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.PBR)
                {
                    hypBtnDoHREvaluation.Visible     = true;
                    hypHRReport.Visible              = true;
                    hypBtnDoHREvaluation.NavigateUrl = UrlHelper.BuildSecureUrl("~/HR/HREmployeeEvaluationReport.aspx", string.Empty, "do", sname, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString(), UrlConstants.OVERVIEW_EMPLOYEE_ID, ent.EmployeeID.ToString()).ToString();
                    hypHRReport.NavigateUrl          = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.HR_EMPLOYEE_EVALUATIONREPORT_REPORT, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString(), UrlConstants.OVERVIEW_EMPLOYEE_ID, ent.EmployeeID.ToString()).ToString();
                }
                else
                {
                    hypBtnDoHREvaluation.Enabled = false;
                    hypHRReport.Enabled          = false;
                }

                hypReport.Target            = "_blank";
                hypBtnDoEvaluation.Target   = "_blank";
                hypBtnDoHREvaluation.Target = "_blank";
                hypHRReport.Target          = "_blank";
                #endregion IsSuperviosr
            }
        }
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            btnApprove.Enabled = false;

            APRobot.UpdateApprovalProcessFeedback(APMemberFeedbackID, MasterDataConstants.APFeedback.APPROVED, MasterDataConstants.APType.AGREEMENT, OverviewAgreementID);

            String remarks = txtRemarks.Text.Trim();

            if (remarks.IsNullOrEmpty())
            {
                remarks = "Approved";
            }

            remarks = AddProxyMemberInfo(remarks);

            APRobot.AddAPMemberFeedbackRemarks(APMemberFeedbackID, remarks);

            EnableDisableApprovalButtons();

            MiscUtil.ShowMessage(lblMessage, "You Have Approved Successfully", UIConstants.MessageType.GREEN);

            String fe = SqlExpressionBuilder.PrepareFilterExpression(APForwardInfoEntity.FLD_NAME_APMemberFeedbackID, APMemberFeedbackID.ToString(), SQLMatchType.Equal);
            IList <APForwardInfoEntity> lstForwardedInfo = FCCAPForwardInfo.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (lstForwardedInfo != null && lstForwardedInfo.Count > 0)
            {
                #region Forwarded Reply Mail

                String MailBody = String.Empty;
                String Subject  = String.Empty;

                StringBuilder sb = new StringBuilder();

                sb.Append("Dear Sir,");
                sb.Append("<br/>");
                sb.Append("This is a auto generated mail from the ERP.");
                sb.Append("<br/>");
                sb.Append("A Forwarded Requisition is Processed By Senior");
                sb.Append("<br/>");
                sb.Append("-");
                sb.Append("<br/>");
                sb.Append("Thanks");
                sb.Append("<br/>");
                sb.Append("ERP System");
                MailBody = sb.ToString();
                Subject  = "ERP, Requsition, Forwarded Reply";

                String[] sendToMail = new String[lstForwardedInfo.Count];

                Int64 count = 0;

                foreach (APForwardInfoEntity aPForwardInfoEntity in lstForwardedInfo)
                {
                    HREmployeeEntity _hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(aPForwardInfoEntity.EmployeeID);

                    if (_hREmployeeEntity != null)
                    {
                        sendToMail[count] = _hREmployeeEntity.PrimaryEmail;
                        count++;
                    }
                }

                MiscUtil.SendMail(sendToMail, Subject, MailBody);

                #endregion
            }

            PrepareInitialView();
            BindList();
            RedirectPageToPendingList();
        }
Ejemplo n.º 23
0
        private void SaveOTIssueEntity()
        {
            if (IsValid)
            {
                try
                {
                    OTIssueEntity oTIssueEntity = BuildOTIssueEntity();

                    Int64 result = -1;

                    if (oTIssueEntity.IsNew)
                    {
                        result = FCCOTIssue.GetFacadeCreate().Add(oTIssueEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(OTIssueEntity.FLD_NAME_IssueID, oTIssueEntity.IssueID.ToString(), SQLMatchType.Equal);
                        result = FCCOTIssue.GetFacadeCreate().Update(oTIssueEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        if (oTIssueEntity.IsNew)
                        {
                            #region Send Notification

                            String   mailSubject = String.Empty;
                            String   mailBody    = String.Empty;
                            String[] mailTo      = new String[1];
                            String   fe          = SqlExpressionBuilder.PrepareFilterExpression("OTIssue." + OTIssueEntity.FLD_NAME_IssueID, result.ToString(), SQLMatchType.Equal);
                            IList <OTIssue_DetailedEntity> lstOTIssueEntity = FCCOTIssue_Detailed.GetFacadeCreate().GetIL(10000, 1, String.Empty, fe);

                            if (lstOTIssueEntity != null && lstOTIssueEntity.Count > 0)
                            {
                                mailSubject = lstOTIssueEntity[0].Title.ToString() + "-" + lstOTIssueEntity[0].SupervisorFullName;
                                mailBody    = lstOTIssueEntity[0].Description.ToString();
                                mailBody   += "<br/>";
                                mailBody   += "<br/>";
                                mailBody   += "Expected Start Date: " + lstOTIssueEntity[0].ExpectedStartDate.ToString(UIConstants.SHORT_DATE_FORMAT);
                                mailBody   += "<br/>";
                                mailBody   += "Expected End Date: " + lstOTIssueEntity[0].ExpectedEndDate.ToString(UIConstants.SHORT_DATE_FORMAT);

                                HREmployeeEntity hREmployeeEntitiy = FCCHREmployee.GetFacadeCreate().GetByID(lstOTIssueEntity[0].AssignedToEmployeeID);

                                if (hREmployeeEntitiy != null && hREmployeeEntitiy.EmployeeID > 0)
                                {
                                    mailTo[0] = hREmployeeEntitiy.PrimaryEmail;
                                    MiscUtil.SendMail(mailTo, mailSubject, mailBody);
                                }
                            }

                            #endregion

                            _IssueID       = 0;
                            _OTIssueEntity = new OTIssueEntity();
                            PrepareInitialView();

                            MiscUtil.ShowMessage(lblMessage, "Issue Information has been added successfully.", false);

                            String NavigationUrl = UrlHelper.BuildSecureUrl("~/OT/OTIssueAssignedResource.aspx", string.Empty, UrlConstants.OVERVIEW_ISSUE_ID, result.ToString()).ToString();
                            Response.Redirect(NavigationUrl);
                        }
                        else
                        {
                            PrepareInitialView();
                            PrepareEditView();

                            MiscUtil.ShowMessage(lblMessage, "Issue Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (oTIssueEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Issue Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Issue Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 24
0
        protected void btnSendMailToGuest_Click(object sender, EventArgs e)
        {
            //Mail will implement here.

            #region Guest Invitation Mail

            CMNEventEntity cMNEventEntity = FCCCMNEvent.GetFacadeCreate().GetByID(OverviewEventID);

            String MailBody = String.Empty;
            String Subject  = String.Empty;

            StringBuilder sb = new StringBuilder();

            sb.Append("Dear Sir,");
            sb.Append("<br/>");
            sb.Append("This is a auto generated mail from the ERP.");
            sb.Append("<br/>");
            sb.Append("An Event has created.");
            sb.Append("<br/>");
            sb.Append("Dated : " + cMNEventEntity.ExpectedStartDate.ToString(UIConstants.SHORT_DATE_FORMAT));
            sb.Append("<br/>");
            sb.Append("-");
            sb.Append("<br/>");
            sb.Append("Thanks");
            sb.Append("<br/>");
            sb.Append("ERP System");
            MailBody = sb.ToString();
            Subject  = "ERP, Event";

            String fe1 = SqlExpressionBuilder.PrepareFilterExpression(CMNEventInvitationInformationEntity.FLD_NAME_EventID, OverviewEventID.ToString(), SQLMatchType.Equal);
            String fe2 = SqlExpressionBuilder.PrepareFilterExpression(CMNEventInvitationInformationEntity.FLD_NAME_EventInvitatedPersonTypeID, MasterDataConstants.EventInvitationPersonType.GUEST.ToString(), SQLMatchType.Equal);
            String fe  = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);

            IList <CMNEventInvitationInformationEntity> lstEventInvitationInformationEntity = FCCCMNEventInvitationInformation.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (lstEventInvitationInformationEntity != null && lstEventInvitationInformationEntity.Count > 0)
            {
                String[] sendToMail = new String[10]; // Should change here.
                Int64    i          = 0;

                foreach (CMNEventInvitationInformationEntity ent in lstEventInvitationInformationEntity)
                {
                    HRMemberEntity hRMemberEntity = FCCHRMember.GetFacadeCreate().GetByID(ent.InitationGivenToMemberID);

                    if (hRMemberEntity != null && hRMemberEntity.MemberID > 0)
                    {
                        switch (hRMemberEntity.MemberTypeID)
                        {
                        case MasterDataConstants.MemberType.HR_MEMBER:

                            String fe_member = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_MemberID, ent.InitationGivenToMemberID.ToString(), SQLMatchType.Equal);
                            IList <HREmployeeEntity> lsthREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe_member, DatabaseOperationType.LoadWithFilterExpression);

                            if (lsthREmployeeEntity != null && lsthREmployeeEntity.Count > 0)
                            {
                                sendToMail[i++] = lsthREmployeeEntity[0].PrimaryEmail;
                            }
                            break;

                        //Will Implement Later on...
                        case MasterDataConstants.MemberType.CONSULATANT:
                            break;
                            //case MasterDataConstants.MemberType.CONSULATANT:
                            //    break;
                        }
                    }
                }

                MiscUtil.SendMail(sendToMail, Subject, MailBody);
            }

            #endregion
        }
        private HREmployeeSupervisorMapEntity BuildHREmployeeSupervisorMapEntity()
        {
            HREmployeeSupervisorMapEntity hREmployeeSupervisorMapEntity = CurrentHREmployeeSupervisorMapEntity;

            if (ddlSessionCategoryID.Items.Count > 0)
            {
                if (ddlSessionCategoryID.SelectedValue == "0")
                {
                }
                else
                {
                    hREmployeeSupervisorMapEntity.SessionCategoryID = Int64.Parse(ddlSessionCategoryID.SelectedValue);
                }
            }

            if (ddlEmployeeID.Items.Count > 0)
            {
                if (ddlEmployeeID.SelectedValue == "0")
                {
                }
                else
                {
                    hREmployeeSupervisorMapEntity.EmployeeID = Int64.Parse(ddlEmployeeID.SelectedValue);

                    HREmployeeEntity hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(hREmployeeSupervisorMapEntity.EmployeeID);
                    if (hREmployeeEntity != null && hREmployeeEntity.EmployeeID > 0)
                    {
                        hREmployeeSupervisorMapEntity.EmployeeCode = hREmployeeEntity.EmployeeCode;
                    }
                }
            }


            if (ddlSupervisorTypeID.Items.Count > 0)
            {
                if (ddlSupervisorTypeID.SelectedValue == "0")
                {
                }
                else
                {
                    hREmployeeSupervisorMapEntity.SupervisorTypeID = Int64.Parse(ddlSupervisorTypeID.SelectedValue);
                }
            }

            if (ddlSupervisorEmployeeID.Items.Count > 0)
            {
                if (ddlSupervisorEmployeeID.SelectedValue == "0")
                {
                }
                else
                {
                    hREmployeeSupervisorMapEntity.SupervisorEmployeeID = Int64.Parse(ddlSupervisorEmployeeID.SelectedValue);
                    HREmployeeEntity hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(hREmployeeSupervisorMapEntity.SupervisorEmployeeID);
                    if (hREmployeeEntity != null && hREmployeeEntity.EmployeeID > 0)
                    {
                        hREmployeeSupervisorMapEntity.SupervisorEmployeeCode = hREmployeeEntity.EmployeeCode;
                    }
                }
            }

            hREmployeeSupervisorMapEntity.Remarks    = txtRemarks.Text.Trim();
            hREmployeeSupervisorMapEntity.CreateDate = System.DateTime.Now;

            return(hREmployeeSupervisorMapEntity);
        }
        protected void btnForward_Click(object sender, EventArgs e)
        {
            btnForward.Enabled = false;

            if (ddlRejectTo.Items.Count > 0)
            {
                APRobot.UpdateMemberFeedbackFeedback(APMemberFeedbackID, MasterDataConstants.APFeedback.FORWARDED);
                APRobot.UpdateMemberFeedbackLastResponseDate(APMemberFeedbackID, DateTime.Now);

                String remarks = txtRemarks.Text.Trim();

                if (remarks.IsNullOrEmpty())
                {
                    remarks = "Forwarded";
                }

                remarks = AddProxyMemberInfo(remarks);

                Int64 aPMemberFeedbackRemarksID = APRobot.AddAPMemberFeedbackRemarks(APMemberFeedbackID, remarks);

                Int64 aPPanelForwardMemberID = Int64.Parse(ddlForwardTo.SelectedValue);

                APPanelForwardMemberEntity aPPanelForwardMemberEntity = APRobot.GetAPPanelForwardMemberByID(aPPanelForwardMemberID);

                APForwardInfoEntity aPForwardInfoEntity = new APForwardInfoEntity();

                aPForwardInfoEntity.APMemberFeedbackID        = APMemberFeedbackID;
                aPForwardInfoEntity.APApprovalProcessID       = APApprovalProcessID;
                aPForwardInfoEntity.APMemberFeedbackRemarksID = aPMemberFeedbackRemarksID;
                aPForwardInfoEntity.DepartmentID           = aPPanelForwardMemberEntity.DepartmentID;
                aPForwardInfoEntity.EmployeeID             = aPPanelForwardMemberEntity.EmployeeID;
                aPForwardInfoEntity.CommentRequestDate     = DateTime.Now;
                aPForwardInfoEntity.CommentSubmitDate      = null;
                aPForwardInfoEntity.APMemberComment        = txtForwardRemarks.Text.Trim();
                aPForwardInfoEntity.APForwardMemberComment = String.Empty;

                FCCAPForwardInfo.GetFacadeCreate().Add(aPForwardInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);

                MiscUtil.ShowMessage(lblMessage, "You have forwarded the thread successfully", UIConstants.MessageType.GREEN);

                PrepareInitialView();
                BindList();

                #region Forwarded Mail

                String MailBody = String.Empty;
                String Subject  = String.Empty;

                StringBuilder sb = new StringBuilder();

                sb.Append("Dear Sir,");
                sb.Append("<br/>");
                sb.Append("This is a auto generated mail from the ERP.");
                sb.Append("<br/>");
                sb.Append("A Requisition Forwarded Request is waiting for your approval");
                sb.Append("<br/>");
                sb.Append("-");
                sb.Append("<br/>");
                sb.Append("Thanks");
                sb.Append("<br/>");
                sb.Append("ERP System");
                MailBody = sb.ToString();
                Subject  = "ERP, Requsition, Forwarded";

                HREmployeeEntity _hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(aPForwardInfoEntity.EmployeeID);

                if (_hREmployeeEntity != null)
                {
                    String[] sendToMail = new String[] { _hREmployeeEntity.PrimaryEmail };
                    MiscUtil.SendMail(sendToMail, Subject, MailBody);
                }

                #endregion

                RedirectPageToForwardList();
            }
            else
            {
                MiscUtil.ShowMessage(lblMessage, "Failed to forward", UIConstants.MessageType.RED);
            }
        }
Ejemplo n.º 27
0
        private void PrepareInitialView()
        {
            BuildDropDownList();

            //String se = SqlExpressionBuilder.PrepareSortExpression(PRMWorkOrderEntity.FLD_NAME_WorkOrderID, SQLSortOrderType.Decending);
            //IList<PRMWorkOrderEntity> workOrderList = FCCPRMWorkOrder.GetFacadeCreate().GetIL(null, null, se, String.Empty, DatabaseOperationType.LoadWithSortExpression);
            //Int64 workOrderNo = 0;

            //if (workOrderList != null && workOrderList.Count > 0)
            //{
            //    workOrderNo = (from c in workOrderList
            //                   select Convert.ToInt64(c.WorkOrderNo)).Max() + 1;

            //    txtWorkOrderNo.Text = workOrderNo.ToString();
            //}
            //else
            //{
            //    //Put The Start Project Code Here.
            //    txtWorkOrderNo.Text = "00001";
            //}

            txtWorkOrderNo.Text             = MasterDataConstants.AutoAssigned.DEFAULT_AUTO_ASSIGNED;
            txtOtherAttention.Text          = String.Empty;
            txtCreateDate.Text              = DateTime.Now.ToString(UIConstants.SHORT_DATE_FORMAT);
            txtSubject.Text                 = String.Empty;
            txtBodyTitle.Text               = String.Empty;
            txtStartDate.Text               = System.DateTime.Now.ToString("dd-MM-yyyy");
            txtCompletionDate.Text          = System.DateTime.Now.AddDays(7).ToString("dd-MM-yyyy");
            txtWarranty.Text                = "N/A";
            txtDelayCharge.Text             = "N/A";
            txtRowText.Text                 = String.Empty;
            txtRemarks.Text                 = "N/A";
            txtFootNote.Text                = "TDS will be deducted as per government rule.";
            hypWorkOrderItemMap.Visible     = false;
            hypWorkOrderPaymentTerm.Visible = false;
            txtAIT.Text            = "0";
            txtCarryingCharge.Text = "0";
            txtDiscount.Text       = "0";
            txtVAT.Text            = "0";
            txtTax.Text            = "0";
            txtGrandTotal.Text     = String.Empty;

            btnSubmit.Text    = "Save & Next";
            btnAddNew.Visible = false;

            Int64 workOrderID = 0;

            if (!StringHelper.IsBlank(Helper.Url.SecureUrl[UrlConstants.OVERVIEW_WORKORDER_ID]))
            {
                Int64.TryParse(Helper.Url.SecureUrl[UrlConstants.OVERVIEW_WORKORDER_ID], out workOrderID);
                _WorkOrderID = workOrderID;

                BuildLabel(workOrderID);
            }

            // pnlOtherAttention.Visible = false;

            if (ddlPreparedByID != null && ddlPreparedByID.Items.Count > 0)
            {
                String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_MemberID, this.CurrentMember.MemberID.ToString(), SQLMatchType.Equal);

                IList <HREmployeeEntity> lstEmployee = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                if (lstEmployee != null && lstEmployee.Count > 0)
                {
                    ddlPreparedByID.SelectedValue = lstEmployee[0].EmployeeID.ToString();
                }
            }
        }