public ServiceResponseData SaveReportData()
        {
            int    reportNo = requestData.GetData <int>(0);
            string name     = requestData.GetData <string>(1);

            string strsql = @"SELECT TOP 1 ID FROM Basic_ReportConfig WHERE EnumValue={0} AND WorkID={1}";

            strsql = string.Format(strsql, reportNo, oleDb.WorkId);
            int val = ConvertExtend.ToInt32(oleDb.GetDataResult(strsql), 0);

            if (val == 0)
            {
                strsql = @"INSERT INTO Basic_ReportConfig
                                        ( ReportType ,EnumValue ,ReportTitle ,WBCode ,PYCode ,FileName ,UpdateTime , Modifyer ,DelFlag ,WorkID)
                                VALUES  (0,{0},'{1}','{2}','{3}','{4}',GETDATE(),{5},0,{6})";
                strsql = String.Format(strsql, reportNo, name, SpellAndWbCode.GetSpellCode(name), SpellAndWbCode.GetWBCode(name), reportNo + "." + name, LoginUserInfo.EmpId, oleDb.WorkId);
                int key = oleDb.InsertRecord(strsql);
                responseData.AddData(key);
            }
            else
            {
                strsql = @"UPDATE Basic_ReportConfig SET UpdateTime=GETDATE(),Modifyer={0} WHERE ID={1}";
                strsql = string.Format(strsql, LoginUserInfo.EmpId, val);
                oleDb.DoCommand(strsql);
                responseData.AddData(val);
            }
            return(responseData);
        }
        public ServiceResponseData SaveHospFeeItem()
        {
            var hfeeitem = requestData.GetData <Basic_HospFeeItem>(0);
            var cfeeitem = requestData.GetData <Basic_CenterFeeItem>(1);

            if (cfeeitem.FeeID <= 0)
            {
                cfeeitem.IsStop      = (int)IsStopType.Enabled;
                cfeeitem.AuditStatus = (int)AuditType.UnAudit;
                cfeeitem.CusCode     = string.Empty;
                cfeeitem.PyCode      = SpellAndWbCode.GetSpellCode(cfeeitem.CenterItemName);
                cfeeitem.WbCode      = SpellAndWbCode.GetWBCode(cfeeitem.CenterItemName);
                cfeeitem.ModDate     = DateTime.Now;
                this.BindDb(cfeeitem);
                cfeeitem.save();
            }

            hfeeitem.CenterItemID = cfeeitem.FeeID;
            hfeeitem.ItemCode     = cfeeitem.CenterItemCode;
            hfeeitem.ItemName     = cfeeitem.CenterItemName;
            hfeeitem.IsStop       = (int)IsStopType.Enabled;
            hfeeitem.CusCode      = string.Empty;
            hfeeitem.PyCode       = SpellAndWbCode.GetSpellCode(hfeeitem.AliasName);
            hfeeitem.WbCode       = SpellAndWbCode.GetWBCode(hfeeitem.AliasName);
            //hfeeitem.StatID = cfeeitem.StatID;
            hfeeitem.ModDate = DateTime.Now;
            BindDb(hfeeitem);
            hfeeitem.save();

            responseData.AddData("OK");
            return(responseData);
        }
Esempio n. 3
0
        public BaseDept SaveDept(int deptId, string deptname, int layerId)
        {
            BaseDept dept = NewObject <BaseDept>();

            dept.DeptId = deptId;
            dept.Layer  = layerId;
            dept.Name   = deptname;
            if (deptname != null)
            {
                dept.Pym = SpellAndWbCode.GetSpellCode(deptname);
                dept.Wbm = SpellAndWbCode.GetWBCode(deptname);
            }
            dept.save();
            return(dept);
        }
        public ServiceResponseData SaveWard()
        {
            var workId = requestData.GetData <int>(0);
            var ward   = requestData.GetData <BaseWard>(1);

            SetWorkId(workId);
            ward.Szm = string.Empty;
            ward.Pym = SpellAndWbCode.GetSpellCode(ward.WardName);
            ward.Wbm = SpellAndWbCode.GetWBCode(ward.WardName);
            BindDb(ward);
            ward.save();

            responseData.AddData("OK");
            return(responseData);
        }
        public string SaveDept()
        {
            int    deptId   = Convert.ToInt32(ToArray(ParamJsonData)[0]);
            string deptname = ToArray(ParamJsonData)[1].ToString();
            int    layerId  = Convert.ToInt32(ToArray(ParamJsonData)[2]);

            BaseDept dept = NewObject <BaseDept>();

            dept.DeptId = deptId;
            dept.Layer  = layerId;
            dept.Name   = deptname;
            dept.Pym    = SpellAndWbCode.GetSpellCode(deptname);
            dept.Wbm    = SpellAndWbCode.GetWBCode(deptname);
            dept.save();
            return(ToJson(dept));
        }
Esempio n. 6
0
        public void SaveUser(BaseEmployee emp, BaseUser user, int[] deptId, int defaultDeptId, int[] groupIds)
        {
            emp.Pym      = SpellAndWbCode.GetSpellCode(emp.Name);
            emp.Wbm      = SpellAndWbCode.GetWBCode(emp.Name);
            emp.Brithday = DateTime.Now;
            emp.Szm      = "";
            emp.save();
            user.EmpId    = emp.EmpId;
            user.PassWord = ConvertExtend.ToPassWord("1");
            user.Memo     = "";
            user.save();

            NewObject <Employee>().SetHaveEmpDeptRole(emp.EmpId, deptId);
            NewObject <Employee>().SetDefaultEmpDeptRole(emp.EmpId, defaultDeptId);
            NewObject <User>().SetGroupUserRole(user.UserId, groupIds);
        }
Esempio n. 7
0
        public ServiceResponseData SaveEmpAndDetail()
        {
            var workID    = requestData.GetData <int>(0);
            var emp       = requestData.GetData <BaseEmployee>(1);
            var empDetail = requestData.GetData <BaseEmployeeDetails>(2);

            SetWorkId(workID);
            emp.Szm = string.Empty;
            emp.Pym = SpellAndWbCode.GetSpellCode(emp.Name);
            emp.Wbm = SpellAndWbCode.GetWBCode(emp.Name);
            //empDetail.WorkId = emp.WorkId;
            this.BindDb(emp);
            emp.save();
            this.BindDb(empDetail);
            empDetail.EmpID = emp.EmpId;
            empDetail.save();
            responseData.AddData("OK");
            return(responseData);
        }
        public ServiceResponseData SaveDept()
        {
            int    deptId   = requestData.GetData <int>(0);
            string deptname = requestData.GetData <string>(1);
            int    layerId  = requestData.GetData <int>(2);

            BaseDept dept = NewObject <BaseDept>();

            dept.DeptId = deptId;
            dept.Layer  = layerId;
            dept.Name   = deptname;
            dept.Pym    = SpellAndWbCode.GetSpellCode(deptname);
            dept.Wbm    = SpellAndWbCode.GetWBCode(deptname);
            dept.save();


            responseData.AddData(dept);
            return(responseData);
        }
        public ServiceResponseData SaveCenterFeeItem()
        {
            var cfeeitem = requestData.GetData <Basic_CenterFeeItem>(0);

            if (cfeeitem.FeeID <= 0)
            {
                cfeeitem.IsStop = 0;
            }

            cfeeitem.AuditStatus = (int)AuditType.UnAudit;
            cfeeitem.CusCode     = string.Empty;
            cfeeitem.PyCode      = SpellAndWbCode.GetSpellCode(cfeeitem.CenterItemName);
            cfeeitem.WbCode      = SpellAndWbCode.GetWBCode(cfeeitem.CenterItemName);
            cfeeitem.ModDate     = DateTime.Now;
            this.BindDb(cfeeitem);
            cfeeitem.save();

            responseData.AddData("OK");
            return(responseData);
        }
Esempio n. 10
0
        public ServiceResponseData SaveReport()
        {
            int workId = requestData.GetData <int>(0);
            Basic_ReportConfig report = requestData.GetData <Basic_ReportConfig>(1);

            SetWorkId(workId);
            //新增报表才验证
            if (report.ID == 0 && NewDao <IBasicDataReportDao>().ExistReport(report.EnumValue, workId) == true)
            {
                throw new Exception("同机构报表编号不能重复!");
            }

            report.PYCode   = SpellAndWbCode.GetSpellCode(report.ReportTitle);
            report.WBCode   = SpellAndWbCode.GetWBCode(report.ReportTitle);
            report.FileName = string.Empty;
            report.Modifyer = LoginUserInfo.EmpId.ToString();
            NewDao <IBasicDataReportDao>().SaveReport(report);
            responseData.AddData(true);
            return(responseData);
        }
        public ServiceResponseData SaveUser()
        {
            BaseEmployee emp  = requestData.GetData <BaseEmployee>(0);
            BaseUser     user = requestData.GetData <BaseUser>(1);

            int[] currEmpDeptList    = requestData.GetData <int[]>(2);
            int   currDefaultEmpDept = requestData.GetData <int>(3);

            int[] currGroupUserList = requestData.GetData <int[]>(4);

            emp.BindDb(oleDb, _container, _cache, _pluginName);
            user.BindDb(oleDb, _container, _cache, _pluginName);

            if (emp.EmpId == 0)
            {
                if (NewObject <User>().GetUser(user.Code) != null)
                {
                    responseData.AddData(false);
                    return(responseData);
                }
            }

            emp.Pym      = SpellAndWbCode.GetSpellCode(emp.Name);
            emp.Wbm      = SpellAndWbCode.GetWBCode(emp.Name);
            emp.Brithday = DateTime.Now;
            emp.save();
            user.EmpId    = emp.EmpId;
            user.PassWord = ConvertExtend.ToPassWord("1");
            //user.IsAdmin = 0;
            user.save();

            NewObject <Employee>().SetHaveEmpDeptRole(emp.EmpId, currEmpDeptList);
            NewObject <Employee>().SetDefaultEmpDeptRole(emp.EmpId, currDefaultEmpDept);
            NewObject <User>().SetGroupUserRole(user.UserId, currGroupUserList);

            responseData.AddData(true);
            return(responseData);
        }
        public string SaveUser()
        {
            BaseEmployee emp  = ToObject <BaseEmployee>(ToArray(ParamJsonData)[0]);
            BaseUser     user = ToObject <BaseUser>(ToArray(ParamJsonData)[1]);

            int[] currEmpDeptList    = ToObject <int[]>(ToArray(ParamJsonData)[2]);
            int   currDefaultEmpDept = Convert.ToInt32(ToArray(ParamJsonData)[3]);

            int[] currGroupUserList = ToObject <int[]>(ToArray(ParamJsonData)[4]);

            emp.BindDb(oleDb, _container, _cache, _pluginName);
            user.BindDb(oleDb, _container, _cache, _pluginName);

            if (emp.EmpId == 0)
            {
                if (NewObject <User>().GetUser(user.Code) != null)
                {
                    return(ToJson(false));
                }
            }

            emp.Pym      = SpellAndWbCode.GetSpellCode(emp.Name);
            emp.Wbm      = SpellAndWbCode.GetWBCode(emp.Name);
            emp.Brithday = DateTime.Now;
            emp.save();
            user.EmpId    = emp.EmpId;
            user.PassWord = ConvertExtend.ToPassWord("1");
            //user.IsAdmin = 0;
            user.save();

            NewObject <Employee>().SetHaveEmpDeptRole(emp.EmpId, currEmpDeptList);
            NewObject <Employee>().SetDefaultEmpDeptRole(emp.EmpId, currDefaultEmpDept);
            NewObject <User>().SetGroupUserRole(user.UserId, currGroupUserList);

            return(ToJson(true));
        }
        public void SavePatientInfo()
        {
            Action <ClientRequestData> requestAction = ((ClientRequestData request) =>
            {
                ipatientInfo.PatList.MakerEmpID = LoginUserInfo.EmpId;                                          // 登记人
                ipatientInfo.PatList.PYCode = SpellAndWbCode.GetSpellCode(ipatientInfo.PatList.PatName, 0, 10); // 拼音码
                ipatientInfo.PatList.WBCode = SpellAndWbCode.GetWBCode(ipatientInfo.PatList.PatName, 0, 10);    // 五笔码
                ipatientInfo.PatList.CurrDeptID = ipatientInfo.PatList.EnterDeptID;                             // 当前科室

                if (ipatientInfo.IsNewPatient)
                {
                    ipatientInfo.PatList.Status = 1; // 病人状态
                }

                ipatientInfo.PatList.CurrWardID = ipatientInfo.PatList.EnterWardID;     // 当前病区代码
                ipatientInfo.PatList.CurrDoctorID = ipatientInfo.PatList.EnterDoctorID; // 当前医生代码
                ipatientInfo.PatList.CurrNurseID = ipatientInfo.PatList.EnterNurseID;   // 当前护士代码
                ipatientInfo.PatList.LeaveHDate = DateTime.Now;                         // 出院日期
                request.AddData(ipatientInfo.PatientInfo);
                request.AddData(ipatientInfo.PatList);
                request.AddData(ipatientInfo.IsNewPatient);
                request.AddData(twoAdmission);
                request.AddData(ipatientInfo.InpatientReg);
                request.AddData(LoginUserInfo.WorkId);
                request.AddData(LoginUserInfo.EmpId);
                request.AddData(LoginUserInfo.DeptId);
            });
            ServiceResponseData retdata = InvokeWcfService("IPProject.Service", "AdmissionController", "SavePatientInfo", requestAction);
            string result = retdata.GetData <string>(0);

            if (!string.IsNullOrEmpty(result))
            {
                // 当前会员已办理过住院登记
                MessageBoxShowSimple(result);
                ipatientInfo.SetCardControlEnabled();
                return;
            }
            else
            {
                MessageBox.Show("保存病人信息成功!");
            }

            // 关闭新病人入院信息录入界面
            ipatientInfo.FormClose();

            if (ipatientInfo.TotalFee > 0)
            {
                // 收取预交金
                int            patListID   = retdata.GetData <int>(1);
                IP_DepositList depositList = new IP_DepositList();
                depositList.MemberID  = ipatientInfo.PatList.MemberID;   //会员ID
                depositList.PatListID = patListID;                       //登记ID
                depositList.DeptID    = ipatientInfo.PatList.CurrDeptID; //科室ID

                if (ipatientInfo.IsNewPatient)
                {
                    depositList.SerialNumber = retdata.GetData <decimal>(2); //住院流水号
                }
                else
                {
                    depositList.SerialNumber = ipatientInfo.PatList.SerialNumber; //住院流水号
                }

                depositList.InvoiceNO = ipatientInfo.InvoiceNO;
                depositList.PayType   = ipatientInfo.PayType;
                depositList.TotalFee  = ipatientInfo.TotalFee;
                PayADeposit(depositList);
            }

            // 重新加载病人列表
            GetPatientList(ipatientInfo.IsNewPatient);
        }