public JsonResult InitSingle() { #region 权限控制 int[] iRangePage = { AddPageNodeId, EditPageNodeId, DetailPageNodeId }; int iCurrentPageNodeId = AddPageNodeId; var tempAuth = Utits.IsNodePageAuth(iRangePage, iCurrentPageNodeId); if (tempAuth.ErrorType != 1) { return(Json(tempAuth)); } #endregion #region InitSingle Guid ID = RequestParameters.PGuid("ID"); if (ID != Guid.Empty) { var usersBll = new PaymentPlanBll(); var item = usersBll.GetVObjectById(ID); var szDetailModel = new ResultDetail(); szDetailModel.Entity = item; szDetailModel.ErrorType = 1; return(Json(szDetailModel)); } else { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "参数错误."; return(Json(sRetrunModel)); } #endregion }
//添加or修改 public ActionResult AddOrEditPg(tbPaymentPlan pg) { var cBll = new PaymentPlanBll(); bool val = cBll.EditPaymentPlan(pg); return(Json(val)); }
public JsonResult ListPhyDel() { #region 权限控制 int[] iRangePage = { AddPageNodeId, EditPageNodeId }; int iCurrentPageNodeId = AddPageNodeId; int iCurrentButtonId = (int)EButtonType.PhyDelete; var tempNoAuth = Utits.IsOperateAuth(iRangePage, iCurrentPageNodeId, iCurrentButtonId); if (tempNoAuth.ErrorType != 1) { return(Json(tempNoAuth)); } #endregion var customerId = RequestParameters.PGuid("ids"); if (customerId == Guid.Empty) { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "参数错误."; return(Json(sRetrunModel)); } var bedId = RequestParameters.PGuid("bedIds"); //if (bedId == Guid.Empty) //{ // var sRetrunModel = new ResultMessage(); // sRetrunModel.ErrorType = 0; // sRetrunModel.MessageContent = "参数错误."; // return Json(sRetrunModel); //} var welfareCentreId = Utits.WelfareCentreID; var cBll = new PaymentPlanBll(); bool isFlag = cBll.PhysicalDelete(customerId, bedId, welfareCentreId); if (isFlag) { ParamState = "4"; ParamID = customerId.ToString(); var cLog = new LogsBll(); cLog.Log(ParamID, ParamName, ParamState, Utits.CurrentUserID.ToString(), Utits.CurrentRealName.ToString(), Utits.WelfareCentreID.ToString(), Utits.ClientIPAddress.ToString()); var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 1; sRetrunModel.MessageContent = "操作成功."; return(Json(sRetrunModel)); } else { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "操作失败."; return(Json(sRetrunModel)); } }
//删除 public JsonResult Delete(string id) { string _ids = RequestParameters.Pstring("id"); if (string.IsNullOrEmpty(_ids)) { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "参数错误."; return(Json(sRetrunModel)); } string[] strids = _ids.Split(','); System.Collections.ArrayList arrayList = new System.Collections.ArrayList(); for (int i = 0; i < strids.Length; i++) { if (RegexValidate.IsGuid(strids[i])) { arrayList.Add(strids[i]); } } string[] ids = (string[])arrayList.ToArray(typeof(string)); if (!ids.Any()) { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "参数错误."; return(Json(sRetrunModel)); } //var welfareCentreId = Utits.WelfareCentreID; var cBll = new PaymentPlanBll(); bool isFlag = false; isFlag = cBll.DeletePaymentPlan(ids, (int)ESystemStatus.Deleted); if (isFlag) { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 1; sRetrunModel.MessageContent = "操作成功."; return(Json(sRetrunModel)); } else { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "操作失败."; return(Json(sRetrunModel)); } }
public string getCareContent(string bizContent, long timeStamp, string signature) { MessageLog.WriteLog(new LogParameterModel { ClassName = this.GetType().ToString(), MethodName = "getCareContent", MethodParameters = $"bizContent:{bizContent},timeStamp:{timeStamp},signature:{signature}", LogLevel = ELogLevel.Info, Message = "接收参数", PathPrefix = "/log/ws", LogExt = "txt" }); var result = new GetNursingVo(); var paramItem = CommonLib.JsonHelper.Deserialize <GetNursingDto>(bizContent); if (paramItem == null) { result.resultCode = 0; result.resultMessage = "操作失败:bizContent不合法."; return(result.ToJSON()); } var customerBll = new CustomerBll(); var itemCustomer = customerBll.GetVijObjectById(paramItem.welfareCentreId, paramItem.bedNumber); if (itemCustomer == null) { result.resultCode = 0; result.resultMessage = "未获得信息."; return(result.ToJSON()); } var prModel = new personModel(); prModel.userId = itemCustomer.ID; prModel.personName = itemCustomer.CustomerName; prModel.age = itemCustomer.CustomerAge ?? 0; prModel.gender = itemCustomer.CustomerGender == 1 ? "男" : "女"; var bufRemark = ""; var iteRemark = new PaymentPlanBll().GetById(itemCustomer.WelfareCentreID, itemCustomer.ID); if (iteRemark != null) { bufRemark = iteRemark.Remark; } prModel.remark = bufRemark.ToString(); result.person = prModel; var listNursing = new List <nursingModel>(); var fatherId = 1; var nursingRankBll = new NursingRankBll(); nursingModel itemNModel; var listNurs = nursingRankBll.SearchListByWhole(fatherId, paramItem.welfareCentreId); foreach (var itemInfo in listNurs) { itemNModel = new nursingModel(); itemNModel.nursingContent = itemInfo.RankContent; itemNModel.nursingId = itemInfo.ID; itemNModel.fatherId = itemInfo.ParentID ?? 0; itemNModel.nursingImgUrl = itemInfo.RankImgUrl; listNursing.Add(itemNModel); } result.nursing = listNursing; result.resultCode = 1; result.resultMessage = "操作成功."; return(result.ToJSON()); }
public JsonResult SearchList() { #region 权限控制 int[] iRangePage = { ListPageNodeId }; int iCurrentPageNodeId = RequestParameters.Pint("NodeId"); var tempAuth = Utits.IsNodePageAuth(iRangePage, iCurrentPageNodeId); if (tempAuth.ErrorType != 1) { return(Json(tempAuth)); } #endregion //当前页 int iCurrentPage = RequestParameters.Pint("currentPage"); iCurrentPage = iCurrentPage <= 0 ? 1 : iCurrentPage; //索引页 int iPageIndex = iCurrentPage - 1; //一页的数量 int iPageSize = RequestParameters.Pint("pageSize"); iPageSize = iPageSize <= 0 ? 5 : iPageSize; iPageSize = iPageSize > 100 ? 100 : iPageSize; //总记录数量 int iTotalRecord = 0; #region 查询条件 var searchCondition = new ConditionModel(); var WhereList = new List <WhereCondition>(); string Name = RequestParameters.Pstring("Name"); if (Name.Length > 0) { var whereCondition = new WhereCondition(); whereCondition.FieldName = "RealName"; whereCondition.FieldValue = Name; whereCondition.FieldOperator = EnumOper.Contains; WhereList.Add(whereCondition); } var welfareCentreId = Utits.WelfareCentreID; if (welfareCentreId != null) { var whereCondition = new WhereCondition(); whereCondition.FieldName = "WelfareCentreID"; whereCondition.FieldValue = welfareCentreId; whereCondition.FieldOperator = EnumOper.Equal; WhereList.Add(whereCondition); } int?IsValid = RequestParameters.PintNull("IsValid"); if (IsValid != null) { var whereCondition = new WhereCondition(); whereCondition.FieldName = "IsValid"; whereCondition.FieldValue = IsValid; whereCondition.FieldOperator = EnumOper.Equal; WhereList.Add(whereCondition); } searchCondition.WhereList = WhereList; var OrderList = new List <OrderCondition>(); string sortfield = RequestParameters.Pstring("sortfield"); if (sortfield.Length <= 0) { sortfield = "ID"; } var orderCondition = new OrderCondition(); orderCondition.FiledOrder = sortfield; orderCondition.Ascending = true; OrderList.Add(orderCondition); searchCondition.OrderList = OrderList; #endregion var cBll = new PaymentPlanBll(); var list = cBll.SearchByPageCondition(iPageIndex, iPageSize, ref iTotalRecord, searchCondition); iPageSize = iPageSize == 0 ? iTotalRecord : iPageSize; int pageCount = iTotalRecord % iPageSize == 0 ? iTotalRecord / iPageSize : iTotalRecord / iPageSize + 1; var sReturnModel = new ResultList(); sReturnModel.ErrorType = 1; sReturnModel.CurrentPage = iCurrentPage; sReturnModel.PageSize = iPageSize; sReturnModel.TotalRecord = iTotalRecord; sReturnModel.PageCount = pageCount; sReturnModel.Data = list; return(Json(sReturnModel, JsonRequestBehavior.AllowGet)); }
public JsonResult AddOrUpdate() { #region 权限控制 int[] iRangePage = { AddPageNodeId, EditPageNodeId, DetailPageNodeId }; int iCurrentPageNodeId = AddPageNodeId; int iCurrentButtonId = (int)EButtonType.Save; var tempNoAuth = Utits.IsOperateAuth(iRangePage, iCurrentPageNodeId, iCurrentButtonId); if (tempNoAuth.ErrorType != 1) { return(Json(tempNoAuth)); } #endregion #region AddOrUpdate Guid ID = RequestParameters.PGuid("ID"); Guid ddlOrgID = RequestParameters.PGuid("ddlOrgID"); Guid CustomerId = RequestParameters.PGuid("CustomerId"); Guid HgId = RequestParameters.PGuid("HgId"); DateTime?ServerStart = RequestParameters.PDateTime("ServerStart"); DateTime?ServerEnd = RequestParameters.PDateTime("ServerEnd"); string WeekOne = RequestParameters.Pstring("WeekOne"); string WeekTwo = RequestParameters.Pstring("WeekTwo"); string WeekThree = RequestParameters.Pstring("WeekThree"); string WeekFour = RequestParameters.Pstring("WeekFour"); string WeekFive = RequestParameters.Pstring("WeekFive"); string WeekSix = RequestParameters.Pstring("WeekSix"); string WeekServer = RequestParameters.Pstring("WeekServer"); string ServerTime = RequestParameters.Pstring("ServerTime"); string Remark = RequestParameters.Pstring("Remark"); var cBll = new PaymentPlanBll(); var item = new tbPaymentPlan(); item.ID = ID; ParamState = "1"; ParamID = item.ID.ToString(); item.CustomerId = CustomerId; item.HgId = HgId; item.ServerStart = ServerStart ?? DateTime.Now; item.ServerEnd = ServerEnd ?? DateTime.Now; item.WeekOne = WeekOne; item.WeekTwo = WeekTwo; item.WeekThree = WeekThree; item.WeekFour = WeekFour; item.WeekFive = WeekFive; item.WeekSix = WeekSix; item.WeekServer = WeekServer; item.ServerTime = ServerTime; item.Remark = Remark; item.OperateDate = DateTime.Now; item.CreateDate = DateTime.Now; item.OperatorUserID = Utits.CurrentUserID; item.WelfareCentreID = ddlOrgID; bool IsFlag = cBll.AddOrUpdate(item); if (IsFlag) { var cLog = new LogsBll(); cLog.Log(ParamID, ParamName, ParamState, Utits.CurrentUserID.ToString(), Utits.CurrentRealName.ToString(), Utits.WelfareCentreID.ToString(), Utits.ClientIPAddress.ToString()); var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 1; sRetrunModel.MessageContent = "操作成功."; return(Json(sRetrunModel)); } else { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "操作失败."; return(Json(sRetrunModel)); } #endregion }
public JsonResult ListOperateStatus() { #region 权限控制 int[] iRangePage = { AddPageNodeId, EditPageNodeId }; int iCurrentPageNodeId = AddPageNodeId; int[] iRangeButton = { (int)EButtonType.CustomerLeave, (int)EButtonType.Enable, (int)EButtonType.Disable }; int iCurrentButtonId = RequestParameters.Pint("oButtonId"); var tempNoAuth = Utits.IsOperateAuth(iRangePage, iCurrentPageNodeId, iRangeButton, iCurrentButtonId); if (tempNoAuth.ErrorType != 1) { return(Json(tempNoAuth)); } #endregion var customerId = RequestParameters.PGuid("ids"); if (customerId == Guid.Empty) { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "参数错误."; return(Json(sRetrunModel)); } var bedId = RequestParameters.PGuid("bedIds"); if (bedId == Guid.Empty) { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "参数错误."; return(Json(sRetrunModel)); } var welfareCentreId = Utits.WelfareCentreID; var cBll = new PaymentPlanBll(); bool isFlag = false; switch (iCurrentButtonId) { case (int)EButtonType.CustomerLeave: //删除 ParamState = "3"; isFlag = cBll.OperateDataStatus(customerId, bedId, welfareCentreId, (int)ESystemStatus.Deleted); break; case (int)EButtonType.Enable: //启用 ParamState = "5"; isFlag = cBll.OperateDataStatus(customerId, bedId, welfareCentreId, (int)ESystemStatus.Valid); break; case (int)EButtonType.Disable: //禁用 ParamState = "6"; isFlag = cBll.OperateDataStatus(customerId, bedId, welfareCentreId, (int)ESystemStatus.Forbidden); break; } if (isFlag) { ParamID = customerId.ToString(); var cLog = new LogsBll(); cLog.Log(ParamID, ParamName, ParamState, Utits.CurrentUserID.ToString(), Utits.CurrentRealName.ToString(), Utits.WelfareCentreID.ToString(), Utits.ClientIPAddress.ToString()); var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 1; sRetrunModel.MessageContent = "操作成功."; return(Json(sRetrunModel)); } else { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "操作失败."; return(Json(sRetrunModel)); } }
public JsonResult ListPhyDelOld() { #region 权限控制 int[] iRangePage = { AddPageNodeId, EditPageNodeId }; int iCurrentPageNodeId = AddPageNodeId; int iCurrentButtonId = (int)EButtonType.PhyDelete; var tempNoAuth = Utits.IsOperateAuth(iRangePage, iCurrentPageNodeId, iCurrentButtonId); if (tempNoAuth.ErrorType != 1) { return(Json(tempNoAuth)); } #endregion string _ids = RequestParameters.Pstring("ids"); if (string.IsNullOrEmpty(_ids)) { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "参数错误."; return(Json(sRetrunModel)); } string[] strids = _ids.Split(','); System.Collections.ArrayList arrayList = new System.Collections.ArrayList(); for (int i = 0; i < strids.Length; i++) { if (RegexValidate.IsGuid(strids[i])) { arrayList.Add(strids[i]); } } string[] ids = (string[])arrayList.ToArray(typeof(string)); if (!ids.Any()) { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "参数错误."; return(Json(sRetrunModel)); } string _bedIds = RequestParameters.Pstring("bedIds"); string[] strbedIds = _bedIds.Split(','); System.Collections.ArrayList arrayBedIdList = new System.Collections.ArrayList(); for (int i = 0; i < strbedIds.Length; i++) { if (RegexValidate.IsGuid(strbedIds[i])) { ParamID += strids[i] + ","; arrayBedIdList.Add(strbedIds[i]); } } string[] bedIds = (string[])arrayBedIdList.ToArray(typeof(string)); var welfareCentreId = Utits.WelfareCentreID; var cBll = new PaymentPlanBll(); bool isFlag = cBll.PhysicalDeleteByCondition(ids); if (isFlag) { ParamState = "4"; var cLog = new LogsBll(); cLog.Log(ParamID.TrimEnd(','), ParamName, ParamState, Utits.CurrentUserID.ToString(), Utits.CurrentRealName.ToString(), Utits.WelfareCentreID.ToString(), Utits.ClientIPAddress.ToString()); var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 1; sRetrunModel.MessageContent = "操作成功."; return(Json(sRetrunModel)); } else { var sRetrunModel = new ResultMessage(); sRetrunModel.ErrorType = 0; sRetrunModel.MessageContent = "操作失败."; return(Json(sRetrunModel)); } }
//查询 public ActionResult SearchList(string Name, int curPage) { //当前页 int iCurrentPage = RequestParameters.Pint("currentPage"); iCurrentPage = iCurrentPage <= 0 ? 1 : iCurrentPage; //索引页 int iPageIndex = iCurrentPage - 1; //一页的数量 int iPageSize = RequestParameters.Pint("pageSize"); iPageSize = iPageSize <= 0 ? 5 : iPageSize; iPageSize = iPageSize > 100 ? 100 : iPageSize; //总记录数量 int iTotalRecord = 0; int size = 2; iCurrentPage = curPage <= 0 ? 1 : curPage; #region 查询条件 var searchCondition = new ConditionModel(); var WhereList = new List <WhereCondition>(); if (!string.IsNullOrEmpty(Name)) { var whereCondition = new WhereCondition(); whereCondition.FieldName = "RealName"; whereCondition.FieldValue = Name; whereCondition.FieldOperator = EnumOper.Contains; WhereList.Add(whereCondition); } //var welfareCentreId = Utits.WelfareCentreID; //if (welfareCentreId != null) //{ // var whereCondition = new WhereCondition(); // whereCondition.FieldName = "WelfareCentreID"; // whereCondition.FieldValue = welfareCentreId; // whereCondition.FieldOperator = EnumOper.Equal; // WhereList.Add(whereCondition); //} searchCondition.WhereList = WhereList; var OrderList = new List <OrderCondition>(); string sortfield = RequestParameters.Pstring("sortfield"); if (sortfield.Length <= 0) { sortfield = "ID"; } var orderCondition = new OrderCondition(); orderCondition.FiledOrder = sortfield; orderCondition.Ascending = true; OrderList.Add(orderCondition); searchCondition.OrderList = OrderList; #endregion var cBll = new PaymentPlanBll(); var list = cBll.SearchByPageCondition(iPageIndex, iPageSize, ref iTotalRecord, searchCondition).ToList(); iPageSize = iPageSize == 0 ? iTotalRecord : iPageSize; int pageCount = iTotalRecord % iPageSize == 0 ? iTotalRecord / iPageSize : iTotalRecord / iPageSize + 1; var sReturnModel = new ResultList(); sReturnModel.ErrorType = 1; sReturnModel.CurrentPage = iCurrentPage; sReturnModel.PageSize = iPageSize; sReturnModel.TotalRecord = iTotalRecord; sReturnModel.PageCount = pageCount; sReturnModel.Data = list; var pages = new PageList(iCurrentPage, list.Count, size, 7); //初始化分页类 list = list.OrderByDescending(x => x.OperateDate).Skip((iCurrentPage - 1) * size).Take(size).ToList(); //取页面记录列表 同时取一对多数据 var data = new { list = list, pages = pages }; //构造对象 return(Json(data, JsonRequestBehavior.AllowGet)); }