Ejemplo n.º 1
0
        public ActionResult GetAssetCashflowDataTable(string projectGuid, string paymentDay)
        {
            return(ActionUtils.Json(() =>
            {
                if (string.IsNullOrWhiteSpace(paymentDay))
                {
                    var errorResult = new
                    {
                        isError = true,
                        errorMessage = "请选择偿付期"
                    };
                    return ActionUtils.Success(errorResult);
                }

                DateTime paymentDate;
                if (!DateTime.TryParse(paymentDay, out paymentDate))
                {
                    var errorResult = new
                    {
                        isError = true,
                        errorMessage = "偿付期错误,请刷新页面后重试"
                    };
                    return ActionUtils.Success(errorResult);
                }

                var handler = new TaskExAssetCashflow(CurrentUserName, null);
                var viewModel = new AssetCashflowStatisticInfo();
                var result = handler.GetACFTableByProject(viewModel, projectGuid, paymentDate);

                return ActionUtils.Success(result);
            }));
        }
Ejemplo n.º 2
0
        public ActionResult ConfirmAssetCashflow(string shortCode)
        {
            return(ActionUtils.Json(() =>
            {
                var handler = new TaskExAssetCashflow(CurrentUserName, shortCode);
                handler.ConfirmAssetCashflow();

                return ActionUtils.Success("");
            }));
        }
Ejemplo n.º 3
0
        public ActionResult GetAssetCashflowFile(string projectGuid, string paymentDay)
        {
            return(ActionUtils.Json(() =>
            {
                CommUtils.Assert(!string.IsNullOrWhiteSpace(paymentDay), "请选择偿付期");

                DateTime paymentDate;
                CommUtils.Assert(DateTime.TryParse(paymentDay, out paymentDate), "偿付期错误,请刷新页面后重试");

                var handler = new TaskExAssetCashflow(CurrentUserName, null);
                var ms = handler.GetACFTableFileByProject(projectGuid, paymentDate);

                var resource = ResourcePool.RegisterMemoryStream(CurrentUserName, "AssetCashflowTable.csv", ms);
                return ActionUtils.Success(resource.Guid);
            }));
        }