Пример #1
0
        protected void RadGridAgency_OnPreRender(object sender, EventArgs e)
        {
            if (ViewState["AgencyId"] != null)
            {
                foreach (GridDataItem item in RadGridAgency.Items)
                {
                    if (item.GetDataKeyValue("AgencyId").ToString() == ViewState["AgencyId"].ToString())
                    {
                        if (item.Selected == false)
                        {
                            item.Selected = true;
                            break;
                        }
                    }
                }
            }

            SetApprovalList();

            // toolbar
            foreach (RadToolBarItem toolbarItem in RadToolBarAgency.Items)
            {
                if (RadGridAgency.SelectedValue != null)
                {
                    var cAgency = new CAgency();
                    var agency  = cAgency.Get(Convert.ToInt32(RadGridAgency.SelectedValue));
                    // request active check
                    if (toolbarItem.Text == "Request")
                    {
                        if ((agency.ApprovalStatus == null ||
                             agency.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise) && agency.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Cancel")
                    {
                        if ((agency.ApprovalStatus == null ||
                             agency.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise ||
                             agency.ApprovalStatus == (int)CConstValue.ApprovalStatus.Requested) && agency.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Approve" || toolbarItem.Text == "Reject")
                    {
                        // approve active check
                        var refundApproveInfo = new CGlobal();
                        var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.Agency,
                                                                                      Convert.ToInt32(agency.AgencyId));

                        // supervisor or loy employees
                        if ((CurrentUserId == supervisor) &&
                            agency.ApprovalStatus != (int)CConstValue.ApprovalStatus.Approved &&
                            agency.ApprovalStatus != (int)CConstValue.ApprovalStatus.Rejected &&
                            agency.ApprovalStatus != (int)CConstValue.ApprovalStatus.Canceled &&
                            agency.ApprovalStatus != null &&
                            CurrentUserId != agency.ApprovalId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                }
                else
                {
                    if (toolbarItem.Text == "View")
                    {
                        continue;
                    }
                    toolbarItem.Enabled = false;
                }
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Id = Convert.ToInt32(Request["id"]);

            if (!IsPostBack)
            {
                var scriptManager = (RadScriptManager)Page.Master.FindControl("RadScriptManager1");
                //scriptManager.Scripts.Add(new ScriptReference() { Path = ResolveUrl("~/assets/js/jquery.printArea.js") });
                //scriptManager.RegisterPostBackControl(RadButtonFileDownload);

                var obj = new CVacation();
                var requestOrApprovalType = Request["requestOrApprovalType"];
                var approvalType          = Request["approvalType"];

                var buttonList = new List <string>();

                // new
                if (Request["createOrListType"] == "0")
                {
                    obj = obj.GetNewDocument(CurrentUserId);

                    //buttonList.Add("TempSave");
                    buttonList.Add("Request");
                    buttonList.Add("Close");

                    SetVisibleItems(true);
                }
                // select
                else
                {
                    // date
                    obj = new CVacation(Id);

                    // request list
                    if (requestOrApprovalType == "0")
                    {
                        // Revise
                        if (approvalType == ((int)CConstValue.ApprovalStatus.Revise).ToString())
                        {
                            buttonList.Add("Request");
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(true);
                        }
                        // TempSave
                        else if (approvalType == string.Empty)
                        {
                            buttonList.Add("Request");
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(true);
                        }
                        // Request
                        else if (approvalType == "1")
                        {
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(false);
                        }
                        else
                        {
                            buttonList.Add("Close");

                            SetVisibleItems(false);
                        }
                    }
                    // approval
                    else if (requestOrApprovalType == "1")
                    {
                        // approved or rejected
                        if (approvalType == ((int)CConstValue.ApprovalStatus.Approved).ToString())
                        {
                            // permission
                            if (CurrentGroupId == (int)CConstValue.UserGroupForVacation.IT ||
                                CurrentGroupId == (int)CConstValue.UserGroupForVacation.HR)
                            {
                                buttonList.Add("Cancel");
                            }

                            buttonList.Add("Close");
                        }
                        else if (approvalType == ((int)CConstValue.ApprovalStatus.Rejected).ToString() ||
                                 approvalType == ((int)CConstValue.ApprovalStatus.Canceled).ToString())
                        {
                            buttonList.Add("Close");
                        }
                        else
                        {
                            var refundApproveInfo = new CGlobal();
                            var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.Vacation, Convert.ToInt32(Id));

                            if (CurrentUserId == supervisor)
                            {
                                buttonList.Add("Approve");
                                buttonList.Add("Reject");
                                buttonList.Add("Revise");
                                buttonList.Add("Close");
                            }
                            else
                            {
                                buttonList.Add("Close");
                            }
                        }

                        SetVisibleItems(false);
                    }
                    // Hire from HQ
                    else if (requestOrApprovalType == "2")
                    {
                        // permission
                        if (CurrentGroupId == (int)CConstValue.UserGroupForVacation.IT ||
                            CurrentGroupId == (int)CConstValue.UserGroupForVacation.HR)
                        {
                            buttonList.Add("Cancel");
                        }

                        buttonList.Add("Print");
                        buttonList.Add("Close");

                        SetVisibleItems(false);
                    }
                }

                foreach (RadToolBarItem item in RadToolBar1.Items)
                {
                    if (buttonList.Contains(item.Text))
                    {
                        item.Visible = true;
                    }
                    else
                    {
                        item.Visible = false;
                    }
                }

                var dt = new DataTable();
                dt.Columns.Add("DocNo");
                dt.Columns.Add("DateOfIssue");
                var newDr = dt.NewRow();
                newDr["DocNo"]       = obj.DocNo;
                newDr["DateOfIssue"] = obj.DateOfIssue;
                dt.Rows.Add(newDr);
                RadGridInfo.DataSource = dt;

                // Get Data
                var vacationObj = obj.Get(Id);
                if (vacationObj != null)
                {
                    RadComboBoxVacationType.SelectedIndex = vacationObj.VacationType;

                    CVacationDetail vacationDetailClass = new CVacationDetail();

                    foreach (VacationDetail vd in vacationDetailClass.Get(vacationObj.VacationId))
                    {
                        RadComboBoxDayType.SelectedIndex = vd.IsFullDay ? 0 : 1;
                        RadCalendar1.SelectedDates.Add(new RadDate(vd.Date));
                    }

                    ViewState["SelectedDates"] = RadCalendar1.SelectedDates.ToArray();
                    RadTextBoxRemark.Text      = vacationObj.Remark;

                    SetDataInformation();

                    // save for remain Days in load
                    ViewState["UserId"] = vacationObj.CreatedId;
                }
                else
                {
                    // save for remain Days in load
                    ViewState["UserId"] = CurrentUserId;
                }
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Id = Convert.ToInt32(Request["id"]);

            RadAsyncUpload asyncUpload = FileDownloadList1.GetAsyncUpload();

            asyncUpload.FileUploaded += HirePop_FileUploaded;

            if (!IsPostBack)
            {
                var scriptManager = (RadScriptManager)Page.Master.FindControl("RadScriptManager1");
                //scriptManager.Scripts.Add(new ScriptReference() { Path = ResolveUrl("~/assets/js/jquery.printArea.js") });
                //scriptManager.RegisterPostBackControl(RadButtonFileDownload);
                FileDownloadList1.InitFileDownloadList((int)CConstValue.Upload.Hire);

                var obj = new CHire();
                var requestOrApprovalType = Request["requestOrApprovalType"];
                var approvalType          = Request["approvalType"];

                var buttonList = new List <string>();

                // new
                if (Request["createOrListType"] == "0")
                {
                    obj = obj.GetNewDocument(CurrentUserId);

                    buttonList.Add("TempSave");
                    buttonList.Add("Request");
                    buttonList.Add("Close");

                    SetVisibleItems(true);
                }
                // select
                else
                {
                    FileDownloadList1.GetFileDownload(Convert.ToInt32(Id));

                    // date
                    obj = new CHire(Id);

                    // request list
                    if (requestOrApprovalType == "0")
                    {
                        // Revise
                        if (approvalType == ((int)CConstValue.ApprovalStatus.Revise).ToString())
                        {
                            buttonList.Add("Request");
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(true);
                        }
                        // TempSave
                        else if (approvalType == string.Empty)
                        {
                            buttonList.Add("TempSave");
                            buttonList.Add("Request");
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(true);
                        }
                        // Request
                        else if (approvalType == "1")
                        {
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(false);
                        }
                        else
                        {
                            buttonList.Add("Close");

                            SetVisibleItems(false);
                        }
                    }
                    // approval
                    else if (requestOrApprovalType == "1")
                    {
                        // approved or rejected
                        if (approvalType == ((int)CConstValue.ApprovalStatus.Approved).ToString() ||
                            approvalType == ((int)CConstValue.ApprovalStatus.Rejected).ToString() ||
                            approvalType == ((int)CConstValue.ApprovalStatus.Canceled).ToString())
                        {
                            buttonList.Add("Close");
                        }
                        else
                        {
                            var refundApproveInfo = new CGlobal();
                            var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.Hire, Convert.ToInt32(Id));

                            if (CurrentUserId == supervisor)
                            {
                                buttonList.Add("Approve");
                                buttonList.Add("Reject");
                                buttonList.Add("Revise");
                                buttonList.Add("Close");
                            }
                            else
                            {
                                buttonList.Add("Close");
                            }
                        }

                        SetVisibleItems(false);
                    }
                    // Hire from HQ
                    else if (requestOrApprovalType == "2")
                    {
                        buttonList.Add("Print");
                        buttonList.Add("Cancel");
                        buttonList.Add("Close");

                        SetVisibleItems(false);
                    }
                }

                foreach (RadToolBarItem item in RadToolBar1.Items)
                {
                    if (buttonList.Contains(item.Text))
                    {
                        item.Visible = true;
                    }
                    else
                    {
                        item.Visible = false;
                    }
                }

                if (approvalType == ((int)CConstValue.ApprovalStatus.Approved).ToString())
                {
                    FileDownloadList1.SetVisibieUploadControls(true);
                    //if (FileDownloadList1.GetFileInfoCountForHire() == 0)
                    //    FileDownloadList1.SetVisibieUploadControls(true);
                    //else
                    //    FileDownloadList1.SetVisibieUploadControls(false);
                }
                else
                {
                    FileDownloadList1.SetVisibieUploadControls(false);
                }

                var dt = new DataTable();
                dt.Columns.Add("DocNo");
                dt.Columns.Add("DateOfIssue");
                dt.Columns.Add("DraftingDepartment");
                dt.Columns.Add("ShelfLife");
                var newDr = dt.NewRow();
                newDr["DocNo"]              = obj.DocNo;
                newDr["DateOfIssue"]        = obj.DateOfIssue;
                newDr["DraftingDepartment"] = obj.DraftingDepartment;
                newDr["ShelfLife"]          = obj.ShelfLife;
                dt.Rows.Add(newDr);

                RadGridInfo.DataSource = dt;

                // Get Data
                var hireObj = obj.Get(Id);
                if (hireObj != null)
                {
                    RadComboBoxDepartment.SelectedValue = hireObj.Department.ToString();
                    RadComboBoxGenre.SelectedValue      = hireObj.Genre.ToString();
                    RadComboBoxCondition.SelectedValue  = hireObj.Condition.ToString();

                    RadTextBoxJobTitle.Text        = hireObj.JobTitle;
                    RadTextBoxReasonForHiring.Text = hireObj.ReasonForHiring;
                    RadEditorDuties.Content        = hireObj.DutiesAndResponsibilities;
                    RadEditorSkills.Content        = hireObj.SkillsAndExperienceAndQualification;
                    RadTextBoxSalary.Text          = hireObj.SalaryOrWage;
                    RadTextBoxEmployment.Text      = hireObj.EmploymentCategory;
                    RadTextBoxHours.Text           = hireObj.HoursOrDaysOfWork;
                    RadEditorAdditional.Content    = hireObj.AdditionalComments;
                }
            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Id = Convert.ToInt32(Request["id"]);

            if (!IsPostBack)
            {
                foreach (GridColumn v in RadGridFlight.Columns)
                {
                    if (v.GetType() == typeof(GridTemplateColumn))
                    {
                        var column = (GridTemplateColumn)v;
                        switch (column.UniqueName)
                        {
                        case "AirDate":
                            column.DefaultInsertValue = DateTime.Today.ToString("MM-dd-yyyy");
                            break;

                        case "Departure":
                            column.DefaultInsertValue = "12:00 AM";
                            break;
                        }
                    }
                }

                foreach (GridColumn v in RadGridAccommodation.Columns)
                {
                    if (v.GetType() == typeof(GridTemplateColumn))
                    {
                        var column = (GridTemplateColumn)v;
                        switch (column.UniqueName)
                        {
                        case "AccomIn":
                            column.DefaultInsertValue = DateTime.Today.ToString("MM-dd-yyyy");
                            break;

                        case "AccomOut":
                            column.DefaultInsertValue = DateTime.Today.ToString("MM-dd-yyyy");
                            break;
                        }
                    }
                }

                foreach (GridColumn v in RadGridCash.Columns)
                {
                    if (v.GetType() == typeof(GridTemplateColumn))
                    {
                        var column = (GridTemplateColumn)v;
                        switch (column.UniqueName)
                        {
                        case "CashDate":
                            column.DefaultInsertValue = DateTime.Today.ToString("MM-dd-yyyy");
                            break;

                        case "CashTime":
                            column.DefaultInsertValue = "12:00 AM";
                            break;
                        }
                    }
                }

                var scriptManager = (RadScriptManager)Page.Master.FindControl("RadScriptManager1");
                //scriptManager.Scripts.Add(new ScriptReference() { Path = ResolveUrl("~/assets/js/jquery.printArea.js") });
                //scriptManager.RegisterPostBackControl(RadButtonFileDownload);
                FileDownloadList1.InitFileDownloadList((int)CConstValue.Upload.BusinessTrip);

                var obj = new CBusinessTrip();
                var requestOrApprovalType = Request["requestOrApprovalType"];
                var approvalType          = Request["approvalType"];

                var buttonList = new List <string>();

                // new
                if (Request["createOrListType"] == "0")
                {
                    obj = obj.GetNewDocument(CurrentUserId);

                    buttonList.Add("TempSave");
                    buttonList.Add("Request");
                    buttonList.Add("Close");

                    SetVisibleItems(true);
                }
                // select
                else
                {
                    FileDownloadList1.GetFileDownload(Convert.ToInt32(Id));

                    // date
                    obj = new CBusinessTrip(Id);

                    // request list
                    if (requestOrApprovalType == "0")
                    {
                        // Revise
                        if (approvalType == ((int)CConstValue.ApprovalStatus.Revise).ToString())
                        {
                            buttonList.Add("Request");
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(true);
                        }
                        // TempSave
                        else if (approvalType == string.Empty)
                        {
                            buttonList.Add("TempSave");
                            buttonList.Add("Request");
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(true);
                        }
                        // Request
                        else if (approvalType == "1")
                        {
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(false);
                        }
                        else
                        {
                            buttonList.Add("Close");
                            SetVisibleItems(false);
                        }
                    }
                    // approval
                    else if (requestOrApprovalType == "1")
                    {
                        // approved or rejected
                        if (approvalType == ((int)CConstValue.ApprovalStatus.Approved).ToString() ||
                            approvalType == ((int)CConstValue.ApprovalStatus.Rejected).ToString() ||
                            approvalType == ((int)CConstValue.ApprovalStatus.Canceled).ToString())
                        {
                            buttonList.Add("Close");
                        }
                        else
                        {
                            var refundApproveInfo = new CGlobal();
                            var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.BusinessTrip, Convert.ToInt32(Id));

                            if (CurrentUserId == supervisor)
                            {
                                buttonList.Add("Approve");
                                buttonList.Add("Reject");
                                buttonList.Add("Revise");
                                buttonList.Add("Close");
                            }
                            else
                            {
                                buttonList.Add("Close");
                            }
                        }

                        SetVisibleItems(false);
                    }
                    // Hire from HQ
                    else if (requestOrApprovalType == "2")
                    {
                        // Wating for review from HQ
                        if (approvalType == ((int)CConstValue.ApprovalStatus.WaitingForPreviewFromHq).ToString())
                        {
                            buttonList.Add("Accept");
                            buttonList.Add("Reject");
                            buttonList.Add("Close");
                        }
                        // In progress
                        else if (approvalType == ((int)CConstValue.ApprovalStatus.InProgress).ToString())
                        {
                            buttonList.Add("Print");
                            buttonList.Add("Complete");
                            buttonList.Add("Reject");
                            buttonList.Add("Close");
                        }
                        // Approved
                        else if (approvalType == ((int)CConstValue.ApprovalStatus.Approved).ToString())
                        {
                            buttonList.Add("Print");
                            buttonList.Add("Close");
                        }
                        else
                        {
                            buttonList.Add("Close");
                        }

                        SetVisibleItems(false);
                    }
                }

                foreach (RadToolBarItem item in RadToolBar1.Items)
                {
                    if (buttonList.Contains(item.Text))
                    {
                        item.Visible = true;
                    }
                    else
                    {
                        item.Visible = false;
                    }
                }

                // new or temp
                if (approvalType == "0" || approvalType == string.Empty)
                {
                    FileDownloadList1.SetVisibieUploadControls(true);
                }
                else
                {
                    FileDownloadList1.SetVisibieUploadControls(false);
                }

                // radio
                if (obj.TypeOfTrip != null)
                {
                    if (obj.TypeOfTrip.ToLower() == "local")
                    {
                        RadButtonOverseas.Checked = false;
                        RadButtonLocal.Checked    = true;
                    }
                    else
                    {
                        RadButtonLocal.Checked    = false;
                        RadButtonOverseas.Checked = true;
                    }
                }

                var dt = new DataTable();
                dt.Columns.Add("DocNo");
                dt.Columns.Add("Site");
                dt.Columns.Add("Location");
                dt.Columns.Add("Name");
                dt.Columns.Add("Date");
                var newDr = dt.NewRow();
                newDr["DocNo"]    = obj.DocNo.ToString();
                newDr["Site"]     = obj.Site;
                newDr["Location"] = obj.Location;
                newDr["Name"]     = obj.Name1;
                newDr["Date"]     = obj.Name2;
                dt.Rows.Add(newDr);

                RadGridInfo.DataSource = dt;
            }
        }
Пример #5
0
        protected void RadGrid_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            ResetForm();

            // detail information
            var packageProgram = new CPackageProgram().GetPackageProgram(Convert.ToInt32(RadGridProgramPackage.SelectedValue));

            LabelPackageProgramName.Text = packageProgram.PackageProgramName;
            var program = (new CProgram()).Get((int)packageProgram.ProgramId);

            if (program != null)
            {
                RadTextBoxProgram.Text = program.ProgramFullName;
                if (program.ProgramGroupId != null)
                {
                    var programGroup = new CProgramGroup().Get((int)program.ProgramGroupId);
                    if (programGroup != null)
                    {
                        if (programGroup.FacultyId != null)
                        {
                            RadTextBoxFaculty.Text = new CFaculty().Get((int)programGroup.FacultyId)?.Name;
                        }
                        RadTextBoxProgramGroup.Text = programGroup.Name;
                    }
                }
            }

            LabelDescription.Text      = packageProgram.Description;
            LabelPackageStartDate.Text = string.Format("{0:MM-dd-yyyy}", packageProgram.StartDate);
            LabelPackageEndDate.Text   = string.Format("{0:MM-dd-yyyy}", packageProgram.EndDate);

            GetSiteLocation();

            // toolbar
            foreach (RadToolBarItem toolbarItem in RadToolBarPackageProgram.Items)
            {
                // request active check
                if (toolbarItem.Text == "Request")
                {
                    if ((packageProgram.ApprovalStatus == null ||
                         packageProgram.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise) && packageProgram.CreatedId == CurrentUserId)
                    {
                        toolbarItem.Enabled = true;
                    }
                    else
                    {
                        toolbarItem.Enabled = false;
                    }
                }
                else if (toolbarItem.Text == "Cancel")
                {
                    if ((packageProgram.ApprovalStatus == null ||
                         packageProgram.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise ||
                         packageProgram.ApprovalStatus == (int)CConstValue.ApprovalStatus.Requested) && packageProgram.CreatedId == CurrentUserId)
                    {
                        toolbarItem.Enabled = true;
                    }
                    else
                    {
                        toolbarItem.Enabled = false;
                    }
                }
                else if (toolbarItem.Text == "Approve" || toolbarItem.Text == "Reject")
                {
                    // approve active check
                    var refundApproveInfo = new CGlobal();
                    var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.Package, Convert.ToInt32(packageProgram.PackageProgramId));

                    // supervisor or loy employees
                    if ((CurrentUserId == supervisor) &&
                        packageProgram.ApprovalStatus != (int)CConstValue.ApprovalStatus.Approved &&
                        packageProgram.ApprovalStatus != (int)CConstValue.ApprovalStatus.Rejected &&
                        packageProgram.ApprovalStatus != (int)CConstValue.ApprovalStatus.Canceled &&
                        packageProgram.ApprovalStatus != null &&
                        CurrentUserId != packageProgram.ApprovalId)
                    {
                        toolbarItem.Enabled = true;
                    }
                    else
                    {
                        toolbarItem.Enabled = false;
                    }
                }
            }

            // Detail View
            if (CurrentUserId == packageProgram.CreatedId && packageProgram.ApprovalStatus == null)
            {
                RadGridPackageProgramDetail.AllowAutomaticInserts = true;
                RadGridPackageProgramDetail.AllowAutomaticUpdates = true;
                RadGridPackageProgramDetail.AllowAutomaticDeletes = true;
                //RadGridPackageProgramDetail.MasterTableView.EditMode = GridEditMode.Batch;
                RadGridPackageProgramDetail.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
                // hidden delete button
                RadGridPackageProgramDetail.MasterTableView.Columns[RadGridPackageProgramDetail.MasterTableView.Columns.Count - 1].Visible = true;
            }
            else
            {
                RadGridPackageProgramDetail.AllowAutomaticInserts = false;
                RadGridPackageProgramDetail.AllowAutomaticUpdates = false;
                RadGridPackageProgramDetail.AllowAutomaticDeletes = false;
                //RadGridPackageProgramDetail.MasterTableView.EditMode = GridEditMode.InPlace;
                RadGridPackageProgramDetail.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                // hidden delete button
                RadGridPackageProgramDetail.MasterTableView.Columns[RadGridPackageProgramDetail.MasterTableView.Columns.Count - 1].Visible = false;
            }
            //SetApprovalList();
        }
Пример #6
0
        protected void RadGrid1_OnPreRender(object sender, EventArgs e)
        {
            if (ViewState["ScholarshipId"] != null)
            {
                foreach (GridDataItem item in RadGrid1.Items)
                {
                    if (item.GetDataKeyValue("ScholarshipId").ToString() == ViewState["ScholarshipId"].ToString())
                    {
                        if (item.Selected == false)
                        {
                            item.Selected = true;
                            break;
                        }
                    }
                }
            }

            SetApprovalList();
            GetScholarshipHistory();
            GetStudent();

            foreach (RadToolBarItem toolbarItem in RadToolBar1.Items)
            {
                if (RadGrid1.SelectedValue != null)
                {
                    var cScholar = new CScholarship();
                    var scholar  = cScholar.Get(Convert.ToInt32(RadGrid1.SelectedValue));

                    // request active check
                    if (toolbarItem.Text == "Request")
                    {
                        if ((scholar.ApprovalStatus == null || scholar.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise) && scholar.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Cancel")
                    {
                        if ((scholar.ApprovalStatus == null ||
                             scholar.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise ||
                             scholar.ApprovalStatus == (int)CConstValue.ApprovalStatus.Requested) && scholar.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Approve" || toolbarItem.Text == "Reject" || toolbarItem.Text == "Revise")
                    {
                        // approve active check
                        var refundApproveInfo = new CGlobal();
                        var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.Scholarship, Convert.ToInt32(scholar.ScholarshipId));

                        // supervisor
                        if ((CurrentUserId == supervisor) &&
                            scholar.ApprovalStatus != (int)CConstValue.ApprovalStatus.Approved &&
                            scholar.ApprovalStatus != (int)CConstValue.ApprovalStatus.Rejected &&
                            scholar.ApprovalStatus != (int)CConstValue.ApprovalStatus.Canceled &&
                            scholar.ApprovalStatus != null &&
                            CurrentUserId != scholar.ApprovalId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                }
                else
                {
                    if (toolbarItem.Text == "View" || toolbarItem.Text == "New Scholarship")
                    {
                        continue;
                    }
                    toolbarItem.Enabled = false;
                }
            }
        }
Пример #7
0
        protected void RadGridRefund_OnPreRender(object sender, EventArgs e)
        {
            if (ViewState["RefundId"] != null)
            {
                foreach (GridDataItem item in RadGridRefund.Items)
                {
                    if (item.GetDataKeyValue("RefundId").ToString() == ViewState["RefundId"].ToString())
                    {
                        if (item.Selected == false)
                        {
                            item.Selected = true;
                            break;
                        }
                    }
                }
            }

            // toolbar
            foreach (RadToolBarItem toolbarItem in RadToolBarApproval.Items)
            {
                if (RadGridRefund.SelectedValue != null)
                {
                    var cRefund = new CRefund();
                    var refund  = cRefund.Get(Convert.ToInt32(RadGridRefund.SelectedValue.ToString()));

                    // request active check
                    if (toolbarItem.Text == "Request")
                    {
                        if ((refund.ApprovalStatus == null || refund.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise) && refund.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Cancel")
                    {
                        if ((refund.ApprovalStatus == null ||
                             refund.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise ||
                             refund.ApprovalStatus == (int)CConstValue.ApprovalStatus.Requested) && refund.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Approve" || toolbarItem.Text == "Reject")
                    {
                        // approve active check
                        var refundApproveInfo = new CGlobal();
                        var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.Refund, Convert.ToInt32(refund.RefundId));

                        // supervisor or loy employees
                        if ((CurrentUserId == supervisor) &&
                            refund.ApprovalStatus != (int)CConstValue.ApprovalStatus.Approved &&
                            refund.ApprovalStatus != (int)CConstValue.ApprovalStatus.Rejected &&
                            refund.ApprovalStatus != (int)CConstValue.ApprovalStatus.Canceled &&
                            refund.ApprovalStatus != null &&
                            CurrentUserId != refund.ApprovalId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                }
                else
                {
                    if (toolbarItem.Text == "View" ||
                        toolbarItem.Text == "View Original Invoice" ||
                        toolbarItem.Text == "Student Page" ||
                        toolbarItem.Text == "Invoice Page" ||
                        toolbarItem.Text == "Payment Page" ||
                        toolbarItem.Text == "Deposit Page" ||
                        toolbarItem.Text == "CreditMemo Page")
                    {
                        continue;
                    }
                    toolbarItem.Enabled = false;
                }
            }

            RefreshApprovalList();
        }
Пример #8
0
        protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (ViewState["PromotionId"] != null)
            {
                foreach (GridDataItem item in RadGrid1.Items)
                {
                    if (item.GetDataKeyValue("PromotionId").ToString() == ViewState["PromotionId"].ToString())
                    {
                        if (item.Selected == false)
                        {
                            item.Selected = true;
                            break;
                        }
                    }
                }
            }

            SetApprovalList();
            GetStudent();
            GetPromotionHistory();

            FileDownloadList1.GetFileDownload(Convert.ToInt32(RadGrid1.SelectedValue));

            foreach (RadToolBarItem toolbarItem in RadToolBar1.Items)
            {
                if (RadGrid1.SelectedValue != null)
                {
                    var cPromotion = new CPromotion();
                    var promotion  = cPromotion.Get(Convert.ToInt32(RadGrid1.SelectedValue));

                    // request active check
                    if (toolbarItem.Text == "Request")
                    {
                        if ((promotion.ApprovalStatus == null || promotion.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise) && promotion.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Cancel")
                    {
                        if ((promotion.ApprovalStatus == null ||
                             promotion.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise ||
                             promotion.ApprovalStatus == (int)CConstValue.ApprovalStatus.Requested) && promotion.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Approve" || toolbarItem.Text == "Reject" || toolbarItem.Text == "Revise")
                    {
                        // approve active check
                        var refundApproveInfo = new CGlobal();
                        var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.Promotion, Convert.ToInt32(promotion.PromotionId));

                        // supervisor
                        if ((CurrentUserId == supervisor) &&
                            promotion.ApprovalStatus != (int)CConstValue.ApprovalStatus.Approved &&
                            promotion.ApprovalStatus != (int)CConstValue.ApprovalStatus.Rejected &&
                            promotion.ApprovalStatus != (int)CConstValue.ApprovalStatus.Canceled &&
                            promotion.ApprovalStatus != null &&
                            CurrentUserId != promotion.ApprovalId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                }
                else
                {
                    if (toolbarItem.Text == "View" || toolbarItem.Text == "New Promotion")
                    {
                        continue;
                    }
                    toolbarItem.Enabled = false;
                }
            }
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Id = Convert.ToInt32(Request["id"]);

            if (!IsPostBack)
            {
                foreach (GridColumn v in RadGridPurchaseOrderDetail.Columns)
                {
                    if (v.GetType() == typeof(GridTemplateColumn))
                    {
                        var column = (GridTemplateColumn)v;
                        switch (column.UniqueName)
                        {
                        case "Quantity":
                            column.DefaultInsertValue = "1";
                            break;
                        }
                    }
                }

                var scriptManager = (RadScriptManager)Page.Master.FindControl("RadScriptManager1");
                //scriptManager.Scripts.Add(new ScriptReference() { Path = ResolveUrl("~/assets/js/jquery.printArea.js") });
                //scriptManager.RegisterPostBackControl(RadButtonFileDownload);
                FileDownloadList1.InitFileDownloadList((int)CConstValue.Upload.PurchaseOrder);

                var global = new CGlobal();
                RadComboBoxType.DataSource     = global.GetDictionary(1466);
                RadComboBoxType.DataTextField  = "Name";
                RadComboBoxType.DataValueField = "Value";
                RadComboBoxType.DataBind();

                RadComboBoxPriority.DataSource     = global.GetDictionary(1470);
                RadComboBoxPriority.DataTextField  = "Name";
                RadComboBoxPriority.DataValueField = "Value";
                RadComboBoxPriority.DataBind();

                RadComboBoxShippingMethod.DataSource     = global.GetDictionary(1471);
                RadComboBoxShippingMethod.DataTextField  = "Name";
                RadComboBoxShippingMethod.DataValueField = "Value";
                RadComboBoxShippingMethod.DataBind();

                RadComboBoxReviewType.DataSource     = global.GetDictionary(1489);
                RadComboBoxReviewType.DataTextField  = "Name";
                RadComboBoxReviewType.DataValueField = "Value";
                RadComboBoxReviewType.DataBind();
                RadComboBoxReviewType.Items.Add(new RadComboBoxItem("N/A", null));
                RadComboBoxReviewType.SelectedIndex = RadComboBoxReviewType.Items.Count - 1;

                var obj = new CPurchaseOrder();
                var requestOrApprovalType = Request["requestOrApprovalType"];
                var approvalType          = Request["approvalType"];

                var buttonList = new List <string>();

                // new
                if (Request["createOrListType"] == "0")
                {
                    obj = obj.GetNewDocument(CurrentUserId);

                    buttonList.Add("TempSave");
                    buttonList.Add("Request");
                    buttonList.Add("Close");

                    SetVisibleItems(true);
                }
                // select
                else
                {
                    FileDownloadList1.GetFileDownload(Convert.ToInt32(Id));

                    // date
                    obj = new CPurchaseOrder(Id);

                    // request list
                    if (requestOrApprovalType == "0")
                    {
                        // Revise
                        if (approvalType == ((int)CConstValue.ApprovalStatus.Revise).ToString())
                        {
                            buttonList.Add("Request");
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(true);
                        }
                        // TempSave
                        else if (approvalType == string.Empty)
                        {
                            buttonList.Add("TempSave");
                            buttonList.Add("Request");
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(true);
                        }
                        // Request
                        else if (approvalType == "1")
                        {
                            buttonList.Add("Cancel");
                            buttonList.Add("Close");

                            SetVisibleItems(false);
                        }
                        else
                        {
                            buttonList.Add("Close");

                            SetVisibleItems(false);
                        }
                    }
                    // approval
                    else if (requestOrApprovalType == "1")
                    {
                        // approved or rejected
                        if (approvalType == ((int)CConstValue.ApprovalStatus.Approved).ToString() ||
                            approvalType == ((int)CConstValue.ApprovalStatus.Rejected).ToString() ||
                            approvalType == ((int)CConstValue.ApprovalStatus.Canceled).ToString())
                        {
                            buttonList.Add("Close");
                        }
                        else
                        {
                            var refundApproveInfo = new CGlobal();
                            var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.PurchaseOrder, Convert.ToInt32(Id));

                            if (CurrentUserId == supervisor)
                            {
                                buttonList.Add("Approve");
                                buttonList.Add("Reject");
                                buttonList.Add("Revise");
                                buttonList.Add("Close");
                            }
                            else
                            {
                                buttonList.Add("Close");
                            }
                        }

                        SetVisibleItems(false);
                    }
                    // Purchase Order from HQ
                    else if (requestOrApprovalType == "2")
                    {
                        // Wating for review from HQ
                        if (approvalType == ((int)CConstValue.ApprovalStatus.WaitingForPreviewFromHq).ToString())
                        {
                            buttonList.Add("Accept");
                            buttonList.Add("Reject");
                            buttonList.Add("Close");
                        }
                        // Approved
                        else if (approvalType == ((int)CConstValue.ApprovalStatus.Approved).ToString())
                        {
                            buttonList.Add("Print");
                            buttonList.Add("Accept");
                            buttonList.Add("Close");
                        }
                        else
                        {
                            buttonList.Add("Close");
                        }

                        SetVisibleItems(false);
                    }
                }

                foreach (RadToolBarItem item in RadToolBar1.Items)
                {
                    if (buttonList.Contains(item.Text))
                    {
                        item.Visible = true;
                    }
                    else
                    {
                        item.Visible = false;
                    }
                }

                // new or temp
                if (approvalType == "0" || approvalType == string.Empty)
                {
                    FileDownloadList1.SetVisibieUploadControls(true);
                }
                else
                {
                    FileDownloadList1.SetVisibieUploadControls(false);
                }

                if (approvalType != ((int)CConstValue.ApprovalStatus.WaitingForPreviewFromHq).ToString() &&
                    approvalType != ((int)CConstValue.ApprovalStatus.Approved).ToString())
                {
                    RunClientScript("HideReview();");
                }

                var dt = new DataTable();
                dt.Columns.Add("DocNo");
                dt.Columns.Add("Site");
                dt.Columns.Add("Location");
                dt.Columns.Add("Name");
                dt.Columns.Add("Date");
                var newDr = dt.NewRow();
                newDr["DocNo"]    = obj.DocNo;
                newDr["Site"]     = obj.Site;
                newDr["Location"] = obj.Location;
                newDr["Name"]     = obj.Name;
                newDr["Date"]     = obj.Date;
                dt.Rows.Add(newDr);

                RadGridInfo.DataSource = dt;

                // New
                if (Request["createOrListType"] == "0")
                {
                    var cUser = new CUser();
                    var user  = cUser.Get(CurrentUserId);
                    if (user != null)
                    {
                        RadTextBoxShipToName.Text       = cUser.GetUserName(user);
                        RadTextBoxShipToAddress.Text    = user.Address1 + " " + user.Address2;
                        RadTextBoxShipToCity.Text       = user.City;
                        RadTextBoxShipToProvince.Text   = user.Province;
                        RadTextBoxShipToPostalCode.Text = user.PostalCode;
                        RadTextBoxShipToPhone.Text      = user.CellPhone;
                        RadTextBoxShipToEmail.Text      = user.Email;
                    }

                    // Init
                    RadNumericTextBoxShippingTerms.Value   = 1;
                    RadDatePickerDeliveryDate.SelectedDate = DateTime.Now;
                }
                else
                {
                    var result = obj.Get(Id);
                    if (result != null)
                    {
                        RadComboBoxType.SelectedIndex           = result.PurchaseOrderType;
                        RadComboBoxPriority.SelectedIndex       = (int)result.PriorityType;
                        RadComboBoxShippingMethod.SelectedIndex = (int)result.ShippingMethodType;
                        RadNumericTextBoxShippingTerms.Value    = result.ShippingTerms;
                        RadDatePickerDeliveryDate.SelectedDate  = result.ShippingDeliveryDate;
                        RadTextBoxDescription.Text = result.Description;

                        RadTextBoxVendorName.Text       = result.VendorName;
                        RadTextBoxVendorAddress.Text    = result.VendorAddress;
                        RadTextBoxVendorCity.Text       = result.VendorCity;
                        RadTextBoxVendorProvince.Text   = result.VendorProvince;
                        RadTextBoxVendorPostalCode.Text = result.VendorPostalCode;
                        RadTextBoxVendorPhone.Text      = result.VendorPhone;
                        RadTextBoxVendorEmail.Text      = result.VendorEmail;

                        RadTextBoxShipToName.Text       = result.ShipToName;
                        RadTextBoxShipToAddress.Text    = result.ShipToAddress;
                        RadTextBoxShipToCity.Text       = result.ShipToCity;
                        RadTextBoxShipToProvince.Text   = result.ShipToProvince;
                        RadTextBoxShipToPostalCode.Text = result.ShipToPostalCode;
                        RadTextBoxShipToPhone.Text      = result.ShipToPhone;
                        RadTextBoxShipToEmail.Text      = result.ShipToEmail;

                        if (result.ReviewType != null)
                        {
                            RadComboBoxReviewType.SelectedIndex = (int)result.ReviewType;
                        }
                        if (result.ReviewDate != null)
                        {
                            RadDatePickerReviewDate.SelectedDate = result.ReviewDate;
                        }
                        if (result.ReviewUserId != null)
                        {
                            var cUser = new CUser();
                            var user  = cUser.Get((int)result.ReviewUserId);
                            RadTextBoxReviewUser.Text = cUser.GetUserName(user);
                        }
                        RadDatePickerReviewDate.SelectedDate = result.ReviewDate;
                        RadTextBoxReviewMemo.Text            = result.ReviewMemo;
                        RadNumericTextBoxTax.Value           = (double)result.Tax;
                    }
                }
            }
        }
Пример #10
0
        public void GetCreditMemoPayoutInfo()
        {
            // toolbar
            foreach (RadToolBarItem toolbarItem in RadToolBarCreditMemo.Items)
            {
                if (toolbarItem.Text == "Disbursement")
                {
                    if (RadGridCreditMemo.SelectedValue != null)
                    {
                        var creditMemo = new CCreditMemo().GetVwCreditMemo(Convert.ToInt32(RadGridCreditMemo.SelectedValue));
                        if (creditMemo != null)
                        {
                            var  cCreditMemoPayout     = new CCreditMemoPayout();
                            var  creditMemoPayoutList  = cCreditMemoPayout.GetCreditMemoPayoutList(creditMemo.CreditMemoId);
                            bool hasNullOfDisbursement = false;
                            foreach (var c in creditMemoPayoutList)
                            {
                                if (c.Disbursement == false && c.ApprovalStatus == (int)CConstValue.ApprovalStatus.Approved)
                                {
                                    toolbarItem.Enabled   = true;
                                    hasNullOfDisbursement = true;
                                    break;
                                }
                            }

                            if (hasNullOfDisbursement == false)
                            {
                                toolbarItem.Enabled = false;
                            }
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else
                    {
                        toolbarItem.Enabled = false;
                    }
                }
                else
                {
                    if (toolbarItem.Text == "View Invoice" || toolbarItem.Text == "View Payment" || toolbarItem.Text == "View Deposit" ||
                        toolbarItem.Text == "Student Page" || toolbarItem.Text == "Invoice Page" || toolbarItem.Text == "Payment Page" ||
                        toolbarItem.Text == "Deposit Page" || toolbarItem.Text == "Refund Page" || toolbarItem.Text == "Excel")
                    {
                        continue;
                    }

                    toolbarItem.Enabled = false;
                }
            }

            // toolbar
            foreach (RadToolBarItem toolbarItem in RadToolBarCreditMemoPayout.Items)
            {
                if (toolbarItem.Text == "New Payout")
                {
                    if (RadGridCreditMemo.SelectedValue != null)
                    {
                        toolbarItem.Enabled = true;
                    }
                    else
                    {
                        toolbarItem.Enabled = false;
                    }
                }
            }

            if (RadGridCreditMemoPayout.SelectedValue != null)
            {
                var cCreditMemoPayout = new CCreditMemoPayout();
                var creditMemoPayout  = cCreditMemoPayout.Get(Convert.ToInt32(RadGridCreditMemoPayout.SelectedValue));
                CreditMemoPayout1.SetData(creditMemoPayout);

                // toolbar
                foreach (RadToolBarItem toolbarItem in RadToolBarCreditMemoPayout.Items)
                {
                    // request active check
                    if (toolbarItem.Text == "Request")
                    {
                        if ((creditMemoPayout.ApprovalStatus == null || creditMemoPayout.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise) && creditMemoPayout.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Cancel")
                    {
                        if ((creditMemoPayout.ApprovalStatus == null ||
                             creditMemoPayout.ApprovalStatus == (int)CConstValue.ApprovalStatus.Revise ||
                             creditMemoPayout.ApprovalStatus == (int)CConstValue.ApprovalStatus.Requested) && creditMemoPayout.CreatedId == CurrentUserId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Approve" || toolbarItem.Text == "Reject" || toolbarItem.Text == "Revise")
                    {
                        // approve active check
                        var refundApproveInfo = new CGlobal();
                        var supervisor        = refundApproveInfo.CheckApprovalEnable((int)CConstValue.Approval.CreditMemoPayout, Convert.ToInt32(RadGridCreditMemoPayout.SelectedValue));

                        // supervisor or loy employees
                        if ((CurrentUserId == supervisor) &&
                            creditMemoPayout.ApprovalStatus != (int)CConstValue.ApprovalStatus.Approved &&
                            creditMemoPayout.ApprovalStatus != (int)CConstValue.ApprovalStatus.Rejected &&
                            creditMemoPayout.ApprovalStatus != (int)CConstValue.ApprovalStatus.Canceled &&
                            creditMemoPayout.ApprovalStatus != null &&
                            CurrentUserId != creditMemoPayout.ApprovalId)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                }

                foreach (RadToolBarItem toolbarItem in RadToolBarCreditMemoPayoutHistory.Items)
                {
                    if (toolbarItem.Text == "Add Payout")
                    {
                        if (creditMemoPayout.ApprovalStatus == (int)CConstValue.ApprovalStatus.Approved &&
                            creditMemoPayout.Disbursement &&
                            (CurrentGroupId == (int)CConstValue.UserGroupForCreditPayoutHistory.Accounting ||
                             CurrentGroupId == (int)CConstValue.UserGroupForCreditPayoutHistory.IT))
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                    else if (toolbarItem.Text == "Payout Reverse")
                    {
                        if (CurrentGroupId == (int)CConstValue.UserGroupForCreditPayoutHistory.Accounting ||
                            CurrentGroupId == (int)CConstValue.UserGroupForCreditPayoutHistory.IT)
                        {
                            toolbarItem.Enabled = true;
                        }
                        else
                        {
                            toolbarItem.Enabled = false;
                        }
                    }
                }

                // get DownloadList
                FileDownloadList1.GetFileDownload(Convert.ToInt32(RadGridCreditMemoPayout.SelectedValue));
            }
            else
            {
                foreach (RadToolBarItem toolbarItem in RadToolBarCreditMemoPayoutHistory.Items)
                {
                    toolbarItem.Enabled = false;
                }

                // get DownloadList
                FileDownloadList1.GetFileDownload(0);
            }

            RefreshApprovalList();
        }