Exemple #1
0
        public ActionResult Index()
        {
            QueryCRMVehicleViewModel vi = new QueryCRMVehicleViewModel();

            vi.SearchCondition = new CRMVehicleSearchCondition();
            vi.PageIndex       = 0;
            vi.PageCount       = 0;
            vi.ShowEditButton  = false;
            //特殊操作
            if (base.UserInfo.ProjectRoleID == 28 || base.UserInfo.ProjectRoleID == 1)
            {
                vi.ShowEditButton = true;
            }
            var getCRMVehicleByConditionResponse = new VehicleManagementService().GetCRMVehicleByCondition(new GetCRMVehicleByConditionRequest()
            {
                SearchCondition = vi.SearchCondition,
                PageSize        = UtilConstants.PAGESIZE,
                PageIndex       = vi.PageIndex,
            });

            if (getCRMVehicleByConditionResponse.IsSuccess)
            {
                vi.CRMVehicleCollection = getCRMVehicleByConditionResponse.Result.CRMVehicleCollection;
                vi.UserID    = base.UserInfo.ID.ToString();
                vi.PageIndex = getCRMVehicleByConditionResponse.Result.PageIndex;
                vi.PageCount = getCRMVehicleByConditionResponse.Result.PageCount;
            }
            return(View(vi));
        }
Exemple #2
0
        public ActionResult Create(string id, int?ViewType)
        {
            QueryCRMVehicleViewModel vi = new QueryCRMVehicleViewModel();

            if (string.IsNullOrEmpty(id))
            {
                //CRMVehicle v = new CRMVehicle();
                //v.CarBodyPhoto = Guid.NewGuid().ToString();
                //v.CarFrontPhoto = Guid.NewGuid().ToString();
                //v.CarBackPhoto = Guid.NewGuid().ToString();
                //v.CarFloorPhoto = Guid.NewGuid().ToString();
                //vi.CRMVehicle = v;
                vi.ViewType = 0;
            }
            else
            {
                if (ViewType == 1)
                {
                    var response = new VehicleManagementService().GetSearchVehicle(id);
                    vi.CRMVehicle = response;
                    vi.ViewType   = 1;
                }
                else
                {
                    var response = new VehicleManagementService().GetSearchVehicle(id);
                    vi.CRMVehicle = response;
                    vi.ViewType   = 0;
                }
            }


            return(View(vi));
        }
Exemple #3
0
        public ActionResult Index(QueryCRMVehicleViewModel vi, int?index, string Action)
        {
            //查询导出
            var request = new GetCRMVehicleByConditionRequest();

            if (Action == "查询" || Action == "Index")
            {
                request.SearchCondition = vi.SearchCondition;
                request.PageSize        = UtilConstants.PAGESIZE;
                request.PageIndex       = vi.PageIndex;
                vi.ShowEditButton       = false;
                //特殊操作
                if (base.UserInfo.ProjectRoleID == 28 || base.UserInfo.ProjectRoleID == 1)
                {
                    vi.ShowEditButton = true;
                }
            }
            else if (Action == "导出")
            {
                request.SearchCondition = vi.SearchCondition;
                request.PageSize        = 0;
                request.PageIndex       = 0;
            }
            var response = new VehicleManagementService().GetCRMVehicleByCondition(request);

            if (response.IsSuccess)
            {
                if (Action == "导出")
                {
                    return(this.Export(response.Result.CRMVehicleCollection));
                }
                else
                {
                    vi.CRMVehicleCollection = response.Result.CRMVehicleCollection;
                    vi.PageIndex            = response.Result.PageIndex;
                    vi.PageCount            = response.Result.PageCount;
                }
            }
            return(View(vi));
        }
Exemple #4
0
        public ActionResult Create(QueryCRMVehicleViewModel vi)
        {
            //string uploadFolderPath = Runbow.TWS.Common.Constants.UPLOAD_FOLDER_PATH;
            //string targetPath = Path.Combine(uploadFolderPath, "AMSTempFile");
            //string url = string.Empty, actualNameInServer = string.Empty, ext = string.Empty;
            if (vi.ViewType == 1)
            {
                vi.CRMVehicle.CreateUser = base.UserInfo.ID.ToString();
                vi.CRMVehicle.CreateTime = DateTime.Now;
            }
            vi.CRMVehicle.UpdateUser = base.UserInfo.ID.ToString();
            vi.CRMVehicle.UpdateTime = DateTime.Now;

            var response = new VehicleManagementService().addCreateVehicle(new GetCRMVehicleByConditionRequest()
            {
                CreateFiles = vi.CRMVehicle
                              //base.UserInfo.Name
            });

            vi.ViewType = 1;
            return(View(vi));
        }