Beispiel #1
0
        public int SameNoteFretDifferenceOnString(EString eCurrent, EString eNext)
        {
            if (Math.Abs(eCurrent - eNext) != 1)
            {
                throw new Exception("Those strings are not close");
            }

            if ((eCurrent == EString.Second) && (eNext == EString.Third))
            {
                return(4);
            }

            if ((eCurrent == EString.Third) && (eNext == EString.Second))
            {
                return(-4);
            }

            if (eCurrent < eNext)
            {
                return(-5);
            }
            else
            {
                return(5);
            }
        }
Beispiel #2
0
        public string PayDeposit(request <Entity.SRequest.payDeposit> payDeposit)
        {
            if (payDeposit == null)
            {
                return(RsXmlHelper.ResXml(-1, "XML格式错误"));
            }

            in_reginfo in_Reginfo = null;

            if (!string.IsNullOrWhiteSpace(payDeposit.model.patientID))
            {
                in_Reginfo = inReginfoBLL.GetReginfo(payDeposit.model.patientID);
            }
            else
            {
                return(RsXmlHelper.ResXml(-1, "入院号不能为空"));
            }
            string memo = "住院记录ID:{0},公众服务平台订单号:{1},收单机构流水号:{2},收单机构代码:{3},支付方式:{4},补缴押金金额:{5},支付时间:{6},代缴人证件类型:{7},代缴人证件号码:{8},代缴人姓名:{9}。";

            memo = string.Format(memo, payDeposit.model.patientID, payDeposit.model.psOrdNum, payDeposit.model.agtOrdNum, payDeposit.model.agtCode, payDeposit.model.payMode, Convert.ToInt32(payDeposit.model.payAmout) / 100, payDeposit.model.payTime, payDeposit.model.reprePatCardType, payDeposit.model.reprePatCardNo, payDeposit.model.reprePatName);

            var fdid = feeDepositBLL.AdvancePayment(in_Reginfo, payDeposit.model.payMode, Convert.ToInt32(payDeposit.model.payAmout) / 100, payDeposit.model.psOrdNum, memo, out decimal leftPrice);

            return(XMLHelper.XmlSerialize(new response <Entity.SResponse.payDeposit>()
            {
                model = new Entity.SResponse.payDeposit()
                {
                    resultCode = 0,
                    resultMessage = "",
                    hisOrdNum = EString.ZeroFill(fdid),
                    balance = (leftPrice * 100).ToString()
                }
            }));
        }
        public List <DepositItem> GetDepositItems(int did, string payMode, string beginDate, string endDate, string sno)
        {
            var list = db.Queryable <fee_depositdetail>()
                       .WhereIF(!string.IsNullOrEmpty(beginDate), it => SqlFunc.Between(it.addtime, beginDate, endDate))
                       .WhereIF(!string.IsNullOrEmpty(sno), it => it.paysn == sno)
                       .WhereIF(!string.IsNullOrEmpty(payMode), it => it.paytype == payMode)
                       .Where(x => x.did == did)
                       .Select(f => new DepositItem
            {
                branchCode = "",
                branchName = "",
                payAmout   = (f.price * 100).ToString(),
                hisOrdNum  = f.detailid.ToString(),
                agtOrdNum  = f.paysn,
                payMode    = f.paytype.ToString(),
                payStatus  = "1",
                balance    = ""
            }).ToList();

            foreach (var item in list)
            {
                item.hisOrdNum  = EString.ZeroFill(item.hisOrdNum);
                item.receiptNum = EString.ZeroFill(item.hisOrdNum);
                item.payMode    = CodeConvertUtils.GetDepositType(item.payMode);
            }

            return(list);
        }
Beispiel #4
0
 public VasilyLink OrLeq(params string[] data)
 {
     foreach (var item in data)
     {
         _conditionQuery = EString.Contact(_conditionQuery, _maker.GetOperator(Model.OperatorChar.OR, Model.OperatorChar.LEQ, item));
     }
     return(this);
 }
Beispiel #5
0
 public VasilyLink AndEqu(params string[] data)
 {
     foreach (var item in data)
     {
         _conditionQuery = EString.Contact(_conditionQuery, _maker.GetOperator(Model.OperatorChar.AND, Model.OperatorChar.EQU, item));
     }
     return(this);
 }
Beispiel #6
0
        public void Test_EString()
        {
            EString e_str = string.Empty;

            //for (int i = 0; i < count; i += 1)
            //{
            e_str += "tttt";
            //}
        }
Beispiel #7
0
        public static FileBase CreateSMF(string fileLocation)
        {
            FileData fd   = new FileData(null, EString.Array("faction"), '\t', ',', EString.Array(' '), ';', 1, "", ',');
            FileBase file = new FileBase(RTWLib.Data.FileNames.none, string.Empty, string.Empty);

            file.data = new FileData(fd);
            file.Parse(new string[] { fileLocation }, out Logger.Logger.lineNumber, out Logger.Logger.lineText);
            file.data.FormulateAttributes(true, false);
            return(file);
        }
Beispiel #8
0
 /// <summary>
 /// 获取查重的SQL
 /// </summary>
 /// <param name="data">成员名数组</param>
 /// <returns>查重字符串</returns>
 public string GetRepeate(string[] data)
 {
     string where = string.Empty;
     for (int i = 0; i < data.Length; i += 1)
     {
         where = EString.Contact(" AND ", SqlAnalyser._open, Model.GetColumnName(data[i]), SqlAnalyser._close, "=@", data[i]);
     }
     where = where.Remove(0, 4);
     return(EString.Contact("SELECT COUNT(*) FROM ", SqlAnalyser._open, Model.Table, SqlAnalyser._close, " WHERE", where));
 }
Beispiel #9
0
        /// <summary>
        /// 获取查询的SQL
        /// </summary>
        /// <param name="data">成员名数组</param>
        /// <returns>查询字符串</returns>
        public string GetSelect(string[] data)
        {
            string select = string.Empty;

            for (int i = 0; i < data.Length; i += 1)
            {
                select = EString.Contact(select, ",", SqlAnalyser._open, Model.GetColumnName(data[i]), SqlAnalyser._close, "");
            }
            select = select.Remove(0, 1);
            return(EString.Contact("SELECT ", select, " FROM ", SqlAnalyser._open, Model.Table, SqlAnalyser._close, " WHERE"));
        }
Beispiel #10
0
        /// <summary>
        /// 获取按条件更新的SQL
        /// </summary>
        /// <param name="data">成员名数组</param>
        /// <returns>更新字符串</returns>
        public string GetUpdate(string[] data)
        {
            string update = string.Empty;

            for (int i = 0; i < data.Length; i += 1)
            {
                update = EString.Contact(update, ",", SqlAnalyser._open, Model.GetColumnName(data[i]), SqlAnalyser._close, "=@", data[i]);
            }
            update = update.Remove(0, 1);
            return(EString.Contact("UPDATE ", SqlAnalyser._open, Model.Table, SqlAnalyser._close, " SET ", update, " WHERE"));;
        }
Beispiel #11
0
        /// <summary>
        /// 获取AL操作字符串
        /// </summary>
        /// <param name="ochar">优先级运算</param>
        /// <param name="cchar">比较运算</param>
        /// <param name="data">成员名</param>
        /// <returns>按条件查询字符串</returns>
        public string GetOperator(OperatorChar ochar, OperatorChar cchar, string data)
        {
            string o = string.Empty;

            switch (ochar)
            {
            case OperatorChar.AND:
                o = "AND";
                break;

            case OperatorChar.OR:
                o = "OR";
                break;

            default:
                break;
            }
            string c = string.Empty;

            switch (cchar)
            {
            case OperatorChar.EQU:
                c = "=";
                break;

            case OperatorChar.NEQ:
                c = "<>";
                break;

            case OperatorChar.LSS:
                c = "<";
                break;

            case OperatorChar.LEQ:
                c = "<=";
                break;

            case OperatorChar.GTR:
                c = ">";
                break;

            case OperatorChar.GEQ:
                c = ">=";
                break;

            default:
                break;
            }
            string where = string.Empty;
            where        = EString.Contact(" ", o, " ", SqlAnalyser._open, Model.GetColumnName(data), SqlAnalyser._close, c, "@", data);
            return(where);
        }
Beispiel #12
0
        /// <summary>
        /// 获取插入的SQL
        /// </summary>
        /// <param name="data">成员名数组</param>
        /// <returns>插入字符串</returns>
        public string GetInsert(string[] data)
        {
            string insertFields = string.Empty;
            string insertValues = string.Empty;

            for (int i = 0; i < data.Length; i += 1)
            {
                insertFields = EString.Contact(insertFields, ",", SqlAnalyser._open, Model.GetColumnName(data[i]), SqlAnalyser._close, "");
                insertValues = EString.Contact(insertValues, ",@", data[i]);
            }
            insertFields = insertFields.Remove(0, 1);
            insertValues = insertValues.Remove(0, 1);
            return(EString.Contact(SqlAnalyser._open, Model.Table, SqlAnalyser._close, " (", insertFields, ") VALUES (", insertValues, ")"));
        }
Beispiel #13
0
        public void CompareTablesTest()
        {
            DBTable lTable = new DBTable();
            DBTable rTable = new DBTable();

            lTable.AddField("field", "String");
            rTable.AddField("field", "String");
            EString el  = new EString("Sample");
            DBRow   row = new DBRow();

            row.AddElement(el);
            lTable.AddRow(row);
            el  = new EString("Sample");
            row = new DBRow();
            row.AddElement(el);
            rTable.AddRow(row);
            Assert.AreEqual(lTable, rTable);
        }
Beispiel #14
0
        public void SearchTest()
        {
            DBTable searchTable = new DBTable();
            DBTable resultTable = new DBTable();

            searchTable.AddField("field", "String");
            resultTable.AddField("field", "String");
            DBRow   row = new DBRow();
            EString el  = new EString("RISC");

            row.AddElement(el);
            searchTable.AddRow(row);
            resultTable.AddRow(row);
            row = new DBRow();
            el  = new EString("CISC");
            row.AddElement(el);
            searchTable.AddRow(row);
            Assert.AreEqual(resultTable, searchTable.Search("R", "String"));
        }
Beispiel #15
0
 /// <summary>
 /// 获取按条件删除的SQL
 /// </summary>
 /// <returns>删除字符串</returns>
 public string GetDelete()
 {
     return(EString.Contact("DELETE ", SqlAnalyser._open, Model.Table, SqlAnalyser._close, " WHERE"));;
 }
 public static int CompareString(EString fst, EString sec)
 {
     return(fst - sec);
 }
Beispiel #17
0
 public CFingerPosition(EString eString, int nFret)
 {
     String = eString;
     Fret   = nFret;
 }
Beispiel #18
0
        public reg_info Add(reg_info reg_Info, pt_info pt_Info, reg_arrange reg_Arrange, string sno, string psOrdNum, out decimal amount, out int mzno, out int feeid, out List <comm_fee> commFees)
        {
            reg_Info.pid    = pt_Info.pid;
            reg_Info.argid  = reg_Arrange.argid;
            reg_Info.rtype  = reg_Arrange.regtype;
            reg_Info.dept   = reg_Arrange.dept;
            reg_Info.doctor = reg_Arrange.doctor;
            List <string> mznoQuery = new List <string>()
            {
                "update comm_key set id += 1 where sn = 52;",
                "SELECT [id] FROM [ZSHIS].[dbo].[comm_key] WHERE sn = 52"
            };

            mzno               = iReginfo.GetMzno(mznoQuery);
            reg_Info.mzno      = mzno;
            reg_Info.pname     = pt_Info.pname;
            reg_Info.sex       = pt_Info.sex;
            reg_Info.age       = EString.GetAge(pt_Info.birth.ToString()).ToString();
            reg_Info.agetype   = "岁";
            reg_Info.birth     = pt_Info.birth;
            reg_Info.addr1     = pt_Info.addr1;
            reg_Info.addr3     = pt_Info.addr3;
            reg_Info.tel       = pt_Info.tel;
            reg_Info.memo      = "自助机挂号";
            reg_Info.addperson = "自助机";
            reg_Info.status    = "候诊";
            reg_Info.addtime   = DateTime.Now;
            reg_Info.del       = true;
            reg_Info.doctor2   = reg_Arrange.doctor;

            var sysdictList = iReginfo.GetSysDict("SELECT [id] ,[fid] ,[code] ,[type] ,[detail] ,[sortno] ,[memo] ,[status] ,[del] ,[addtime] ,[moditime] ,[addperson] ,[fth] FROM [ZSHIS].[dbo].[sys_dict] where fid = 13999");

            var dept = string.Empty;

            if (sysdictList.Where(x => x.type == reg_Arrange.dept && x.type != "全部科室").Count() > 0)
            {
                dept = reg_Arrange.dept;
            }
            else
            {
                dept = "所有科室";
            }

            DateTime validate;
            var      memo = Convert.ToInt32(sysdictList.Where(x => x.detail == reg_Info.feetype && x.type == dept).FirstOrDefault().memo);

            if (memo == 0)
            {
                validate = Convert.ToDateTime("9999-12-31");
            }
            else
            {
                validate = Convert.ToDateTime(DateTime.Now.AddDays(memo - 1).ToShortDateString() + " 23:59:59");
            }

            var isCommQuery = "SELECT TOP 1 [iscomm] FROM [ZSHIS].[dbo].[reg_type] inner join reg_manage on reg_type.regtid = reg_manage.regtid where reg_type.del = 0 and reg_manage.del = 0 and mgrid = " + reg_Arrange.mgrid;

            reg_Info.iscomm   = iReginfo.GetComm(isCommQuery) > 0;
            reg_Info.validate = validate;

            var regid = iReginfo.Add(reg_Info);

            reg_Info.regid = regid;

            List <int> itemid = new List <int>();

            itemid.Add(Convert.ToInt32(reg_Arrange.itemid));
            commFees = iReginfo.GetComm_Fees(itemid.ToArray(), reg_Info.feetype == "医疗保险" ? 5 : 3);

            fee_info fee_Info = new fee_info()
            {
                pid       = pt_Info.pid,
                mzno      = mzno,
                regid     = regid,
                userid    = 89757,
                ftype     = 2,
                amountcol = commFees.Sum(x => x.prices),
                amountrec = commFees.Sum(x => x.prices),
                amountbak = 0,
                mantissa  = 0,
                username  = "******",
                addtime   = DateTime.Now,
                printqty  = 0,
                feeidoff  = 0,
                del       = true,
                status    = 0,
                sno       = psOrdNum
            };

            feeid = iFeeinfo.AddReturnId(fee_Info);
            var FeeInfoDetail = new List <fee_infodetail>();

            foreach (var commfee in commFees)
            {
                FeeInfoDetail.Add(new fee_infodetail()
                {
                    feeid      = feeid,
                    billid     = 0,
                    bdid       = 0,
                    dgid       = commfee.dgid,
                    itemid     = commfee.itemid ?? commfee.itemid,
                    itemname   = commfee.itemname ?? commfee.itemname,
                    spec       = "",
                    itemtype   = commfee.itemtype ?? commfee.itemtype,
                    unit       = commfee.unit,
                    prices     = commfee.prices == 0 ? commfee.prices : commfee.prices,
                    qty        = 1,
                    totalprice = commfee.prices == 0 ? commfee.prices * 1 : commfee.prices * 1,
                    feetype    = reg_Info.feetype,
                    disc       = 0,
                    execdept   = reg_Arrange.dept,
                    exectime   = DateTime.Now,
                    addtime    = DateTime.Now,
                    del        = true,
                    addperson  = "自助机缴费",
                    status     = 0
                });
            }
            amount = Convert.ToDecimal(commFees.Sum(x => x.prices) * 100);

            iFeeinfodetail.Adds(FeeInfoDetail.ToArray());
            reg_Arrange.regno    = reg_Info.regid;
            reg_Arrange.moditime = DateTime.Now;
            iRegarrange.Update(reg_Arrange);
            return(reg_Info);
        }
Beispiel #19
0
        private static void GetAL(SqlModel model)
        {
            Dictionary <string, List <string> >   UpdateDict  = new Dictionary <string, List <string> >();
            Dictionary <string, List <string> >   SelectDict  = new Dictionary <string, List <string> >();
            Dictionary <string, List <string> >   RepeateDict = new Dictionary <string, List <string> >();
            Dictionary <string, List <ALStruct> > Where       = new Dictionary <string, List <ALStruct> >();

            MemberInfo[] infos = model.Struction.Members.ToArray();
            for (int i = 0; i < infos.Length; i += 1)
            {
                MemberInfo info = infos[i];
                GetLogicalList <UpdateAttribute>(info, UpdateDict);
                GetLogicalList <SelectAttribute>(info, SelectDict);
                GetLogicalList <RepeateAttribute>(info, RepeateDict);
                GetLogicalList <AndGtrAttribute>(info, Where);
                GetLogicalList <OrGtrAttribute>(info, Where);
                GetLogicalList <AndGeqAttribute>(info, Where);
                GetLogicalList <OrGeqAttribute>(info, Where);
                GetLogicalList <AndEquAttribute>(info, Where);
                GetLogicalList <OrEquAttribute>(info, Where);
                GetLogicalList <AndNeqAttribute>(info, Where);
                GetLogicalList <OrNeqAttribute>(info, Where);
                GetLogicalList <AndLssAttribute>(info, Where);
                GetLogicalList <OrLssAttribute>(info, Where);
                GetLogicalList <AndLeqAttribute>(info, Where);
                GetLogicalList <OrLeqAttribute>(info, Where);
            }
            SqlMaker maker = new SqlMaker(model);


            foreach (var item in UpdateDict)
            {
                EString result    = maker.GetUpdate(item.Value.ToArray());
                EString condition = string.Empty;
                if (Where.ContainsKey(item.Key))
                {
                    List <ALStruct> models = Where[item.Key];
                    foreach (var alItem in models)
                    {
                        condition += maker.GetOperator(alItem.OChar, alItem.CChar, alItem.Data);
                    }
                    switch (models[0].OChar)
                    {
                    case OperatorChar.AND:
                        condition = condition.Remove(0, 4);
                        break;

                    case OperatorChar.OR:
                        condition = condition.Remove(0, 3);
                        break;

                    default:
                        break;
                    }
                }
                result += condition;
                model.ALMap[item.Key] = result.ToString();
            }
            foreach (var item in SelectDict)
            {
                string result    = maker.GetSelect(item.Value.ToArray());
                string condition = string.Empty;
                if (Where.ContainsKey(item.Key))
                {
                    List <ALStruct> models = Where[item.Key];
                    foreach (var alItem in models)
                    {
                        condition += maker.GetOperator(alItem.OChar, alItem.CChar, alItem.Data);
                    }
                    switch (models[0].OChar)
                    {
                    case OperatorChar.AND:
                        condition = condition.Remove(0, 4);
                        break;

                    case OperatorChar.OR:
                        condition = condition.Remove(0, 3);
                        break;

                    default:
                        break;
                    }
                }
                result += condition;
                model.ALMap[item.Key] = result;
            }
            foreach (var item in RepeateDict)
            {
                model.ALMap[item.Key] = maker.GetRepeate(item.Value.ToArray());
            }
        }
Beispiel #20
0
 static public void WriteLine(EString text)
 {
 }