private void LoadHiddenFieldValues()
        {
            try
            {
                JavaScriptSerializer seriallizer = new JavaScriptSerializer();
                var foreignLanguages             = this.foreignLanguageDAL.GetAll();
                if (foreignLanguages != null && foreignLanguages.Count > 0)
                {
                    hdForeignLanguages.Value = seriallizer.Serialize(foreignLanguages);
                }

                var foreignLanguageLevels = this.foreignLanguageLevelDAL.GetAll();
                if (foreignLanguageLevels != null && foreignLanguageLevels.Count > 0)
                {
                    hdForeignLanguageLevels.Value = seriallizer.Serialize(foreignLanguageLevels);
                }

                hdNoneTemplateValue.Value = NoneTemplateValue;
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentFormUserControl: {ex.Message}");
            }
        }
        protected override void RequestByDepartment_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    var dataItem = e.Row.DataItem as Biz.Models.GuestReceptionManagement;
                    if (dataItem != null)
                    {
                        string requestFrom = string.Empty;
                        if (dataItem.CommonCreator != null)
                        {
                            requestFrom = dataItem.CommonCreator.LookupValue;
                        }
                        var litRequestFrom = e.Row.FindControl("litRequestFrom") as Literal;
                        litRequestFrom.Text = requestFrom;

                        string departmentName = string.Empty;
                        if (dataItem.CommonDepartment != null && dataItem.CommonDepartment.LookupId > 0)
                        {
                            departmentName = GetDepartmentName(dataItem.CommonDepartment.LookupId);
                        }
                        var litDepartment = e.Row.FindControl("litDepartment") as Literal;
                        litDepartment.Text = departmentName;

                        base.RequestByDepartment_RowDataBound(sender, e);
                    }
                }
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on GuestReceptionListUserControl: {ex.Message}");
            }
        }
        /// <summary>
        /// RequestByDepartment_RowDataBound
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void RequestByDepartment_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    var dataItem = e.Row.DataItem as Biz.Models.EmployeeRequirementSheet;
                    if (dataItem != null)
                    {
                        //string title = dataItem.Title != null ? dataItem.Title : string.Empty;
                        //var litTitle = e.Row.FindControl("litTitle") as Literal;
                        //litTitle.Text = title;

                        string requestFrom = string.Empty;
                        if (dataItem.CommonCreator != null)
                        {
                            requestFrom = dataItem.CommonCreator.LookupValue;
                        }
                        var litRequestFrom = e.Row.FindControl("litRequestFrom") as Literal;
                        litRequestFrom.Text = requestFrom;

                        string departmentName = string.Empty;
                        if (dataItem.RecruitmentDepartment != null)
                        {
                            departmentName = GetDepartmentName(dataItem.RecruitmentDepartment.LookupId);
                        }
                        var litDepartment = e.Row.FindControl("litDepartment") as Literal;
                        litDepartment.Text = departmentName;

                        string position    = dataItem.Position != null ? dataItem.Position : string.Empty;
                        var    litPosition = e.Row.FindControl("litPosition") as Literal;
                        litPosition.Text = position;

                        string quantity    = dataItem.Quantity.ToString();
                        var    litQuantity = e.Row.FindControl("litQuantity") as Literal;
                        litQuantity.Text = quantity;

                        #region ADD. 2017.10.9. TFS#1594
                        var litIsValid = e.Row.FindControl("litIsValid") as Label;
                        if (dataItem.IsValidRequest)
                        {
                            litIsValid.CssClass = RequestIsValid_CssClass;
                        }
                        else
                        {
                            litIsValid.CssClass = RequestIsInvalid_CssClass;
                            e.Row.BackColor     = System.Drawing.ColorTranslator.FromHtml(InvalidRequest_ColorRow);
                        }
                        #endregion

                        base.RequestByDepartment_RowDataBound(sender, e);
                    }
                }
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentListUserControl: {ex.Message}");
            }
        }
        private void ddlTemplate_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (string.Compare(ddlTemplate.SelectedValue, NoneTemplateValue, true) != 0)
                {
                    lbtnDeleteTemplate.Visible = true;

                    // Load template info
                    int templateId = 0;
                    if (int.TryParse(ddlTemplate.SelectedValue, out templateId))
                    {
                        if (templateId > 0)
                        {
                            this.templateItem = this.CurrentList.GetItemById(templateId);
                        }
                    }
                }
                else
                {
                    lbtnDeleteTemplate.Visible = false;
                }

                LoadForm();
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentFormUserControl: {ex.Message}");
            }
        }
        protected override void GridMyRquests_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    var dataItem = e.Row.DataItem as Biz.Models.RequisitionOfMeetingRoom;
                    if (dataItem != null)
                    {
                        string meetingLocation    = dataItem.MeetingRoomLocation.LookupValue;
                        var    litMeetingLocation = e.Row.FindControl("litMeetingLocation") as Literal;
                        litMeetingLocation.Text = meetingLocation;

                        string startTimeStr = dataItem.StartDate.ToString(StringConstant.DateFormatddMMyyyyHHmm);
                        var    litStartTime = e.Row.FindControl("litStartTime") as Literal;
                        litStartTime.Text = startTimeStr;

                        string endTimeStr = dataItem.EndDate.ToString(StringConstant.DateFormatddMMyyyyHHmm);
                        var    litEndTime = e.Row.FindControl("litEndTime") as Literal;
                        litEndTime.Text = endTimeStr;

                        base.GridMyRquests_RowDataBound(sender, e);
                    }
                }
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on MeetingRoomListUserControl: {ex.Message}");
            }
        }
        private bool DeleteTemplate(int templateId)
        {
            var res = false;

            try
            {
                if (templateId > 0)
                {
                    SPListItem templateItem = this.CurrentList.GetItemById(templateId);
                    if (templateItem != null)
                    {
                        templateItem[EmployeeRequirementSheetsList.Fields.IsTemplate] = false;
                        templateItem.Update();
                        res = true;
                    }
                }
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentFormUserControl: {ex.Message}");
                res = false;
            }

            return(res);
        }
        /// <summary>
        /// IsCurrrentEmployeeRecruitmentTeam
        /// </summary>
        /// <returns></returns>
        protected bool IsCurrrentEmployeeRecruitmentTeam()
        {
            var res = false;

            try
            {
                string queryString = string.Format(@"<Where>
                                                        <Eq>
                                                            <FieldRef Name='{0}' LookupId='True' />
                                                            <Value Type='Lookup'>{1}</Value>
                                                        </Eq>
                                                    </Where>", RecruitmentTeamList.Fields.Employees, this.CurrentEmployeeInfoObj.ID);

                var recruitmentTeamItems = this.recruitmentTeamDAL.GetByQuery(queryString);
                if (recruitmentTeamItems != null && recruitmentTeamItems.Count > 0)
                {
                    res = true;
                }
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentListUserControl: {ex.Message}");
            }

            return(res);
        }
        private void RecruitmentFormUserControl_OnAfterApproved(object sender, EventArgs e)
        {
            try
            {
                #region DEL 2017.09.27. Không cần IN. TFS #1586
                //var currentStep = this.CurrentItem[ApprovalFields.CurrentStep];
                //var additionalStep = this.CurrentItem[ApprovalFields.AdditionalStep];
                //var additionalDepartment = this.CurrentItem[ApprovalFields.AdditionalDepartment];
                //var status = ObjectHelper.GetString(this.CurrentItem[ApprovalFields.WFStatus]);

                //if ((currentStep == null) && (additionalStep != null) && (additionalDepartment != null) && (string.Compare(status, ApprovalStatus.Approved, true) != 0))
                //{
                //    RecruitmentTemplate RecruitmentTemplate = new RecruitmentTemplate(this.CurrentWeb, this.CurrentItem);
                //    string urlOfFileFormData = RecruitmentTemplate.ExportFormData();

                //    if (!string.IsNullOrEmpty(urlOfFileFormData))
                //    {
                //        string linkPrintEN = string.Format("<p>You can click on this <a href=\"{0}\">link<a/> to print form request.<p>", urlOfFileFormData);
                //        string linkPrintVN = string.Format("<p>Vui lòng truy vập vào <a href=\"{0}\">liên kết<a/> để in phiếu yêu cầu tuyển dụng.</p>", urlOfFileFormData);
                //        this.ApprovalBaseManagerObject.AdditionalInfoEmailObject[RecruitmentFormUserControl.PrintLinkEN_Key] = linkPrintEN;
                //        this.ApprovalBaseManagerObject.AdditionalInfoEmailObject[RecruitmentFormUserControl.PrintLinkVN_Key] = linkPrintVN;
                //    }
                //}
                #endregion
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentFormUserControl: {ex.Message}");
            }
        }
Ejemplo n.º 9
0
        private void LoadListOfRequestDiplomaDetails()
        {
            try
            {
                #region Query
                string queryString = string.Format(@"<Where>
                                                        <Eq>
                                                            <FieldRef Name='{0}' LookupId='True' />
                                                            <Value Type='Lookup'>{1}</Value>
                                                         </Eq>
                                                        </Where>", RequestBuyDetailsList.Fields.Request, this.CurrentItem.ID);
                #endregion

                var requestDiplomaDetailItems = this.requestDiplomaDetailDAL.GetByQuery(queryString);
                if (requestDiplomaDetailItems != null)
                {
                    JavaScriptSerializer seriallizer = new JavaScriptSerializer();
                    this.hdRequestDiplomaDetails.Value = seriallizer.Serialize(requestDiplomaDetailItems);
                }
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RequestForDiplomaSuppliesFormUserControl: {ex.Message}");
            }
        }
Ejemplo n.º 10
0
        private bool SaveRequestDiplomaDetails()
        {
            var res = true;

            try
            {
                JavaScriptSerializer        seriallizer = new JavaScriptSerializer();
                List <RequestDiplomaDetail> requestDiplomaDetailItems = seriallizer.Deserialize <List <RequestDiplomaDetail> >(hdRequestDiplomaDetails.Value);

                #region Delete List Of Detail Items
                string      queryString  = string.Format(@"<Where>
                                                            <Eq>
                                                                <FieldRef Name='{0}' LookupId='True' />
                                                                <Value Type='Lookup'>{1}</Value>
                                                            </Eq>
                                                       </Where>", StringConstant.RequestDiplomaDetailsList.Fields.Request, this.CurrentItem.ID);
                IList <int> ids          = null;
                var         currentItems = this.requestDiplomaDetailDAL.GetByQuery(queryString);
                if (currentItems != null && currentItems.Count > 0)
                {
                    ids = new List <int>();

                    foreach (var item in currentItems)
                    {
                        var existedItem = requestDiplomaDetailItems.Where(requestDiplomaDetailItem => requestDiplomaDetailItem.ID == item.ID).FirstOrDefault();
                        // Neu khong ton tai => Xoa
                        if (existedItem == null)
                        {
                            ids.Add(item.ID);
                        }
                    }
                }

                if (ids != null && ids.Count > 0)
                {
                    this.requestDiplomaDetailDAL.DeleteItems(ids);
                }
                #endregion

                foreach (var item in requestDiplomaDetailItems)
                {
                    item.Request = new LookupItem {
                        LookupId = this.CurrentItem.ID
                    };
                    this.requestDiplomaDetailDAL.SaveItem(item);
                }
            }
            catch (Exception ex)
            {
                res = false;
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RequestForDiplomaSuppliesFormUserControl: {ex.Message}");
            }

            return(res);
        }
        private void LoadDepartments()
        {
            try
            {
                this.ddlDepartment.DataValueField = "ID";
                if (this.IsVietnameseLanguage)
                {
                    this.ddlDepartment.DataTextField = "VietnameseName";
                }
                else
                {
                    this.ddlDepartment.DataTextField = "Name";
                }
                var departments = new List <Department>();

                if (this.CurrentItem[EmployeeRequirementSheetsList.Fields.RecruitmentDepartment] != null)
                {
                    SPFieldLookupValue departmentLookupValue = ObjectHelper.GetSPFieldLookupValue(this.CurrentItem[EmployeeRequirementSheetsList.Fields.RecruitmentDepartment]);
                    var department = this.ApprovalBaseManagerObject.DepartmentDAL.GetByID(departmentLookupValue.LookupId);
                    if (department != null)
                    {
                        departments.Add(department);
                    }
                }
                else
                {
                    // Người của phòng ban nào thì làm đơn cho phòng ban của mình thôi. Không làm đơn giúp cho phòng ban khác.
                    var currentEmployee = this.ApprovalBaseManagerObject.CurrentEmployee;
                    if (currentEmployee != null)
                    {
                        if (currentEmployee.Department != null)
                        {
                            var department = this.ApprovalBaseManagerObject.DepartmentDAL.GetByID(currentEmployee.Department.LookupId);
                            if (department != null)
                            {
                                departments.Add(department);
                            }
                        }
                    }
                }
                this.ddlDepartment.DataSource = departments;
                this.ddlDepartment.DataBind();

                #region MOD. 2017.09.29.
                // Tiến 29.09.2017: Chỗ bộ phận anh Disable luôn dùm em. TFS #1587.
                //this.ddlDepartment.Enabled = this.isEditable;
                this.ddlDepartment.Enabled = false;
                #endregion
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentFormUserControl: {ex.Message}");
            }
        }
 /// <summary>
 /// Page_Load
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
     }
     catch (Exception ex)
     {
         ULSLogging.LogError(ex);
         ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentListUserControl: {ex.Message}");
     }
 }
Ejemplo n.º 13
0
        protected override bool SaveForm()
        {
            bool res = false;

            try
            {
                if (this.isEditable)
                {
                    SaveData();

                    res = base.SaveForm();

                    if (res)
                    {
                        // Văn bằng đạt được/Obtained diploma
                        SaveRequestDiplomaDetails();
                    }
                }
                else // Approve - Save Form
                {
                    // Only BOD who has permission to update Received By (Department).
                    if (this.IsEmployeeBOD())
                    {
                        if (this.CurrentFormMode == Microsoft.SharePoint.WebControls.SPControlMode.Edit)
                        {
                            this.CurrentItem[RequestForDiplomaSuppliesList.Fields.DiplomaRevision] = this.chkboxDiplomaRevision.Checked;
                            this.CurrentItem[RequestForDiplomaSuppliesList.Fields.SalaryRevision]  = this.chkboxSalaryRevision.Checked;
                            if (!this.dtFromDate.IsDateEmpty && this.dtFromDate.IsValid)
                            {
                                this.CurrentItem[RequestForDiplomaSuppliesList.Fields.CommonFrom] = this.dtFromDate.SelectedDate;
                            }
                            this.CurrentItem.Update();

                            res = true;
                        }
                    }
                    else // Only Apporval. No updating.
                    {
                        res = true;
                    }
                }
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RequestForDiplomaSuppliesFormUserControl: {ex.Message}");
                this.ShowClientMessage(ex.Message);
                res = false;
            }

            return(res);
        }
        protected override void RequestByDepartment_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    var dataItem = e.Row.DataItem as Biz.Models.RequisitionOfMeetingRoom;
                    if (dataItem != null)
                    {
                        string requestFrom = string.Empty;
                        if (dataItem.CommonCreator != null)
                        {
                            requestFrom = dataItem.CommonCreator.LookupValue;
                        }
                        var litRequestFrom = e.Row.FindControl("litRequestFrom") as Literal;
                        litRequestFrom.Text = requestFrom;

                        string departmentName = string.Empty;
                        if (dataItem.CommonDepartment != null && dataItem.CommonDepartment.LookupId > 0)
                        {
                            departmentName = GetDepartmentName(dataItem.CommonDepartment.LookupId);
                        }
                        var litDepartment = e.Row.FindControl("litDepartment") as Literal;
                        litDepartment.Text = departmentName;

                        string meetingLocation = string.Empty;
                        if (dataItem.MeetingRoomLocation != null)
                        {
                            meetingLocation = dataItem.MeetingRoomLocation.LookupValue;
                        }
                        var litMeetingLocation = e.Row.FindControl("litMeetingLocation") as Literal;
                        litMeetingLocation.Text = meetingLocation;

                        string startTimeStr = dataItem.StartDate.ToString(StringConstant.DateFormatddMMyyyyHHmm);
                        var    litStartTime = e.Row.FindControl("litStartTime") as Literal;
                        litStartTime.Text = startTimeStr;

                        string endTimeStr = dataItem.EndDate.ToString(StringConstant.DateFormatddMMyyyyHHmm);
                        var    litEndTime = e.Row.FindControl("litEndTime") as Literal;
                        litEndTime.Text = endTimeStr;

                        base.RequestByDepartment_RowDataBound(sender, e);
                    }
                }
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on MeetingRoomListUserControl: {ex.Message}");
            }
        }
        protected override void OnInit(EventArgs e)
        {
            try
            {
                this.listUrl = Biz.Constants.StringConstant.GuestReceptionManagementList.Url;
                this.guestReceptionManagementDAL = new GuestReceptionManagementDAL(SPContext.Current.Web.Url);

                base.OnInit(e);
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on GuestReceptionListUserControl: {ex.Message}");
            }
        }
        protected override void OnInit(EventArgs e)
        {
            try
            {
                this.listUrl = Biz.Constants.StringConstant.RequisitionOfMeetingRoomList.Url;
                this.requisitionOfMeetingRoomDAL = new RequisitionOfMeetingRoomDAL(SPContext.Current.Web.Url);

                base.OnInit(e);
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on MeetingRoomListUserControl: {ex.Message}");
            }
        }
Ejemplo n.º 17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!Page.IsPostBack)
         {
             LoadData();
         }
     }
     catch (Exception ex)
     {
         ULSLogging.LogError(ex);
         ULSLogging.LogMessageToFile($"-- Error occurs on RequestForDiplomaSuppliesFormUserControl: {ex.Message}");
     }
 }
        protected override void RequestByDepartment_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    var dataItem = e.Row.DataItem as Biz.Models.RequestForDiplomaSupply;
                    if (dataItem != null)
                    {
                        //string title = dataItem.Title != null ? dataItem.Title : string.Empty;
                        //var litTitle = e.Row.FindControl("litTitle") as Literal;
                        //litTitle.Text = title;

                        string requestFrom = string.Empty;
                        if (dataItem.CommonCreator != null)
                        {
                            requestFrom = dataItem.CommonCreator.LookupValue;
                        }
                        var litRequestFrom = e.Row.FindControl("litRequestFrom") as Literal;
                        litRequestFrom.Text = requestFrom;

                        string departmentName = string.Empty;
                        if (dataItem.CommonDepartment != null)
                        {
                            departmentName = GetDepartmentName(dataItem.CommonDepartment.LookupId);
                        }
                        var litDepartment = e.Row.FindControl("litDepartment") as Literal;
                        litDepartment.Text = departmentName;

                        string employeeName   = dataItem.Position != null ? dataItem.EmployeeName : string.Empty;
                        var    litEmpoyeeName = e.Row.FindControl("litEmpoyeeName") as Literal;
                        litEmpoyeeName.Text = employeeName;

                        string position    = dataItem.Position != null ? dataItem.Position : string.Empty;
                        var    litPosition = e.Row.FindControl("litPosition") as Literal;
                        litPosition.Text = position;

                        base.RequestByDepartment_RowDataBound(sender, e);
                    }
                }
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RequestForDiplomaSuppliesListUserControl: {ex.Message}");
            }
        }
        protected override void OnPreRender(EventArgs e)
        {
            try
            {
                base.OnPreRender(e);

                cblAppearance.Attributes.Add(CheckBoxList_SelectType_Attribute, CheckBoxList_SelectType_Value);
                cblWorkingExperience.Attributes.Add(CheckBoxList_SelectType_Attribute, CheckBoxList_SelectType_Value);
                cblWorkingExperience.Attributes.Add(OtherValueControlId_Attribute, txtOtherWorkingExperience.ClientID);
                cblComputerSkills.Attributes.Add(OtherValueControlId_Attribute, this.txtOtherComputerSkills.ClientID);
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentFormUserControl: {ex.Message}");
            }
        }
Ejemplo n.º 20
0
        private void LoadNewSuggestions()
        {
            try
            {
                if (this.CurrentItem[RequestForDiplomaSuppliesList.Fields.NewSuggestions] != null)
                {
                    this.txtNewSuggestions.Text = this.CurrentItem[RequestForDiplomaSuppliesList.Fields.NewSuggestions].ToString();
                }

                this.txtNewSuggestions.Enabled = this.isEditable;
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RequestForDiplomaSuppliesFormUserControl: {ex.Message}");
            }
        }
        protected override void OnInit(EventArgs e)
        {
            try
            {
                // Set current list url.
                this.listUrl = EmployeeRequirementSheetsList.Url;
                this.employeeRequirementSheetDAL = new EmployeeRequirementSheetDAL(SPContext.Current.Web.Url);
                this.recruitmentTeamDAL          = new RecruitmentTeamDAL(SPContext.Current.Web.Url);

                base.OnInit(e);
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentListUserControl: {ex.Message}");
            }
        }
Ejemplo n.º 22
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            try
            {
                if (!EnableServerLogging)
                {
                    return;
                }

                TimeSpan ts = stopWatch.Elapsed;
                // End log:
                ULSLogging.LogMessageToFile($"-- END {PageName} at: {DateTime.Now}, DURATION: {ts.Milliseconds / 10} (Milliseconds)");
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
            }
        }
 protected override void OnInit(EventArgs e)
 {
     try
     {
         base.OnInit(e);
         foreignLanguageDAL           = new ForeignLanguageDAL(this.SiteUrl);
         foreignLanguageLevelDAL      = new ForeignLanguageLevelDAL(this.SiteUrl);
         recruitmentLanguageSkillsDAL = new RecruitmentLanguageSkillsDAL(this.SiteUrl);
         isEditable = this.IsEditable();
         this.hdIsEditable.Value = this.isEditable.ToString();
     }
     catch (Exception ex)
     {
         ULSLogging.LogError(ex);
         ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentFormUserControl: {ex.Message}");
         this.ShowClientMessage(ex.Message);
     }
 }
        /// <summary>
        /// LoadListOfTemplates
        /// </summary>
        private void LoadListOfTemplates()
        {
            try
            {
                string queryString = string.Format(@"<Where>
                                                        <And>
                                                            <Eq>
                                                                <FieldRef Name='{0}' LookupId='True' />
                                                                <Value Type='Lookup'>{1}</Value>
                                                            </Eq>
                                                            <Eq>
                                                                <FieldRef Name='{2}' />
                                                                <Value Type='Boolean'>{3}</Value>
                                                            </Eq>
                                                        </And>
                                                       </Where>
                                                        <OrderBy>
	                                                        <FieldRef Name='Title' Ascending='TRUE'/>
                                                        </OrderBy>",
                                                   EmployeeRequirementSheetsList.Fields.CommonDepartmentField, this.ApprovalBaseManagerObject.CurrentEmployee.Department.LookupId,
                                                   EmployeeRequirementSheetsList.Fields.IsTemplate, "1");
                EmployeeRequirementSheetDAL employeeRequirementSheetDAL = new EmployeeRequirementSheetDAL(this.SiteUrl);
                var templates = employeeRequirementSheetDAL.GetByQuery(queryString);
                this.ddlTemplate.DataSource = templates;
                this.ddlTemplate.DataBind();

                ListItem noneListItem = new ListItem();
                noneListItem.Value = NoneTemplateValue;
                if (this.IsVietnameseLanguage)
                {
                    noneListItem.Text = "(Không có)";
                }
                else
                {
                    noneListItem.Text = "(None)";
                }
                ddlTemplate.Items.Insert(0, noneListItem);
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentFormUserControl: {ex.Message}");
            }
        }
 protected override void GridMyRquests_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             var dataItem = e.Row.DataItem as Biz.Models.GuestReceptionManagement;
             if (dataItem != null)
             {
                 base.GridMyRquests_RowDataBound(sender, e);
             }
         }
     }
     catch (Exception ex)
     {
         ULSLogging.LogError(ex);
         ULSLogging.LogMessageToFile($"-- Error occurs on GuestReceptionListUserControl: {ex.Message}");
     }
 }
        protected override void LoadListOfMyRequests()
        {
            try
            {
                StringBuilder queryStringMyRequestBuilder = new StringBuilder();
                queryStringMyRequestBuilder.Append(this.queryStringMyRequest);
                queryStringMyRequestBuilder.Append(this.orderByQueryString);
                List <Biz.Models.GuestReceptionManagement> myRequests = guestReceptionManagementDAL.GetByQuery(queryStringMyRequestBuilder.ToString());
                this.gridMyRquests.DataSource = myRequests;
                this.gridMyRquests.DataBind();

                this.Page.Session[MyRequestsSessionKey + this.moduleId] = myRequests;
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on GuestReceptionListUserControl: {ex.Message}");
            }
        }
        /// <summary>
        /// LoadListOfRequestByDepartment
        /// </summary>
        protected override void LoadListOfRequestByDepartment()
        {
            try
            {
                StringBuilder queryStringRequestsByDepartmentBuilder = new StringBuilder();
                queryStringRequestsByDepartmentBuilder.Append(this.queryStringRequestsByDepartment);
                queryStringRequestsByDepartmentBuilder.Append(this.orderByQueryString);
                List <Biz.Models.EmployeeRequirementSheet> requestsByDepartment = employeeRequirementSheetDAL.GetByQuery(queryStringRequestsByDepartmentBuilder.ToString());
                this.gridRequestByDepartment.DataSource = requestsByDepartment;
                this.gridRequestByDepartment.DataBind();

                this.Page.Session[RequestsByDepartmentSessionKey] = requestsByDepartment;
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RecruitmentListUserControl: {ex.Message}");
            }
        }
Ejemplo n.º 28
0
        protected void Page_Init(object sender, EventArgs e)
        {
            try
            {
                if (!EnableServerLogging)
                {
                    return;
                }

                stopWatch.Start();
                PageName = System.IO.Path.GetFileName(Request.Url.AbsolutePath);
                // Begin log:
                ULSLogging.LogMessageToFile($"-- BEGIN {PageName} at: {DateTime.Now}");
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
            }
        }
        protected override void LoadListOfRequestToBeApproved()
        {
            try
            {
                StringBuilder queryStringRequestsToBeApprovedBuilder = new StringBuilder();
                queryStringRequestsToBeApprovedBuilder.Append(this.queryStringReequestsToBeApproved);
                queryStringRequestsToBeApprovedBuilder.Append(this.orderByQueryString);
                List <Biz.Models.RequisitionOfMeetingRoom> requestsToBeApproved = requisitionOfMeetingRoomDAL.GetByQuery(queryStringRequestsToBeApprovedBuilder.ToString());
                this.gridRequestToBeApproved.DataSource = requestsToBeApproved;
                this.gridRequestToBeApproved.DataBind();

                this.Page.Session[RequestsToBeApprovedSessionKey + this.moduleId] = requestsToBeApproved;
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on MeetingRoomListUserControl: {ex.Message}");
            }
        }
        protected override void LoadListOfMyRequests()
        {
            try
            {
                StringBuilder queryStringMyRequestBuilder = new StringBuilder();
                queryStringMyRequestBuilder.Append(this.queryStringMyRequest);
                queryStringMyRequestBuilder.Append(this.orderByQueryString);

                List <Biz.Models.RequestForDiplomaSupply> myRequests = this.requestForDiplomaSupplyDAL.GetByQuery(queryStringMyRequestBuilder.ToString());
                this.gridMyRquests.DataSource = myRequests;
                this.gridMyRquests.DataBind();

                this.Page.Session[MyRequestsSessionKey] = myRequests;
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on RequestForDiplomaSuppliesListUserControl: {ex.Message}");
            }
        }