public IHttpActionResult Login(string UserName, string PassWord) { UserEntity loginUser = null; bool isHaveException = false; string errorMess = ""; try { loginUser = UserCode.Login(UserName, PassWord); } catch (Exception ex) { isHaveException = true; errorMess = ex.ToString(); } var result = ApiBackParameter <string> .Get((api) => { if (loginUser == null || isHaveException) { api.StatusCode = StatusCodeEnum.失败.GetIntValue(); api.Message = errorMess; } else { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = loginUser.F_Id; api.Message = "登录成功!"; } }); return(Ok(result)); }
public IHttpActionResult Get(string cityId) { var result = ApiBackParameter <List <ApiProfileCountyContracts> > .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = CountyCode.GetProfileCountyEntitys(cityId); }); return(Ok(result)); }
public IHttpActionResult Get() { var result = ApiBackParameter <List <ApiProjectContracts> > .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = ProjectCode.GetProject(); }); return(Ok(result)); }
public IHttpActionResult Post(ApiDeductUploadContracts entity) { bool state = this.code.InsertDeductIns(entity); var result = ApiBackParameter <bool> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = state; }); return(Ok(result)); }
public IHttpActionResult GetWorkItemByCarId(string CarId) { var data = Code.GetWorkItem(CarWhereType.CarId, CarId); var result = ApiBackParameter <ApiCarWorkItem[]> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult UploadImage(UploadImageContr model) { var data = this.code.UploadDeductImage(model.base64ImageCode, model.DeductId); var result = ApiBackParameter <string> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult GetClassify(string entryId) { var data = code.GetCheckingPointClassification(entryId); var result = ApiBackParameter <List <ApiCheckingPointTypeContracts> > .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult oldPost(ApiDeductUploadContracts entity) { string data = code.oudInsertDeductIns(entity); var result = ApiBackParameter <string> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult Get(string ProjectId) { var checkPoints = code.GetCheckingPoint(ProjectId); var result = ApiBackParameter <List <ApiCheckingPointContracts> > .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = checkPoints; }); return(Ok(result)); }
public IHttpActionResult Put(string deducInsId, ApiDeductUploadContracts entity) { string data = code.UpdateDeductIns(deducInsId, entity); var result = ApiBackParameter <string> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult PostFixedPoint(string taskEntry, string noFiexInfo) { bool state = code.PerfectFixedPoint(taskEntry, noFiexInfo); var result = ApiBackParameter <bool> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = state; }); return(Ok(result)); }
public IHttpActionResult GetWorkShift(string keyWord) { var data = Code.GetWorkShift(null, keyWord); var result = ApiBackParameter <string[]> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult Get(string taskEntryId, string SCNormId) { var data = code.GetDeductDetails(taskEntryId, SCNormId); var result = ApiBackParameter <ApiDeductAccordingContracts[]> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult Delete(string deducInsId) { bool state = code.DeleteDeductIns(deducInsId); var result = ApiBackParameter <bool> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = state; }); return(Ok(result)); }
public IHttpActionResult Get(string taskEntryId, string typeId) { var data = code.GetScoringCriteriaAndRecord(taskEntryId, typeId); var result = ApiBackParameter <ApiScoringCriteriaClassifyContracts[]> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult GetCarId() { var data = Code.GetCarId(null, string.Empty); var result = ApiBackParameter <ApiKeyValue <string, string>[]> .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult Get(int CheckPointCode) { var chekPoint = (CheckPointTypeEnum)CheckPointCode; var data = code.GetCheckingPointClassification(chekPoint); var result = ApiBackParameter <List <ApiCheckingPointClassification> > .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult GetCompletedTask(string userId, string entryId, string typeId) { int ProfileTaskEntryType = -1; var data = code.GetTask(userId, entryId, typeId, NFine.Domain.Enums.ProfileTaskStateEnum.HavePutAnEndTo, out ProfileTaskEntryType); int isCarTask = 0; //越加约乱 移动端那边要这样返回数据,日后整理此处 ,这样写太垃圾代码 switch (ProfileTaskEntryType) { case (int)NFine.Domain.Enums.ProfileTaskEntryTypeEnum.Car: isCarTask = 1; break; default: break; } var result = ApiBackParameter <Contracts.ApiTaskDataEntryContracts[]> .Get((api) => { if (data == null) { api.StatusCode = StatusCodeEnum.失败.GetIntValue(); api.Data = data; //暂时这样做,移动端要这样的数据 api.Message = isCarTask.ToString(); } else { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; //暂时这样做,移动端要这样的数据 api.Message = isCarTask.ToString(); } }); return(Ok(result)); }
public IHttpActionResult GetUserInfo(string UserId) { var userEntity = UserCode.GetUserInfo(UserId); var result = ApiBackParameter <UserEntity> .Get((api) => { if (userEntity == null) { api.StatusCode = StatusCodeEnum.失败.GetIntValue(); api.Message = "查找失败!"; } else { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = userEntity; api.Message = "查找成功!"; } }); return(Ok(result)); }
public IHttpActionResult GetWorkShift(int pageSize, int pageIndex, string keyWord = null) { Nfine.WebApi.Contracts.ApiPagination pagination = null; pagination = new Contracts.ApiPagination() { page = (int)pageIndex, rows = (int)pageSize }; var data = new ApiPaginationData <string[]>() { Data = Code.GetWorkShift(pagination, keyWord), Pagination = pagination }; var result = ApiBackParameter <ApiPaginationData <string[]> > .Get((api) => { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; }); return(Ok(result)); }
public IHttpActionResult Get(string userId, int checkPointCode) { var type = (CheckPointClassificationEnum)checkPointCode; bool isHaveErrpr = false; string errorMessage = string.Empty; Contracts.ApiWayContracts[] data = null; switch (type) { case CheckPointClassificationEnum.特级道路: case CheckPointClassificationEnum.一级道路: case CheckPointClassificationEnum.二级道路: case CheckPointClassificationEnum.级道路: case CheckPointClassificationEnum.背街小巷: try { data = code.GetWayTask(userId, type); } catch (Exception ex) { isHaveErrpr = true; errorMessage = ex.ToString(); } break; case CheckPointClassificationEnum.沿街箱房: break; case CheckPointClassificationEnum.非沿街箱房: break; case CheckPointClassificationEnum.沿街压缩站: break; case CheckPointClassificationEnum.非沿街压缩站: break; case CheckPointClassificationEnum.一类公厕: break; case CheckPointClassificationEnum.二类公厕: break; case CheckPointClassificationEnum.类公厕: break; case CheckPointClassificationEnum.倒粪站小便池: break; case CheckPointClassificationEnum.机扫车: break; case CheckPointClassificationEnum.冲洗车: break; case CheckPointClassificationEnum.清运车: break; case CheckPointClassificationEnum.电动机具: break; case CheckPointClassificationEnum.绿化带: break; case CheckPointClassificationEnum.绿色账户小区: break; default: break; } var result = ApiBackParameter <Contracts.ApiWayContracts[]> .Get((api) => { if (isHaveErrpr) { api.StatusCode = StatusCodeEnum.失败.GetIntValue(); api.Message = errorMessage; } else { api.StatusCode = StatusCodeEnum.成功.GetIntValue(); api.Data = data; } }); return(Ok(result)); }