public JsonResult PageList([FromForm] string token, [FromForm] int userId = -1, [FromForm] int caseTagId = -1, [FromForm] int pageNumber = 1, [FromForm] int pageSize = 10) { DataResult dr = new DataResult(); try { CaseBLL caseBLL = new CaseBLL(); int totalItemCount = caseBLL.Count(caseTagId, userId: userId); List <CaseEntity> caseEntities = caseBLL.List(caseTagId, userId: userId, pageNumber: pageNumber, pageSize: pageSize, totalCount: totalItemCount); UserEntity userEntity = this.GetUserByToken(token); caseEntities = CaseListEndorseCountByList(caseEntities, userEntity.userId); caseEntities = CaseListCommentCountByList(caseEntities); PageData pageData = new PageData(caseEntities, pageNumber, pageSize, totalItemCount); dr.code = "200"; dr.data = pageData; } catch (Exception ex) { dr.code = "999"; dr.msg = ex.Message; } return(Json(dr)); }
private void GetTotalRecords() { List <SearchRow> SearchRowsList = Session["SearchRowsList"] as List <SearchRow>; string where = "(" + new SearchBLL().GetSearchSql(SearchRowsList) + ")" + BasicFilter; if (SearchType == Common.Tools.CaseTableType) { this.lblTitle.Text = CompanyName + " : 案件记录"; TotalRecords = new CaseBLL(int.Parse(CompanyID)).GetCaseTotalItems(where).ToString(); } else if (SearchType == Common.Tools.BalanceTableType) { this.lblTitle.Text = CompanyName + " : 余额记录"; TotalRecords = new BalanceBLL(int.Parse(CompanyID)).GetBalanceTotalItems(where).ToString(); } else if (SearchType == Common.Tools.PaymentTableType) { this.lblTitle.Text = CompanyName + " : 每日还款记录"; TotalRecords = new PaymentBLL(int.Parse(CompanyID)).GetPaymentTotalItems(where).ToString(); } PagingControl1.TotalRecords = int.Parse(TotalRecords); }
public JsonResult List([FromForm] string token, [FromForm] TypeEnumEntity.TypeEnum typeId) { DataResult dr = new DataResult(); try { EnshrineBLL enshrineBLL = new EnshrineBLL(); List <EnshrineEntity> enshrineEntities = new List <EnshrineEntity>(); UserEntity userEntity = this.GetUserByToken(token); enshrineEntities = enshrineBLL.ListByUserId(userEntity.userId, (int)typeId); CaseBLL caseBLL = new CaseBLL(); int[] caseIdInts = enshrineEntities.Where(it => it.typeId == (int)TypeEnumEntity.TypeEnum.案例).Select(it => it.objId).ToArray(); if (caseIdInts.Count() > 0) { List <CaseEntity> caseEntities = caseBLL.ListByCaseIdInts(caseIdInts); if (caseEntities.Count > 0) { caseEntities = CaseListEndorseCountByList(caseEntities, userEntity.userId); caseEntities = CaseListCommentCountByList(caseEntities); caseEntities.ForEach(it => { enshrineEntities.Find(itt => itt.typeId == (int)TypeEnumEntity.TypeEnum.案例 && itt.objId == it.caseId).caseEntity = it; }); } } int[] caseOfficialIdInts = enshrineEntities.Where(it => it.typeId == (int)TypeEnumEntity.TypeEnum.官方案例).Select(it => it.objId).ToArray(); if (caseOfficialIdInts.Count() > 0) { List <CaseOfficialEntity> caseOfficialEntities = caseBLL.ListByCaseOfficialIdInts(caseOfficialIdInts); if (caseOfficialEntities.Count > 0) { caseOfficialEntities = CaseOfficialEndorseCountByList(caseOfficialEntities, userEntity.userId); caseOfficialEntities = CaseOfficialCommentCountByList(caseOfficialEntities); caseOfficialEntities.ForEach(it => { enshrineEntities.Find(itt => itt.typeId == (int)TypeEnumEntity.TypeEnum.官方案例 && itt.objId == it.caseOfficialId).caseOfficialEntity = it; }); } } dr.code = "200"; dr.data = enshrineEntities; } catch (Exception ex) { dr.code = "999"; dr.msg = ex.Message; } return(Json(dr)); }
public ApplicationManager() { ApplicationBLL = new ApplicationBLL(); CustomerBLL = new CustomerBLL(); CaseBLL = new CaseBLL(); CollectionBLL = new CollectionBLL(); StatusBLL = new StatusBLL(); }
public JsonResult Delete([FromForm] string token, [FromForm] int caseId) { DataResult dr = new DataResult(); try { if (caseId < 10000) { dr.code = "201"; dr.msg = "参数错误"; return(Json(dr)); } CaseBLL caseBLL = new CaseBLL(); CaseEntity caseEntity = caseBLL.GetById(caseId); if (caseEntity == null) { dr.code = "201"; dr.msg = "不存在该说说"; return(Json(dr)); } UserEntity userEntity = this.GetUserByToken(token); if (caseEntity.userId != userEntity.userId) { dr.code = "201"; dr.msg = "不是该用户的说说"; return(Json(dr)); } caseEntity.isDel = true; caseEntity.modifyDate = DateTime.Now; int rows = caseBLL.ActionDal.ActionDBAccess.Updateable(caseEntity).ExecuteCommand(); //增加阅读记录 ReadBLL readBLL = new ReadBLL(); readBLL.Create(userEntity.userId, (int)Entity.TypeEnumEntity.TypeEnum.案例, caseId); if (rows > 0) { dr.code = "200"; dr.msg = "成功"; } else { dr.code = "201"; dr.msg = "失败"; } } catch (Exception ex) { dr.code = "999"; dr.msg = ex.Message; } return(Json(dr)); }
//private void bind1() //{ // string where = "PatchID=" + PatchID; // DataSet ds = new CaseBLL(int.Parse(CompanyID)).GetCasePagingitems(this.PagingControl1.ListRecordNumPerPage, this.PagingControl1.CurrentPage, where); // if (ds != null) // { // CompanyAllReadUserDS = BLL.ReadCaseUsersBLL.GetReadCaseUsersList("CompanyID=" + CompanyID); // this.GridView1.DataSource = ds; // this.GridView1.DataBind(); // } //} private DataSet GetDataGridSource() { // string where = "PatchID=" + PatchID; DataSet ds = new CaseBLL(int.Parse(CompanyID)).GetCasePagingitems(this.PagingControl1.ListRecordNumPerPage, this.PagingControl1.CurrentPage, SearchWhere); return(ds); }
private void GetTotalRecords(string where) { int total = new CaseBLL(int.Parse(CompanyID)).GetCaseTotalItems(where); spanTotal.InnerText = total.ToString(); PagingControl1.TotalRecords = total; }
public ICase Create(string appId, string type, string text) { IStatus status = StatusBLL.Get(appId); status = status == null ? StatusBLL.Create(appId, JobStatus.HasCase.ToLabel()) : StatusBLL.Update(status, JobStatus.HasCase.ToLabel()); return(CaseBLL.Create(appId, type, text)); }
/// <summary> /// 列表页面 /// </summary> /// <param name="searchString"></param> /// <param name="page"></param> /// <returns></returns> public IActionResult List(string searchString, int?page) { ViewBag.searchString = string.IsNullOrWhiteSpace(searchString) ? "" : searchString; int pageNumber = (page ?? 1); int pageSize = 15; CaseBLL caseBLL = new CaseBLL(); IPagedList <CaseEntity> caseEntities = caseBLL.AdminPageList(pageNumber, pageSize, searchString); return(View(caseEntities)); }
/// <summary> /// 详细页面 /// </summary> /// <param name="id"></param> /// <returns></returns> public IActionResult Detail(int id) { CaseBLL caseBLL = new CaseBLL(); CaseEntity caseEntity = caseBLL.GetById(id); CaseTagCorrelationBLL caseTagCorrelationBLL = new CaseTagCorrelationBLL(); caseEntity.caseTagEntities = caseTagCorrelationBLL.CaseTagListByCaseId(caseEntity.caseId); CaseStepBLL caseStepBLL = new CaseStepBLL(); caseEntity.caseStepEntities = caseStepBLL.ListByCaseId(caseEntity.caseId); return(View(caseEntity)); }
private void ReloadGridList() { string where = "PatchID=" + PatchID; GetTotalRecords(where); this.PagingControl1.CurrentPage = 1; DataSet ds = new CaseBLL(int.Parse(CompanyID)).GetCasePagingitems(this.PagingControl1.ListRecordNumPerPage, this.PagingControl1.CurrentPage, where); this.GridView1.DataSource = ds; this.GridView1.DataSource = ds; CompanyAllReadUserDS = BLL.ReadCaseUsersBLL.GetReadCaseUsersList("CompanyID=" + CompanyID); this.GridView1.DataBind(); GetTotalNum(ds); }
public JsonResult GetById([FromForm] string token, [FromForm] int caseId) { DataResult dr = new DataResult(); try { CaseBLL caseBLL = new CaseBLL(); CaseEntity caseEntity = caseBLL.GetById(caseId); CommentBLL commentBLL = new CommentBLL(); caseEntity.commentCount = commentBLL.ListByTypeAndObjId((int)Entity.TypeEnumEntity.TypeEnum.案例, caseEntity.caseId).Count(); EndorseBLL endorseBLL = new EndorseBLL(); List <EndorseEntity> endorseEntities = endorseBLL.ListByTypeAndObjId((int)Entity.TypeEnumEntity.TypeEnum.案例, caseEntity.caseId); caseEntity.endorseCount = endorseEntities.Count(); UserEntity userEntity = new UserEntity(); if (!string.IsNullOrWhiteSpace(token)) { userEntity = this.GetUserByToken(token); if (endorseEntities.ToList().Exists(it => it.userId == userEntity.userId)) { caseEntity.isEndorse = true; } } CaseStepBLL caseStepBLL = new CaseStepBLL(); caseEntity.caseStepEntities = caseStepBLL.ListByCaseId(caseEntity.caseId); CaseTagCorrelationBLL caseTagCorrelationBLL = new CaseTagCorrelationBLL(); caseEntity.caseTagEntities = caseTagCorrelationBLL.CaseTagListByCaseId(caseEntity.caseId); dr.code = "200"; dr.data = caseEntity; } catch (Exception ex) { dr.code = "999"; dr.msg = ex.Message; } return(Json(dr)); }
public IApplication Delete(string id) { IApplication app = ApplicationBLL.Get(id); if (app != null) { app = ApplicationBLL.Delete(app); } ICase c = CaseBLL.Get(id); if (c != null) { c = CaseBLL.Delete(c); } ICollection col = CollectionBLL.Get(id); if (col != null) { col = CollectionBLL.Delete(col); } return(app); }
private DataSet GetDataGridSource() { List <SearchRow> SearchRowsList = Session["SearchRowsList"] as List <SearchRow>; string where = "(" + new SearchBLL().GetSearchSql(SearchRowsList) + ")" + BasicFilter; DataSet ds = null; if (SearchType == Common.Tools.CaseTableType) { ds = new CaseBLL(int.Parse(CompanyID)).GetCasePagingitems(this.PagingControl1.ListRecordNumPerPage, this.PagingControl1.CurrentPage, where); } else if (SearchType == Common.Tools.BalanceTableType) { ds = new BalanceBLL(int.Parse(CompanyID)).GetBalancePagingitems(this.PagingControl1.ListRecordNumPerPage, this.PagingControl1.CurrentPage, where); } else if (SearchType == Common.Tools.PaymentTableType) { ds = new PaymentBLL(int.Parse(CompanyID)).GetPaymentPagingitems(this.PagingControl1.ListRecordNumPerPage, this.PagingControl1.CurrentPage, where); } if (ds == null || ds.Tables[0].Rows.Count == 0) { spanExcel.Style.Add("display", "none"); } else { DataSet reportDs = ds.Copy(); AdoptToExcelFormat(reportDs); ChangeColumnTitle(reportDs); Session["ExportData"] = reportDs; ChangeColumnTitle(ds); } return(ds); }
public void Dispose() { _caseBLL = null; _applicationBLL = null; StatusBLL = null; }
public CaseManager() { _caseBLL = new CaseBLL(); _applicationBLL = new ApplicationBLL(); StatusBLL = new StatusBLL(); }
public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "TodoCase"); if (!loginUser.Pass)//权限验证 { return; } CaseBLL bll = new CaseBLL(context, loginUser); if (context.Request["action"] == "caseGridLoad") { //加载DataGrid int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string tbCaseId = context.Request["tbCaseId"]; string tbCaseReason = context.Request["tbCaseReason"]; string openDateFrom = context.Request["openDateFrom"]; string openDateTo = context.Request["openDateTo"]; string closeDateFrom = context.Request["closeDateFrom"]; string closeDateTo = context.Request["closeDateTo"]; string caseState = context.Request["caseState"]; string caseCarNo = context.Request["caseCarNo"]; string caseType = context.Request["caseType"]; bll.LoadGrid(page, rows, tbCaseId, tbCaseReason, openDateFrom, openDateTo, closeDateFrom, closeDateTo, caseState, caseCarNo, caseType, 1); } else if (context.Request["action"] == "stationListLoad") { Combobox com = new Combobox(context, loginUser); com.StationCombobox(); } else if (context.Request["action"] == "treeLoad") { var caseId = context.Request["caseId"]; bll.LoadTree(caseId); } else if (context.Request["action"] == "load") { var caseId = context.Request["caseId"]; //加载信息 bll.Load(caseId); } else if (context.Request["action"] == "enforcementNameGridLoad") { var caseId = context.Request["caseId"]; var typeId = context.Request["typeId"]; if (!string.IsNullOrEmpty(typeId) && !string.IsNullOrEmpty(caseId)) { bll.LoadEnforcementGridByTypeId(caseId, typeId); } else if (!string.IsNullOrEmpty(caseId)) { bll.LoadEnforcementGrid(caseId); } } else if (context.Request["action"] == "readOnlyTreeLoad") { var caseId = context.Request["caseId"]; bll.ReadOnlyTreeLoad(caseId); } } catch (Exception e) { Message.error(context, e.Message); } }
/// <summary> /// 打赏案例 /// </summary> /// <param name="userEntity"></param> /// <param name="caseId"></param> /// <returns></returns> private DataResult SponsorCase(UserEntity userEntity, int caseId) { DataResult dr = new DataResult(); CaseBLL caseBLL = new CaseBLL(); CaseEntity caseEntity = caseBLL.GetById(caseId); if (caseEntity.isDel) { dr.code = "201"; dr.msg = "说说已被删除"; return(dr); } if (caseEntity.userId < 10000) { dr.code = "201"; dr.msg = "无主案例"; return(dr); } var result = caseBLL.ActionDal.ActionDBAccess.Ado.UseTran(() => { //积分减1 userEntity.integral = userEntity.integral - 1; var rows1 = caseBLL.ActionDal.ActionDBAccess.Updateable(userEntity).ExecuteCommand(); IntegralDetailEntity integralDetailEntity = new IntegralDetailEntity() { createDate = DateTime.Now, integral = -1, isDel = false, modifyDate = DateTime.Now, objId = caseId, type = (int)Entity.TypeEnumEntity.TypeEnum.案例, userId = userEntity.userId }; var rows2 = caseBLL.ActionDal.ActionDBAccess.Insertable(integralDetailEntity).ExecuteCommand(); //积分加1 UserEntity user = caseBLL.ActionDal.ActionDBAccess.Queryable <UserEntity>().Where(it => it.userId == caseEntity.userId).First(); user.integral = user.integral + 1; var rows3 = caseBLL.ActionDal.ActionDBAccess.Updateable(user).ExecuteCommand(); IntegralDetailEntity integralDetail = new IntegralDetailEntity() { createDate = DateTime.Now, integral = 1, isDel = false, modifyDate = DateTime.Now, objId = caseId, type = (int)Entity.TypeEnumEntity.TypeEnum.案例, userId = user.userId }; var rows4 = caseBLL.ActionDal.ActionDBAccess.Insertable(integralDetail).ExecuteCommand(); caseEntity.integral = caseEntity.integral + 1; var rows5 = caseBLL.ActionDal.ActionDBAccess.Updateable(caseEntity).ExecuteCommand(); }); //增加阅读记录 ReadBLL readBLL = new ReadBLL(); readBLL.Create(userEntity.userId, (int)Entity.TypeEnumEntity.TypeEnum.案例, caseId); if (result.IsSuccess) { dr.code = "200"; dr.msg = "成功"; } else { dr.code = "201"; dr.msg = "失败"; } return(dr); }
public JsonResult Attention([FromForm] string token, [FromForm] int pageNumber = 1, [FromForm] int pageSize = 10) { DataResult dr = new DataResult(); try { UserEntity userEntity = this.GetUserByToken(token); FansBLL fansBLL = new FansBLL(); List <FansUserResult> fansUserResults = fansBLL.AttentionList(userEntity.userId); if (fansUserResults.Count < 1) { dr.code = "200"; dr.data = new PageData(null, pageNumber, pageSize, 0); dr.msg = "未关注任何人"; return(Json(dr)); } CaseBLL caseBLL = new CaseBLL(); ShareBLL shareBLL = new ShareBLL(); CaseOfficialBLL caseOfficialBLL = new CaseOfficialBLL(); int[] userIdInts = fansUserResults.Select(it => it.userId).ToArray(); int caseCount = caseBLL.CountByUserIdInts(userIdInts); int shareCount = shareBLL.CountByUserIdInts(userIdInts); int caseOfficialCount = caseOfficialBLL.CountByUserIdInts(userIdInts); int totalItemCount = caseCount + shareCount + caseOfficialCount; List <CircleResultHelper> circleResultHelpers = caseBLL.CaseAndShareList(pageNumber: pageNumber, pageSize: pageSize, totalCount: totalItemCount, userIdInte: userIdInts); List <CaseEntity> caseEntities = circleResultHelpers.Where(it => it.type == (int)Entity.TypeEnumEntity.TypeEnum.案例).Select(it => it.caseEntity).ToList(); if (caseEntities.Count > 0) { caseEntities = CaseListEndorseCountByList(caseEntities, userEntity.userId); caseEntities = CaseListCommentCountByList(caseEntities); caseEntities.ForEach(it => { circleResultHelpers.Find(itt => itt.id == it.caseId).caseEntity = it; }); } List <ShareEntity> shareEntities = circleResultHelpers.Where(it => it.type == (int)Entity.TypeEnumEntity.TypeEnum.说说).Select(it => it.shareEntity).ToList(); if (shareEntities.Count > 0) { shareEntities = ShareListEndorseCountByList(shareEntities, userEntity.userId); shareEntities = ShareListCommentCountByList(shareEntities); shareEntities.ForEach(it => { circleResultHelpers.Find(itt => itt.id == it.shareId).shareEntity = it; }); } List <CaseOfficialEntity> caseOfficialEntities = circleResultHelpers.Where(it => it.type == (int)Entity.TypeEnumEntity.TypeEnum.官方案例).Select(it => it.caseOfficialEntity).ToList(); if (caseOfficialEntities.Count > 0) { caseOfficialEntities = CaseOfficialEndorseCountByList(caseOfficialEntities, userEntity.userId); caseOfficialEntities = CaseOfficialCommentCountByList(caseOfficialEntities); caseOfficialEntities.ForEach(it => { circleResultHelpers.Find(itt => itt.id == it.caseOfficialId).caseOfficialEntity = it; }); } circleResultHelpers = (from crh in circleResultHelpers orderby crh.createDate descending select crh ).ToList(); PageData pageData = new PageData(circleResultHelpers, pageNumber, pageSize, totalItemCount); dr.code = "200"; dr.data = pageData; } catch (Exception ex) { dr.code = "999"; dr.msg = ex.Message; } return(Json(dr)); }
public JsonResult Newest([FromForm] string token, [FromForm] int pageNumber = 1, [FromForm] int pageSize = 10) { DataResult dr = new DataResult(); try { CaseBLL caseBLL = new CaseBLL(); ShareBLL shareBLL = new ShareBLL(); CaseOfficialBLL caseOfficialBLL = new CaseOfficialBLL(); int caseCount = caseBLL.Count(); int shareCount = shareBLL.Count(); int caseOfficialCount = caseOfficialBLL.Count(); int totalItemCount = caseCount + shareCount + caseOfficialCount; UserEntity userEntity = new UserEntity(); if (!string.IsNullOrWhiteSpace(token)) { userEntity = this.GetUserByToken(token); } List <CircleResultHelper> circleResultHelpers = caseBLL.CaseAndShareList(pageNumber: pageNumber, pageSize: pageSize, totalCount: totalItemCount, thisUserId: userEntity.userId > 10000 ? userEntity.userId : -1); List <CaseEntity> caseEntities = circleResultHelpers.Where(it => it.type == (int)Entity.TypeEnumEntity.TypeEnum.案例).Select(it => it.caseEntity).ToList(); if (caseEntities.Count > 0) { caseEntities = CaseListEndorseCountByList(caseEntities, userEntity.userId > 10000 ? userEntity.userId : -1); caseEntities = CaseListCommentCountByList(caseEntities); caseEntities.ForEach(it => { circleResultHelpers.Find(itt => itt.id == it.caseId).caseEntity = it; }); } List <ShareEntity> shareEntities = circleResultHelpers.Where(it => it.type == (int)Entity.TypeEnumEntity.TypeEnum.说说).Select(it => it.shareEntity).ToList(); if (shareEntities.Count > 0) { shareEntities = ShareListEndorseCountByList(shareEntities, userEntity.userId > 10000 ? userEntity.userId : -1); shareEntities = ShareListCommentCountByList(shareEntities); shareEntities.ForEach(it => { circleResultHelpers.Find(itt => itt.id == it.shareId).shareEntity = it; }); } List <CaseOfficialEntity> caseOfficialEntities = circleResultHelpers.Where(it => it.type == (int)Entity.TypeEnumEntity.TypeEnum.官方案例).Select(it => it.caseOfficialEntity).ToList(); if (caseOfficialEntities.Count > 0) { caseOfficialEntities = CaseOfficialEndorseCountByList(caseOfficialEntities, userEntity.userId > 10000 ? userEntity.userId : -1); caseOfficialEntities = CaseOfficialCommentCountByList(caseOfficialEntities); caseOfficialEntities.ForEach(it => { circleResultHelpers.Find(itt => itt.id == it.caseOfficialId).caseOfficialEntity = it; }); } circleResultHelpers = (from crh in circleResultHelpers orderby crh.createDate descending select crh ).ToList(); PageData pageData = new PageData(circleResultHelpers, pageNumber, pageSize, totalItemCount); dr.code = "200"; dr.data = pageData; } catch (Exception ex) { dr.code = "999"; dr.msg = ex.Message; } return(Json(dr)); }
public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "TodoCase"); if (!loginUser.Pass)//权限验证 { return; } CaseBLL bll = new CaseBLL(context, loginUser); if (context.Request["action"] == "caseGridLoad") { //加载DataGrid int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string tbCaseId = context.Request["tbCaseId"]; string tbCaseReason = context.Request["tbCaseReason"]; string openDateFrom = context.Request["openDateFrom"]; string openDateTo = context.Request["openDateTo"]; string closeDateFrom = context.Request["closeDateFrom"]; string closeDateTo = context.Request["closeDateTo"]; string caseState = context.Request["caseState"]; string caseCarNo = context.Request["caseCarNo"]; string caseType = context.Request["caseType"]; bll.LoadGrid(page, rows, tbCaseId, tbCaseReason, openDateFrom, openDateTo, closeDateFrom, closeDateTo, caseState, caseCarNo, caseType, 0); } else if (context.Request["action"] == "stationListLoad") { Combobox com = new Combobox(context, loginUser); com.StationCombobox(); } else if (context.Request["action"] == "load") { var caseId = context.Request["caseId"]; //加载信息 bll.Load(caseId); } else if (context.Request["action"] == "edit") { //修改 TBCase tbCase = new TBCase(); tbCase.CaseId = context.Request["CaseId"].ToString();// tbCase.CaseReason = context.Request["CaseReason"].ToString(); tbCase.CaseFrom = context.Request["CaseFrom"].ToString(); tbCase.CasePersonName = context.Request["CasePersonName"].ToString(); tbCase.CasePersonSex = context.Request["CasePersonSex"].ToString(); // tbCase.CasePersonAge = context.Request["CasePersonAge"].ToString(); // tbCase.CasePersonAddress = context.Request["CasePersonAddress"].ToString(); // tbCase.CasePersonRepresentative = context.Request["CasePersonRepresentative"].ToString(); // tbCase.CasePersonCompanyName = context.Request["CasePersonCompanyName"].ToString(); // tbCase.CasePersonCompanyLegalPerson = context.Request["CasePersonCompanyLegalPerson"].ToString(); // tbCase.CasePersonCompanyLegalRepresentative = context.Request["CasePersonCompanyLegalRepresentative"].ToString(); // tbCase.CasePersonCompanyLegalAgent = context.Request["CasePersonCompanyLegalAgent"].ToString(); // tbCase.CaseOpenDate = context.Request["CaseOpenDate"].ToString(); // tbCase.CaseCloseDate = context.Request["CaseCloseDate"].ToString(); // tbCase.CaseFillingDate = context.Request["CaseFillingDate"].ToString(); // tbCase.CaseExpirationDate = context.Request["CaseExpirationDate"].ToString(); // tbCase.CaseExecutive = context.Request["CaseExecutive"].ToString(); // //tbCase.StationName = context.Request["StationName"].ToString();// tbCase.CaseProcessPersonOne = context.Request["CaseProcessPersonOne"].ToString(); // tbCase.CaseProcessPersonOneEnforcementNumberOne = context.Request["CaseProcessPersonOneEnforcementNumberOne"].ToString(); // tbCase.CaseProcessPersonTwo = context.Request["CaseProcessPersonTwo"].ToString(); // tbCase.CaseProcessPersonOneEnforcementNumberTwo = context.Request["CaseProcessPersonOneEnforcementNumberTwo"].ToString(); // tbCase.CaseProcessPersonThree = context.Request["CaseProcessPersonThree"].ToString(); // tbCase.CaseProcessPersonOneEnforcementNumberThree = context.Request["CaseProcessPersonOneEnforcementNumberThree"].ToString(); // // tbCase.CaseCarNo = context.Request["CaseCarNo"].ToString(); //tbCase.CaseResult = context.Request["CaseResult"].ToString();// //tbCase.CaseTypeName = context.Request["caseType"].ToString();// //tbCase.CaseStateName = "立案";// //tbCase.CreateDate = DateTime.Now.ToString();// //tbCase.CreateUserName = loginUser.UserName;// bll.Edit(tbCase); // bll.Edit(tbEnforcementName); } else if (context.Request["action"] == "delete") { //删除 string caseId = context.Request["caseId"]; bll.Delete(caseId); } } catch (Exception e) { Message.error(context, e.Message); } }
public ICase GetById(string id) { return(CaseBLL.Get(id)); }
public JsonResult Create([FromForm] string token, [FromForm] string title, [FromForm] string coverImage, [FromForm] string describe, [FromForm] string tips, [FromForm] string caseStep, [FromForm] string caseTag) { DataResult dr = new DataResult(); try { if (string.IsNullOrWhiteSpace(title) || string.IsNullOrWhiteSpace(describe) || string.IsNullOrWhiteSpace(coverImage)) { dr.code = "201"; dr.msg = "参数错误"; return(Json(dr)); } UserEntity userEntity = this.GetUserByToken(token); CaseBLL caseBLL = new CaseBLL(); CaseEntity caseEntity = caseBLL.Create(userEntity.userId, title, coverImage, describe, tips); string msg = string.Empty; if (caseEntity != null) { msg += "创建案例成功"; if (!string.IsNullOrWhiteSpace(caseStep)) { List <CaseStepEntity> caseStepEntities = JsonConvert.DeserializeObject <List <CaseStepEntity> >(caseStep); caseStepEntities = caseStepEntities.Where(it => !string.IsNullOrWhiteSpace(it.img) || !string.IsNullOrWhiteSpace(it.contents)).ToList(); caseStepEntities.ForEach(it => { it.caseId = caseEntity.caseId; it.img = it.img ?? ""; it.contents = it.contents ?? ""; }); if (caseStepEntities.Count > 0) { int rows = caseBLL.ActionDal.ActionDBAccess.Insertable(caseStepEntities).ExecuteCommand(); if (rows > 0) { msg += ",步骤添加成功"; } } } if (!string.IsNullOrWhiteSpace(caseTag)) { int[] caseTags = JsonConvert.DeserializeObject <int[]>(caseTag); if (caseTags.Length > 0) { List <CaseTagCorrelationEntity> caseTagCorrelationEntities = new List <CaseTagCorrelationEntity>(); for (int i = 0; i < caseTags.Length; i++) { caseTagCorrelationEntities.Add(new CaseTagCorrelationEntity { caseId = caseEntity.caseId, caseTagId = caseTags[i], createDate = DateTime.Now, isDel = false, modifyDate = DateTime.Now }); } int rows = caseBLL.ActionDal.ActionDBAccess.Insertable(caseTagCorrelationEntities).ExecuteCommand(); if (rows > 0) { msg += ",标签添加成功"; } } } } dr.code = "200"; dr.msg = msg; } catch (Exception ex) { dr.code = "999"; dr.msg = ex.Message; } return(Json(dr)); }
public ICase Update(ICase item, string type, string text) { return(CaseBLL.Update(item, type, text)); }
protected void btnGoxxx_Click(object sender, EventArgs e) { if (txtTo.Text.Trim() != "") { try { decimal.Parse(txtTo.Text.Trim()); } catch { this.txtTo.Text = ""; } } if (txtFrom.Text.Trim() != "") { try { decimal.Parse(txtFrom.Text.Trim()); } catch { this.txtFrom.Text = ""; } } string where = "PatchID ={0}"; where = string.Format(where, PatchID); if (txtFrom.Text.Trim() == "" && txtTo.Text.Trim() == "") { } else if (txtFrom.Text.Trim() == "") { where = where + " and tbBalance<={0}"; where = string.Format(where, txtTo.Text); } else if (txtTo.Text.Trim() == "") { where = where + " and tbBalance>={0}"; where = string.Format(where, txtFrom.Text); } else // { where = where + " and tbBalance>={0} and tbBalance<={1}"; where = string.Format(where, txtFrom.Text, txtTo.Text); } if (this.txtName.Text.Trim() != "") { where += " and tbName like N'%{0}%' "; where = string.Format(where, this.txtName.Text.Trim()); } if (ddlCompanyUsers.SelectedIndex > 0) { if (ddlCompanyUsers.SelectedIndex == 1) { where += " and OwnerID is null "; } else { where += " and OwnerID = {0} "; where = string.Format(where, this.ddlCompanyUsers.SelectedValue); } } SearchWhere = where; GetTotalRecords(where); this.PagingControl1.CurrentPage = 1; DataSet ds = new CaseBLL(int.Parse(CompanyID)).GetCasePagingitems(this.PagingControl1.ListRecordNumPerPage, this.PagingControl1.CurrentPage, SearchWhere); CompanyAllReadUserDS = BLL.ReadCaseUsersBLL.GetReadCaseUsersList("CompanyID=" + CompanyID); this.GridView1.DataSource = ds; this.GridView1.DataBind(); GetTotalNum(ds); }