예제 #1
0
        public JsonResult AddOrUpdate()
        {
            #region 权限控制
            int[] iRangePage         = { AddPageNodeId, EditPageNodeId };
            int   iCurrentPageNodeId = RequestParameters.Pint("NodeId");
            bool  isAdd            = iCurrentPageNodeId == AddPageNodeId ? true : false;
            int   iCurrentButtonId = (int)EButtonType.Save;
            var   tempNoAuth       = Utits.IsOperateAuth(iRangePage, iCurrentPageNodeId, iCurrentButtonId);
            if (tempNoAuth.ErrorType != 1)
            {
                return(Json(tempNoAuth));
            }
            #endregion

            #region AddOrUpdate
            string DeptCode = RequestParameters.Pstring("DeptCode");
            string DeptName = RequestParameters.Pstring("DeptName");
            string Remark   = RequestParameters.Pstring("Remark");
            if (DeptName.Length <= 0)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "部门名称不能为空.";
                return(Json(sRetrunModel));
            }

            var  item = new Depts();
            Guid ID   = RequestParameters.PGuid("ID");
            item.DeptID          = ID;
            item.OperateDate     = DateTime.Now;
            item.DeptCode        = DeptCode;
            item.DeptName        = DeptName;
            item.Remark          = Remark;
            item.WelfareCentreID = Utits.WelfareCentreID;

            var  cBll   = new DeptsBll();
            bool isFlag = cBll.AddOrUpdateDao(item);
            if (isFlag)
            {
                ParamState = "1";
                ParamID    = ID.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));
            }
            #endregion
        }
예제 #2
0
        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 CustomerBll();
            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));
            }
        }
예제 #3
0
        public JsonResult ListPhyDel()
        {
            #region 权限控制
            int[] iRangePage         = { AddPageNodeId, EditPageNodeId, DetailPageNodeId };
            int   iCurrentPageNodeId = RequestParameters.Pint("NodeId");
            int   iCurrentButtonId   = (int)EButtonType.PhyDelete;
            var   tempNoAuth         = Utits.IsOperateAuth(iRangePage, iCurrentPageNodeId, iCurrentButtonId);
            if (tempNoAuth.ErrorType != 1)
            {
                return(Json(tempNoAuth));
            }
            #endregion

            Guid ID = RequestParameters.PGuid("ids");
            if (ID == Guid.Empty)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "参数错误.";
                return(Json(sRetrunModel));
            }

            var  cBll   = new UsersBll();
            bool isFlag = cBll.PhysicalDelete(ID, Utits.WelfareCentreID);
            if (isFlag)
            {
                var authNodeBll = new AuthNodeBll();
                authNodeBll.PhysicalDeleteByUserIDs(ID);
                var authNodeButtonBll = new AuthNodeButtonBll();
                authNodeButtonBll.PhysicalDeleteByUserIDs(ID);

                ParamState = "4";
                ParamID    = ID.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));
            }
        }
예제 #4
0
        public JsonResult ListOperateStatus()
        {
            #region 权限控制
            int[] iRangePage         = { AddPageNodeId, EditPageNodeId, DetailPageNodeId };
            int   iCurrentPageNodeId = RequestParameters.Pint("NodeId");
            int[] iRangeButton       = { (int)EButtonType.Delete, (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

            //注释时间 20190306 林中枝
            //后期多条删除数据时  酌情修改
            //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);
            //}
            Guid ID = RequestParameters.PGuid("ids");
            if (ID == Guid.Empty)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "参数错误.";
                return(Json(sRetrunModel));
            }
            var  cBll   = new DeptsBll();
            bool isFlag = false;
            switch (iCurrentButtonId)
            {
            case (int)EButtonType.Delete:    //删除
                ParamState = "3";
                isFlag     = cBll.OperateDataStatus(ID, Utits.WelfareCentreID, (int)ESystemStatus.Deleted);
                break;

            case (int)EButtonType.Enable:    //启用
                ParamState = "5";
                isFlag     = cBll.OperateDataStatus(ID, Utits.WelfareCentreID, (int)ESystemStatus.Valid);
                break;

            case (int)EButtonType.Disable:    //禁用
                ParamState = "6";
                isFlag     = cBll.OperateDataStatus(ID, Utits.WelfareCentreID, (int)ESystemStatus.Forbidden);
                break;
            }
            if (isFlag)
            {
                ParamID = ID.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));
            }
        }
예제 #5
0
        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");
            string   CustomerName    = RequestParameters.Pstring("CustomerName");
            int      Age             = RequestParameters.Pint("Age");
            int      CustomerGender  = RequestParameters.Pint("CustomerGender");
            string   CustomerWedlock = RequestParameters.Pstring("CustomerWedlock");
            string   CustomerJG      = RequestParameters.Pstring("CustomerJG");
            string   Address         = RequestParameters.Pstring("Address");
            string   Company         = RequestParameters.Pstring("Company");
            string   Phone           = RequestParameters.Pstring("Phone");
            string   CustomerGSR     = RequestParameters.Pstring("CustomerGSR");
            DateTime?AdmissionDate   = RequestParameters.PDateTime("AdmissionDate");
            DateTime?DiagnosticDate  = RequestParameters.PDateTime("DiagnosticDate");

            string   CustomerJJYW     = RequestParameters.Pstring("CustomerJJYW");
            string   CustomerJJSW     = RequestParameters.Pstring("CustomerJJSW");
            int?     CustomerYSLX_dic = RequestParameters.PintNull("CustomerYSLX_dic");
            string   CustomerYYBH     = RequestParameters.Pstring("CustomerYYBH");
            string   CustomerSFWWYY   = RequestParameters.Pstring("CustomerSFWWYY");
            int?     CustomerHLMC_dic = RequestParameters.PintNull("CustomerHLMC_dic");
            string   CustomerCardID   = RequestParameters.Pstring("CustomerCardID");
            int?     CustomerType_dic = RequestParameters.PintNull("CustomerType_dic");
            string   CustomerSBKH     = RequestParameters.Pstring("CustomerSBKH");
            string   CustomerMZ       = RequestParameters.Pstring("CustomerMZ");
            int?     CustomerWHCD_dic = RequestParameters.PintNull("CustomerWHCD_dic");
            string   CustomerZW       = RequestParameters.Pstring("CustomerZW");
            int      CustomerYLJSR    = RequestParameters.Pint("CustomerYLJSR");
            string   CustomerZZDH     = RequestParameters.Pstring("CustomerZZDH");
            string   CustomerYYZT     = RequestParameters.Pstring("CustomerYYZT");
            string   CustomerSFBS     = RequestParameters.Pstring("CustomerSFBS");
            string   CustomerSX       = RequestParameters.Pstring("CustomerSX");
            string   CustomerZYBH     = RequestParameters.Pstring("CustomerZYBH");
            DateTime?CustomerYYSJ     = RequestParameters.PDateTime("CustomerYYSJ");
            DateTime?CustomerLYSJ     = RequestParameters.PDateTime("CustomerLYSJ");
            string   CustomerLYYY     = RequestParameters.Pstring("CustomerLYYY");
            string   CustomerYLBZ     = RequestParameters.Pstring("CustomerYLBZ");
            string   CustomerXMPY     = GetSpellCode(CustomerName);
            DateTime?CustomerBrith    = RequestParameters.PDateTime("CustomerBrith");
            Guid     oldBednoID       = RequestParameters.PGuid("oldBednoID");
            Guid     bednoID          = RequestParameters.PGuid("bednoID");
            string   BedNumberName    = RequestParameters.Pstring("BedNumberName");
            string   bednoText        = RequestParameters.Pstring("bednoText");
            string   HeadImg          = RequestParameters.Pstring("HeadImg");

            string CustomerZZMM        = RequestParameters.Pstring("CustomerZZMM");
            string CustomerJYCD        = RequestParameters.Pstring("CustomerJYCD");
            string CustomerDlrXm       = RequestParameters.Pstring("CustomerDlrXm");
            string CustomerDlrTel      = RequestParameters.Pstring("CustomerDlrTel");
            string CustomerDlrDz       = RequestParameters.Pstring("CustomerDlrDz");
            string CustomerDlrGx       = RequestParameters.Pstring("CustomerDlrGx");
            string CustomerDlrYb       = RequestParameters.Pstring("CustomerDlrYb");
            string ddlCustomerHJDQ_dic = RequestParameters.Pstring("CustomerHJDQ_dic");
            var    cBll = new CustomerBll();
            #region  判断
            if (CustomerName.Length <= 0)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "姓名不能为空.";
                return(Json(sRetrunModel));
            }
            //var welfareCentreId = Utits.WelfareCentreID;
            //if (bednoID != Guid.Empty)
            //{
            //    bool isFlagValidation = false;
            //    if (ID == Guid.Empty)
            //        isFlagValidation = cBll.ValidationBedByCustomer(bednoID, welfareCentreId);
            //    else
            //        isFlagValidation = cBll.ValidationBedByCustomer(ID, bednoID, welfareCentreId);

            //    if (!isFlagValidation)
            //    {
            //        var sRetrunModel = new ResultMessage();
            //        sRetrunModel.ErrorType = 0;
            //        sRetrunModel.MessageContent = "床位已住人.";
            //        return Json(sRetrunModel);
            //    }
            //}
            #endregion

            var item = new tbCustomer();
            item.ID = ID;

            ParamState = "1";
            ParamID    = item.ID.ToString();

            item.Stage           = (int)ECustomerType.RuYuan;
            item.OperateDate     = DateTime.Now;
            item.CustomerName    = CustomerName;
            item.BedNumber       = bednoID == Guid.Empty ? "" : bednoText;
            item.BedID           = bednoID;
            item.CustomerGender  = CustomerGender;
            item.CustomerWedlock = CustomerWedlock;
            item.CustomerAge     = Age;
            item.CustomerJG      = CustomerJG;
            item.CustomerAddress = Address;
            item.CustomerCompany = Company;
            item.CustomerTel     = Phone;
            item.CustomerGSR     = CustomerGSR;
            item.AdmissionDate   = AdmissionDate ?? DateTime.Now;
            item.DiagnosticDate  = DiagnosticDate ?? DateTime.Now;

            item.CustomerCardID   = CustomerCardID;
            item.CustomerType_dic = CustomerType_dic;
            item.CustomerSBKH     = CustomerSBKH;
            item.CustomerMZ       = CustomerMZ;
            item.CustomerWHCD_dic = CustomerWHCD_dic;
            item.CustomerZW       = CustomerZW;
            item.CustomerYLJSR    = CustomerYLJSR;
            item.CustomerZZDH     = CustomerZZDH;
            item.CustomerYYZT     = CustomerYYZT;
            item.CustomerSFBS     = CustomerSFBS;
            item.CustomerSX       = CustomerSX;
            item.CustomerXMPY     = CustomerXMPY;//姓名拼音
            item.CustomerZYBH     = CustomerZYBH;
            item.CustomerYYSJ     = CustomerYYSJ;
            item.CustomerLYSJ     = CustomerLYSJ;
            item.CustomerLYYY     = CustomerLYYY;
            item.CustomerYLBZ     = CustomerYLBZ;
            item.CustomerJJYW     = CustomerJJYW;
            item.CustomerJJSW     = CustomerJJSW;
            item.CustomerYSLX_dic = CustomerYSLX_dic;
            item.CustomerYYBH     = CustomerYYBH;
            item.CustomerSFWWYY   = CustomerSFWWYY;
            item.CustomerHLMC_dic = CustomerHLMC_dic;
            item.CustomerBrith    = CustomerBrith;
            item.BedNumberName    = BedNumberName;
            item.CustomerHeadImg  = HeadImg;

            item.CustomerZZMM     = CustomerZZMM;
            item.CustomerJYCD     = CustomerJYCD;
            item.CustomerDlrXm    = CustomerDlrXm;
            item.CustomerDlrTel   = CustomerDlrTel;
            item.CustomerDlrDz    = CustomerDlrDz;
            item.CustomerDlrGx    = CustomerDlrGx;
            item.CustomerDlrYb    = CustomerDlrYb;
            item.CustomerHJDQ_dic = ddlCustomerHJDQ_dic;
            //item.WelfareCentreID = welfareCentreId;
            item.WelfareCentreID = ddlOrgID;
            bool IsFlag = cBll.AddOrUpdate(item, oldBednoID);
            //if (bednoID != oldBednoID)
            //{
            //    //BedStatus 1 有人住,0 没人住
            //    if (bednoID!=Guid.Empty)
            //    {
            //        var bedBll = new BedBll();
            //        bool IsBedFlag = bedBll.OperateBedStatus(bednoID,1);
            //    }
            //    if (oldBednoID != Guid.Empty)
            //    {
            //        var bedBll = new BedBll();
            //        bool IsBedFlag = bedBll.OperateBedStatus(oldBednoID, 0);
            //    }
            //}
            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
        }
예제 #6
0
        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 CustomerBll();
            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));
            }
        }
예제 #7
0
        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 CustomerBll();
            bool     isFlag          = cBll.PhysicalDeleteByCondition(ids);
            if (isFlag)
            {
                ////BedStatus 1 有人住,0 没人住
                //var bedBll = new BedBll();
                //bedBll.OperateBedStatus(bedIds, 0, welfareCentreId);

                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));
            }
        }
예제 #8
0
        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

            Guid id             = RequestParameters.PGuid("ID");
            Guid ddlOrgID       = RequestParameters.PGuid("ddlOrgID");
            var  StaffName      = RequestParameters.Pstring("StaffName");
            var  StaffGender    = RequestParameters.Pint("StaffGender");
            var  EmployType     = RequestParameters.Pstring("EmployType");
            var  SocialSecurity = RequestParameters.Pstring("SocialSecurity");
            var  Profession     = RequestParameters.Pstring("Profession");
            var  WeiJi          = RequestParameters.Pstring("WeiJi");
            var  SheGong        = RequestParameters.Pstring("SheGong");
            var  QiTa           = RequestParameters.Pstring("QiTa");
            var  HgChiZheng     = RequestParameters.Pstring("HgChiZheng");
            var  HgXueLi        = RequestParameters.Pstring("HgXueLi");
            var  HgNianLing     = RequestParameters.Pstring("HgNianLing");
            var  HgRuZhiNian    = RequestParameters.Pstring("HgRuZhiNian");
            var  HgHuJi         = RequestParameters.Pstring("HgHuJi");
            var  HouQin         = RequestParameters.Pstring("HouQin");
            var  Phone          = RequestParameters.Pstring("Phone");
            var  AddressPlace   = RequestParameters.Pstring("AddressPlace");

            var item = new tbOrgTLJGCongYe();
            item.ID             = id;
            item.OperateDate    = DateTime.Now;
            item.OperateUserID  = Utits.CurrentUserID;
            item.OrganizationId = ddlOrgID;
            item.WelfareId      = ddlOrgID;

            item.StaffName      = StaffName;
            item.StaffGender    = StaffGender;
            item.EmployType     = EmployType;
            item.SocialSecurity = SocialSecurity;
            item.Profession     = Profession;
            item.WeiJi          = WeiJi;
            item.SheGong        = SheGong;
            item.QiTa           = QiTa;
            item.HgChiZheng     = HgChiZheng;
            item.HgXueLi        = HgXueLi;
            item.HgNianLing     = HgNianLing;
            item.HgRuZhiNian    = HgRuZhiNian;
            item.HgHuJi         = HgHuJi;
            item.HouQin         = HouQin;

            item.Phone        = Phone;
            item.AddressPlace = AddressPlace;

            if (item.ID == Guid.Empty)
            {
                ParamState = "1";
                ParamID    = id.ToString();
            }
            else
            {
                ParamState = "2";
                ParamID    = id.ToString();
            }
            var cBll   = new OrgTLJGCongYeBll();
            var 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));
            }
        }
예제 #9
0
        public JsonResult ListOperateStatus()
        {
            #region 权限控制
            int[] iRangePage         = { AddPageNodeId, EditPageNodeId };
            int   iCurrentPageNodeId = AddPageNodeId;
            int[] iRangeButton       = { (int)EButtonType.Delete, (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

            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]))
                {
                    ParamID += 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]))
                {
                    arrayBedIdList.Add(strbedIds[i]);
                }
            }
            string[] bedIds = (string[])arrayBedIdList.ToArray(typeof(string));

            var  cBll   = new OrgTLJGCongYeBll();
            bool isFlag = false;
            switch (iCurrentButtonId)
            {
            case (int)EButtonType.Delete:    //删除
                ParamState = "3";
                isFlag     = cBll.LogicDeleteByCondition(ids);
                break;

            case (int)EButtonType.Enable:    //启用
                ParamState = "5";
                isFlag     = cBll.EnableByCodeition(ids);
                break;

            case (int)EButtonType.Disable:    //禁用
                ParamState = "6";
                isFlag     = cBll.DisableByCodeition(ids);
                break;
            }
            if (isFlag)
            {
                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));
            }
        }
예제 #10
0
        public JsonResult AddOrUpdate()
        {
            #region 权限控制
            int[] iRangePage         = { AddPageNodeId, EditPageNodeId, DetailPageNodeId };
            int   iCurrentPageNodeId = RequestParameters.Pint("NodeId");
            bool  isAdd            = iCurrentPageNodeId == AddPageNodeId ? true : false;
            int   iCurrentButtonId = (int)EButtonType.Save;
            var   tempNoAuth       = Utits.IsOperateAuth(iRangePage, iCurrentPageNodeId, iCurrentButtonId);
            if (tempNoAuth.ErrorType != 1)
            {
                return(Json(tempNoAuth));
            }
            #endregion

            #region AddOrUpdate
            var    welfareCentreId = Utits.WelfareCentreID;
            string UserCode        = RequestParameters.Pstring("UserCode");
            string UserName        = RequestParameters.Pstring("UserName");
            string RealName        = RequestParameters.Pstring("RealName");
            string Password        = RequestParameters.Pstring("Password");
            Guid   DeptId          = RequestParameters.PGuid("DeptId");
            Guid   RoleId          = RequestParameters.PGuid("RoleId");
            int    UserType        = RequestParameters.Pint("UserType");
            string Remark          = RequestParameters.Pstring("Remark");
            string IcCardNO        = RequestParameters.Pstring("IcCardNO");
            if (UserName.Length <= 0)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "用户名不能为空.";
                return(Json(sRetrunModel));
            }
            var  cBll             = new UsersBll();
            Guid ID               = RequestParameters.PGuid("ID");
            bool isFlagValidation = false;
            if (ID == Guid.Empty)
            {
                isFlagValidation = cBll.ValidationUserName(UserName, welfareCentreId);
            }
            else
            {
                isFlagValidation = cBll.ValidationUserName(ID, UserName, welfareCentreId);
            }


            if (!isFlagValidation)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "用户名已存在.";
                return(Json(sRetrunModel));
            }

            if (RealName.Length <= 0)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "真实姓名不能为空.";
                return(Json(sRetrunModel));
            }
            if (DeptId == Guid.Empty)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "部门参数错误,请返回列表页面重新操作.";
                return(Json(sRetrunModel));
            }
            if (RoleId == Guid.Empty)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "角色参数错误,请返回列表页面重新操作.";
                return(Json(sRetrunModel));
            }

            var item = new Users();
            if (ID == Guid.Empty)
            {
                item.UserID     = Guid.NewGuid();
                item.CreateDate = DateTime.Now;
                item.IsValid    = 1;
                if (Password.Length <= 0)
                {
                    Password = HashEncrypt.md5(CommonLib.Config.SystemInitPassword);
                }
                item.Password = CommonLib.HashEncrypt.BgPassWord(Password);
            }
            else
            {
                item.UserID = ID;
                if (Password.Length > 0)
                {
                    item.Password = CommonLib.HashEncrypt.BgPassWord(Password);
                }
            }
            item.WelfareCentreID = welfareCentreId;
            item.OperateDate     = DateTime.Now;
            item.UserCode        = UserCode;
            item.UserName        = UserName;
            item.RealName        = RealName;
            item.DeptID          = DeptId;
            item.RoleID          = RoleId;
            item.Remark          = Remark;
            item.UserType        = UserType;
            item.IcCardNo        = IcCardNO;

            ParamState = "1";
            ParamID    = item.UserID.ToString();
            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
        }
예제 #11
0
        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
        }