Exemple #1
0
        public ActionResult ExportTo(string name)
        {
            switch (name)
            {
            case "GridViewWorks":
                MySession.Current.TabAction = name;
                //MySession.Current.Units = dbWUnits.Units.ToList();

                return(GridViewExtension.ExportToPdf(
                           ExportDataGridView.GetGridSettings(name, Resources.Resource.Works),
                           BLWorkers.Works.GetWorkerWorksModel().WorksList.ToList()));

            case "GridViewPayments":
                MySession.Current.TabAction    = name;
                MySession.Current.Works        = BLWorkers.Works.GetWorkerWorksModel().WorksList.ToList();
                MySession.Current.PaymentTypes = BLWorkers.WorkerPayment.GetPaymentTypeList();

                return(GridViewExtension.ExportToPdf(
                           ExportDataGridView.GetGridSettings(name, Resources.Resource.Payments),
                           BLWorkers.WorkerPayment.GetWorkerPaymentModel(dbWorks, dbWorkerPayment).WorkerPayments.ToList()));


            default:
                var modelToShow = dbWorks.Works.ToList().Where(x => x.object_id == MySession.Current.ObjectId);
                return(GridViewExtension.ExportToPdf(
                           ExportDataGridView.GetGridSettings(name, string.Empty), modelToShow.ToList()));
            }
        }
Exemple #2
0
        public ActionResult ExportTo(string name)
        {
            switch (name)
            {
            case "GridViewWorks":
                MySession.Current.TabAction = name;
                MySession.Current.Units     = dbUnits.Units.ToList();

                return(GridViewExtension.ExportToPdf(
                           ExportDataGridView.GetGridSettings(name, Resources.Resource.Works),
                           BLObject.ObjectWorks.GetObjectWorkModel().ObjectWorksList.ToList()));

            case "GridViewMaterial":
                MySession.Current.TabAction = name;
                var materials = BLObject.ObjectMaterial.GetObjectMaterialModel().ObjectMaterialList;

                return(GridViewExtension.ExportToPdf(
                           ExportDataGridView.GetGridSettings(name, Resources.Resource.Materials), materials));

            case "GridViewExtra":
                MySession.Current.TabAction = name;
                var extras = BLObject.ObjectExtra.GetObjectExtraModel().ObjectExtraList;

                return(GridViewExtension.ExportToPdf(
                           ExportDataGridView.GetGridSettings(name, Resources.Resource.Extras), extras));

            case "GridViewPayment":
                MySession.Current.TabAction = name;
                var payment = dbObjectPayments.ObjectPayments.ToList().Where(x => x.object_id == MySession.Current.ObjectId);

                return(GridViewExtension.ExportToPdf(
                           ExportDataGridView.GetGridSettings(name, Resources.Resource.Payments), payment.ToList()));

            case "GridViewInstrument":
                MySession.Current.TabAction = name;
                var instruments = BLObject.ObjectInstrument.GetObjectInstrumentModel();

                return(GridViewExtension.ExportToPdf(
                           ExportDataGridView.GetGridSettings(name, Resources.Resource.Instruments), instruments));

            default:
                var modelToShow = dbWorks.Works.ToList().Where(x => x.object_id == MySession.Current.ObjectId);
                return(GridViewExtension.ExportToPdf(
                           ExportDataGridView.GetGridSettings(name, string.Empty), modelToShow.ToList()));
            }
        }