예제 #1
0
        public JsonResult DeleteScholarshipByScholarshipDetailID(int id)
        {
            //BaseVacationsBLL Vacation = GenericFactoryPattern<BaseVacationsBLL, ExceptionalVacationsBLL>.CreateInstance();
            ScholarshipsDetailsBLL Scholarship = new ScholarshipsDetailsBLL();

            Scholarship.LoginIdentity = this.UserIdentity;
            Result result = Scholarship.Remove(id);

            //if (result.EnumMember == ScholarshipsValidationEnum.RejectedBeacuseOfNoChanceCancelCancelling.ToString())
            //{
            //    throw new CustomException(Resources.Globalization.ValidationScholarshipsAlreadyCanceledText);
            //}
            return(Json(new
            {
                data = Scholarship
            }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public JsonResult GetEmployeeScholarshipsDetailsByScholarshipID(int ScholarshipID)
        {
            List <ScholarshipsDetailsBLL> ScholarshipsDetailsList = new ScholarshipsDetailsBLL().GetScholarshipDetailsByScholarshipID(ScholarshipID);//     GetVacationsDetailsByVacationID(VacationID);

            return(Json(new
            {
                data = ScholarshipsDetailsList.Select(x => new
                {
                    ScholarshipDetailID = x.ScholarshipDetailID,
                    FromDate = x.FromDate,
                    ToDate = x.ToDate,
                    Notes = x.Notes,
                    ScholarshipPeriod = x.ScholarshipPeriod,
                    ScholarshipActionName = x.ScholarshipAction.ScholarshipActionName,
                    CreatedBy = x.CreatedBy.Employee.EmployeeNameAr,
                    CreatedDate = x.CreatedDate,
                })
            }, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string ID   = Request.QueryString["ID"].ToString();
                string Type = Request.QueryString["type"].ToString();
                ReportServicesMethod RSM = new ReportServicesMethod();
                string strFileName       = string.Empty;

                if (!Page.IsPostBack)
                {
                    ReportParameter EmployeeName = new ReportParameter("EmployeeName", Session["EmployeeName"].ToString());
                    if (Type.Equals(BusinessSubCategoriesEnum.Assignings.ToString()))
                    {
                        ReportParameter AssigningID = new ReportParameter("AssigningID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "Assigning", AssigningID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.Delegations.ToString()))
                    {
                        ReportParameter DelegationID = new ReportParameter("DelegationID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "Delegation", DelegationID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.PassengerOrders.ToString()))
                    {
                        ReportParameter PassengerOrderID = new ReportParameter("PassengerOrderID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "PassengerOrder", PassengerOrderID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.Lenders.ToString()))
                    {
                        ReportParameter LenderID = new ReportParameter("LenderID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "Lender", LenderID, EmployeeName);
                    }
                    else if (Type.Equals("EmployeeScholarship"))
                    {
                        ReportParameter ScholarshipID = new ReportParameter("ScholarshipID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "Scholarship", ScholarshipID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.OverTimes.ToString()))
                    {
                        ReportParameter OverTimeID = new ReportParameter("OverTimeID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "OverTime", OverTimeID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.Transfers.ToString()))
                    {
                        ReportParameter TransferID = new ReportParameter("TransferID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "Transfer", TransferID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.GovernmentFunds.ToString()))
                    {
                        ReportParameter GovernmentFundID = new ReportParameter("GovernmentFundID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "GovernmentFunds", GovernmentFundID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.GovernmentFundsDeactivation.ToString()))
                    {
                        ReportParameter GovernmentFundID = new ReportParameter("GovernmentFundID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "GovernmentFundsDeactivation", GovernmentFundID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.EmployeesAllowances.ToString()))
                    {
                        ReportParameter EmployeeAllowanceID = new ReportParameter("EmployeeAllowanceID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "EmployeeAllowance", EmployeeAllowanceID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.InternshipScholarships.ToString()))
                    {
                        ReportParameter InternshipScholarshipID = new ReportParameter("InternshipScholarshipID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "InternshipScholarship", InternshipScholarshipID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.Vacations.ToString()))
                    {
                        VacationsDetailsBLL VacationDetail   = new VacationsDetailsBLL().GetVacationsDetailsByVacationDetailID(int.Parse(ID));
                        ReportParameter     VacationDetailID = new ReportParameter("VacationDetailID", ID);
                        ReportParameter     VacationID       = new ReportParameter("VacationID", VacationDetail.Vacation.VacationID.ToString());
                        if (VacationDetail.VacationAction.VacationActionID == (int)VacationsActionsEnum.Add)
                        {
                            strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "VacationDetailCreation", VacationDetailID);
                        }
                        //else if (VacationDetail.Vacation.VacationType == VacationsTypesEnum.Normal)
                        //    strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "NormalVacation", VacationDetailID, EmployeeName);
                        else
                        {
                            strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "VacationDetailAction", VacationDetailID);
                        }
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.Scholarships.ToString()))
                    {
                        ScholarshipsDetailsBLL ScholarshipDetails  = new ScholarshipsDetailsBLL().GetScholarshipsDetailsByScholarshipDetailID(int.Parse(ID));
                        ReportParameter        ScholarshipDetailID = new ReportParameter("ScholarshipDetailID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "ScholarshipByScholarshipDetailID", ScholarshipDetailID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.VacationsByEndOfService.ToString()))
                    {
                        string TotalAvailableVacationBalance = "", TotalConsumedBalance = "", TotalRemainingBalance = "", TotalRemainingAvailableVacationBalance = "";
                        GetVacationBalances(ID, out TotalAvailableVacationBalance, out TotalConsumedBalance, out TotalRemainingBalance, out TotalRemainingAvailableVacationBalance);
                        ReportParameter EndOfServiceID                           = new ReportParameter("EndOfServiceID", ID);
                        ReportParameter PRTotalAvailableVacationBalance          = new ReportParameter("TotalAvailableVacationBalance", TotalAvailableVacationBalance);
                        ReportParameter PRTotalConsumedBalance                   = new ReportParameter("TotalConsumedBalance", TotalConsumedBalance);
                        ReportParameter PRTotalRemainingBalance                  = new ReportParameter("TotalRemainingBalance", TotalRemainingBalance);
                        ReportParameter PRTotalRemainingAvailableVacationBalance = new ReportParameter("TotalRemainingAvailableVacationBalance", TotalRemainingAvailableVacationBalance);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "NormalVacationsByEOS", EndOfServiceID, PRTotalAvailableVacationBalance, PRTotalConsumedBalance, PRTotalRemainingBalance, PRTotalRemainingAvailableVacationBalance);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.EmployeeCareerHistoryByEndOfService.ToString()))
                    {
                        ReportParameter EndOfServiceID = new ReportParameter("EndOfServiceID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "EmployeeCareerHistoryByEOS", EndOfServiceID);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.StopWork.ToString()))
                    {
                        ReportParameter StopWorkID = new ReportParameter("StopWorkID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "StopWork", StopWorkID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.InsteadDeportations.ToString()))
                    {
                        ReportParameter InsteadDeportationID = new ReportParameter("InsteadDeportationID", ID);
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "InsteadDeportation", InsteadDeportationID, EmployeeName);
                    }
                    else if (Type.Equals(BusinessSubCategoriesEnum.ChangeLogs.ToString()))
                    {
                        ReportParameter EmployeeCodeID       = new ReportParameter("EmployeeCodeID", ID);
                        ReportParameter BusinssSubCategoryID = new ReportParameter("BusinssSubCategoryID", Request.QueryString["BusinssSubCategoryID"].ToString());
                        ReportParameter StartDate            = new ReportParameter("StartDate", Globals.Calendar.UmAlquraToGreg(Request.QueryString["StartDate"].ToString()));
                        ReportParameter EndDate = new ReportParameter("EndDate", Globals.Calendar.UmAlquraToGreg(Request.QueryString["EndDate"].ToString()));
                        strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "ChangeLogs", EmployeeCodeID, BusinssSubCategoryID, StartDate, EndDate);
                    }
                    //else if (Type.Equals(BusinessSubCategoriesEnum.SickVacationsPaidAmount.ToString()))
                    //{
                    //    strFileName = RSM.ReportCalling(ReportViewerControl.RViewer, "SickVacationsPaidAmount");
                    //}

                    if (!string.IsNullOrEmpty(strFileName))
                    {
                        Response.Redirect(strFileName, false);
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }