Beispiel #1
0
        /// <summary>
        /// 查询完WebService之后更新记录表
        /// </summary>
        /// <param name="cq">记录表对象</param>
        /// <param name="msg">查询之后的消息</param>
        private void ChangeQueryRecordStatu(BLL.Request.Request cq, string msg)
        {
            Model.QueryRecoder queryRecoder = cq.QueryRecoderModel;
            int queryDateInterval           = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["QueryDateInterval"].Trim());

            if (queryRecoder != null)
            {
                try
                {
                    if ((DateTime.Now - queryRecoder.AddDate).Days > queryDateInterval)
                    {
                        //超时数据
                        queryRecoder.LastQueryDate = DateTime.Now;
                        queryRecoder.IsDel         = true;
                    }
                    else
                    {
                        //不超时数据
                        queryRecoder.LastQueryDate = DateTime.Now;
                    }
                    queryRecoder.QueryResult = ("&nbsp" + DateTime.Now.ToLocalTime() + " " + msg + queryRecoder.QueryResult);
                    QueryRecoder q = new QueryRecoder();
                    q.Update(queryRecoder);
                }
                catch (Exception ex)
                {
                    Common.LogHelper.WriteError(ex);
                }
            }
        }
Beispiel #2
0
        public List <Model.QueryRecoder> CheckQueryRecord(Model.QueryRecoder model)
        {
            BLL.QueryRecoder qr           = new BLL.QueryRecoder();
            QueryRecoder     queryRecoder = new QueryRecoder();
            //查询本地数据库有没有数据
            StringBuilder strWhere = new StringBuilder();

            if (!string.IsNullOrEmpty(model.Uname))
            {
                strWhere.AppendFormat("Uname = {0} and ", "'" + model.Uname + "'");
            }
            if (!string.IsNullOrEmpty(model.Code))
            {
                strWhere.AppendFormat("Code = {0} and ", "'" + model.Code + "'");
            }
            if (!string.IsNullOrEmpty(model.CodeType))
            {
                strWhere.AppendFormat("CodeType = {0} and ", "'" + model.CodeType + "'");
            }
            if (!string.IsNullOrEmpty(model.QueryType))
            {
                strWhere.AppendFormat("QueryType = {0} and  ", "'" + model.QueryType + "'");
            }
            if (!model.IsDel)
            {
                strWhere.AppendFormat("IsDel = {0}", "'" + model.IsDel + "'");
            }
            //查询条件是,当前用户添加的卡号为X的卡号类型为Y的没有标记删除的并且临床数据类型为Z的数据
            return(qr.GetModelList(strWhere.ToString()));
        }
Beispiel #3
0
 public List<Model.QueryRecoder> CheckQueryRecord(Model.QueryRecoder model)
 {
     BLL.QueryRecoder qr = new BLL.QueryRecoder();
     QueryRecoder queryRecoder = new QueryRecoder();
     //查询本地数据库有没有数据
     StringBuilder strWhere = new StringBuilder();
     if (!string.IsNullOrEmpty(model.Uname))
     {
         strWhere.AppendFormat("Uname = {0} and ", "'" + model.Uname + "'");
     }
     if (!string.IsNullOrEmpty(model.Code))
     {
         strWhere.AppendFormat("Code = {0} and ", "'" + model.Code + "'");
     }
     if (!string.IsNullOrEmpty(model.CodeType))
     {
         strWhere.AppendFormat("CodeType = {0} and ", "'" + model.CodeType + "'");
     }
     if (!string.IsNullOrEmpty(model.QueryType))
     {
         strWhere.AppendFormat("QueryType = {0} and  ", "'" + model.QueryType + "'");
     }
     if (!model.IsDel)
     {
         strWhere.AppendFormat("IsDel = {0}", "'" + model.IsDel + "'");
     }
     //查询条件是,当前用户添加的卡号为X的卡号类型为Y的没有标记删除的并且临床数据类型为Z的数据
     return qr.GetModelList(strWhere.ToString());
 }
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="context"></param>
        private static void DeleteData(HttpContext context)
        {
            string mes = "";

            if (context.Request["pk"] != null)
            {
                string    pk      = context.Request["pk"];
                string[]  ArrayPk = pk.Split(',');
                ArrayList list    = new ArrayList();
                for (int i = 0; i < ArrayPk.Length - 1; i++)
                {
                    string strnull = ArrayPk[i];
                    if (strnull != "")
                    {
                        list.Add(ArrayPk[i]);
                    }
                }
                RuRo.BLL.QueryRecoder bll_QueryRecoder = new BLL.QueryRecoder();
                int    successNumber = 0;
                string errorMessage  = "";
                foreach (string strPk in list)
                {
                    if (bll_QueryRecoder.Delete(int.Parse(strPk)))
                    {
                        successNumber += 1;
                    }
                }
                mes = "成功删除[" + successNumber.ToString() + "/" + ArrayPk.Length.ToString() + "]条数据;" + errorMessage;
            }
            else
            {
                mes = "PK字段为Null";
            }
            context.Response.Write(mes);
        }
        /// <summary>
        /// 查询数据
        /// </summary>
        /// <param name="context"></param>
        private static void QueryData(HttpContext context)
        {
            string adddate  = context.Request.Params["adddate"].ToString();
            string username = Common.CookieHelper.GetCookieValue("username");

            RuRo.BLL.QueryRecoder     bll  = new BLL.QueryRecoder();
            List <Model.QueryRecoder> list = bll.GetModelList("IsDel=0 and AddDate!='" + adddate + "' and Uname='" + username + "'");
            string mes = FreezerProUtility.Fp_Common.FpJsonHelper.ObjectToJsonStr(list);

            context.Response.Write(mes);
        }
Beispiel #6
0
        /// <summary>
        /// 检查数据是否存在,会检测添加日期 true存在
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool CheckRecord(Model.QueryRecoder model)
        {
            BLL.QueryRecoder qr           = new BLL.QueryRecoder();
            QueryRecoder     queryRecoder = new QueryRecoder();
            //查询本地数据库有没有数据
            StringBuilder strWhere = new StringBuilder();

            if (!string.IsNullOrEmpty(model.Uname))
            {
                strWhere.AppendFormat("Uname = {0} and ", "'" + model.Uname + "'");
            }
            if (!string.IsNullOrEmpty(model.Code))
            {
                strWhere.AppendFormat("Code = {0} and ", "'" + model.Code + "'");
            }
            if (!string.IsNullOrEmpty(model.CodeType))
            {
                strWhere.AppendFormat("CodeType = {0} and ", "'" + model.CodeType + "'");
            }
            if (!string.IsNullOrEmpty(model.QueryType))
            {
                strWhere.AppendFormat("QueryType = {0} and  ", "'" + model.QueryType + "'");
            }
            if (!model.IsDel)
            {
                strWhere.AppendFormat("IsDel = {0} and ", "'" + model.IsDel + "'");
            }
            DateTime date = new DateTime();

            if (DateTime.TryParse(model.AddDate.ToString("yyyy-MM-dd"), out date))
            {
                // select * from dbo.QueryRecoder where REPLACE(CONVERT(Char(10),AddDate,111),'/','-')='2015-08-06'
                strWhere.AppendFormat("REPLACE(CONVERT(Char(10),AddDate,111),'/','-')={0}", "'" + model.AddDate.ToString("yyyy-MM-dd") + "'");
                //strWhere.AppendFormat("AddDate = {0}", "'" + model.AddDate + "'");
            }
            //查询条件是,当前用户添加的卡号为X的卡号类型为Y的没有标记删除的并且临床数据类型为Z的数据
            List <Model.QueryRecoder> list = new List <Model.QueryRecoder>();

            list = qr.GetModelList(strWhere.ToString());
            if (list != null && list.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #7
0
        //private bool SaveQueryRecord(ref Model.DTO.NormalLisItemsRequest resquet, string Msg, string codeType)
        //{
        //    bool result = false;
        //    QueryRecoder queryRecoder = new QueryRecoder();
        //    //根据传入的查询字符串创建的当此查询的记录model
        //    Model.QueryRecoder model = new Model.QueryRecoder();

        //    //model.AddDate = DateTime.Now;
        //    model.Code = request.hospnum;
        //    model.CodeType = codeType;
        //    model.QueryType = "NormalLisItems";
        //    model.Uname = Common.CookieHelper.GetCookieValue("username");
        //    model.IsDel = false;

        //    List<Model.QueryRecoder> list = CheckQueryRecord(model);
        //    if (list != null && list.Count > 0)
        //    {
        //        //判断查询出来的数据是否满足要求(时间差距lastdate<dateNow-5)
        //        Model.QueryRecoder oldModel = list.OrderByDescending(a => a.LastQueryDate).FirstOrDefault();
        //        model.AddDate = oldModel.AddDate;
        //        model.Id = oldModel.Id;
        //        DateTime dtAdd = Convert.ToDateTime(oldModel.AddDate);
        //        DateTime dtLastQuery = Convert.ToDateTime(oldModel.LastQueryDate);
        //        DateTime dt = DateTime.Now;//当前时间
        //        int days = (dt - dtAdd).Days;//获取当前日期与添加日期时间差
        //        int getDays = 0;
        //        if (days > getDays)
        //        {
        //            model.IsDel = true;
        //            model.LastQueryDate = dtAdd.AddDays(5);
        //        }
        //        else
        //        {
        //            int chaday = (dtLastQuery - dtAdd).Days;//获取最后查询日期与添加日期时间差
        //            int nowday = (dt - dtLastQuery).Days;//当前时间与最后查询时间差
        //            int addnowDay = (dt - dtAdd).Days;//当前时间与添加时间差
        //            if (nowday == 0)
        //            {
        //                //resquet.jsrq00 = "";
        //                //resquet.ksrq00 = "";
        //                result = true;
        //                model.IsDel = false;
        //                model.QueryResult += "&nbsp" + DateTime.Now.ToLocalTime() + " " + Msg + oldModel.QueryResult;
        //            }
        //            if (nowday > 0)//当前时间与最后查询时间差大于0
        //            {
        //                if (addnowDay == 0)
        //                {
        //                    result = true;
        //                    model.IsDel = false;
        //                    model.QueryResult += "&nbsp" + DateTime.Now.ToLocalTime() + " " + Msg + oldModel.QueryResult;
        //                }
        //                if (chaday >= getDays)
        //                {
        //                    model.IsDel = true;
        //                }
        //                else
        //                {
        //                    resquet.ksrq00 = dtLastQuery.ToString("yyyy-MM-dd");
        //                    resquet.jsrq00 = dtLastQuery.AddDays(1).ToString("yyyy-MM-dd");
        //                    result = true;
        //                    //添加日期是距离添加日期是5天内的
        //                    model.IsDel = false;
        //                    model.QueryResult += "&nbsp" + DateTime.Now.ToLocalTime() + " " + Msg + oldModel.QueryResult;
        //                }
        //            }
        //        }
        //        //本地数据库有数据
        //        result = queryRecoder.Update(model);
        //    }
        //    else
        //    {
        //        model.QueryResult += "&nbsp" + DateTime.Now.ToLocalTime() + " " + Msg.Trim();
        //        model.AddDate = DateTime.Now;
        //        model.LastQueryDate = DateTime.Now;
        //        bool bo = queryRecoder.Add(model) > 0;
        //        model.QueryType = "PatientDiagnose";
        //        bool boo = queryRecoder.Add(model) > 0;
        //        if (bo && boo)
        //        {
        //            result = true;
        //        }
        //        else { result = false; }
        //    }
        //    return result;
        //}

        private List <Model.QueryRecoder> CheckQueryRecord(Model.QueryRecoder model)
        {
            QueryRecoder queryRecoder = new QueryRecoder();
            //查询本地数据库有没有数据
            StringBuilder strWhere = new StringBuilder();

            strWhere.AppendFormat("Uname = {0} and ", "'" + model.Uname + "'");
            strWhere.AppendFormat("Code = {0} and ", "'" + model.Code + "'");
            strWhere.AppendFormat("CodeType = {0} and ", "'" + model.CodeType + "'");
            strWhere.AppendFormat("IsDel = {0} and ", "'" + model.IsDel + "'");
            strWhere.AppendFormat("QueryType = {0} and  ", "'" + model.QueryType + "'");
            strWhere.AppendFormat("IsDel = {0}", "'" + false + "'");

            //查询条件是,当前用户添加的卡号为X的卡号类型为Y的没有标记删除的并且临床数据类型为Z的数据
            return(queryRecoder.GetModelList(strWhere.ToString()));
        }
Beispiel #8
0
 /// <summary>
 /// 检查数据是否存在,会检测添加日期 true存在
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool CheckRecord(Model.QueryRecoder model)
 {
     BLL.QueryRecoder qr = new BLL.QueryRecoder();
     QueryRecoder queryRecoder = new QueryRecoder();
     //查询本地数据库有没有数据
     StringBuilder strWhere = new StringBuilder();
     if (!string.IsNullOrEmpty(model.Uname))
     {
         strWhere.AppendFormat("Uname = {0} and ", "'" + model.Uname + "'");
     }
     if (!string.IsNullOrEmpty(model.Code))
     {
         strWhere.AppendFormat("Code = {0} and ", "'" + model.Code + "'");
     }
     if (!string.IsNullOrEmpty(model.CodeType))
     {
         strWhere.AppendFormat("CodeType = {0} and ", "'" + model.CodeType + "'");
     }
     if (!string.IsNullOrEmpty(model.QueryType))
     {
         strWhere.AppendFormat("QueryType = {0} and  ", "'" + model.QueryType + "'");
     }
     if (!model.IsDel)
     {
         strWhere.AppendFormat("IsDel = {0} and ", "'" + model.IsDel + "'");
     }
     DateTime date = new DateTime();
     if (DateTime.TryParse(model.AddDate.ToString("yyyy-MM-dd"), out date))
     {
         // select * from dbo.QueryRecoder where REPLACE(CONVERT(Char(10),AddDate,111),'/','-')='2015-08-06'
         strWhere.AppendFormat("REPLACE(CONVERT(Char(10),AddDate,111),'/','-')={0}", "'" + model.AddDate.ToString("yyyy-MM-dd") + "'");
         //strWhere.AppendFormat("AddDate = {0}", "'" + model.AddDate + "'");
     }
     //查询条件是,当前用户添加的卡号为X的卡号类型为Y的没有标记删除的并且临床数据类型为Z的数据
     List<Model.QueryRecoder> list = new List<Model.QueryRecoder>();
     list = qr.GetModelList(strWhere.ToString());
     if (list != null && list.Count > 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Beispiel #9
0
 private void ChangeQueryRecordStatu(Model.QueryRecoder queryRecoder, string msg)
 {
     int queryDateInterval = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["QueryDateInterval"].Trim());
     if (queryRecoder != null)
     {
         try
         {
             if ((DateTime.Now - queryRecoder.AddDate).Days > queryDateInterval)
             {
                 //超时数据
                 queryRecoder.LastQueryDate = DateTime.Now;
                 queryRecoder.IsDel = true;
             }
             else
             {
                 //不超时数据
                 queryRecoder.LastQueryDate = DateTime.Now;
             }
             if (!string.IsNullOrEmpty(msg))
             {
                 queryRecoder.QueryResult = (" &nbsp " + DateTime.Now.ToLocalTime() + " " + msg + queryRecoder.QueryResult);
             }
             QueryRecoder q = new QueryRecoder();
             q.Update(queryRecoder);
         }
         catch (Exception ex)
         {
             Common.LogHelper.WriteError(ex);
         }
     }
 }
Beispiel #10
0
        //private bool SaveQueryRecord(ref Model.DTO.NormalLisItemsRequest resquet, string Msg, string codeType)
        //{
        //    bool result = false;
        //    QueryRecoder queryRecoder = new QueryRecoder();
        //    //根据传入的查询字符串创建的当此查询的记录model
        //    Model.QueryRecoder model = new Model.QueryRecoder();
        //    //model.AddDate = DateTime.Now;
        //    model.Code = request.hospnum;
        //    model.CodeType = codeType;
        //    model.QueryType = "NormalLisItems";
        //    model.Uname = Common.CookieHelper.GetCookieValue("username");
        //    model.IsDel = false;
        //    List<Model.QueryRecoder> list = CheckQueryRecord(model);
        //    if (list != null && list.Count > 0)
        //    {
        //        //判断查询出来的数据是否满足要求(时间差距lastdate<dateNow-5)
        //        Model.QueryRecoder oldModel = list.OrderByDescending(a => a.LastQueryDate).FirstOrDefault();
        //        model.AddDate = oldModel.AddDate;
        //        model.Id = oldModel.Id;
        //        DateTime dtAdd = Convert.ToDateTime(oldModel.AddDate);
        //        DateTime dtLastQuery = Convert.ToDateTime(oldModel.LastQueryDate);
        //        DateTime dt = DateTime.Now;//当前时间
        //        int days = (dt - dtAdd).Days;//获取当前日期与添加日期时间差
        //        int getDays = 0;
        //        if (days > getDays)
        //        {
        //            model.IsDel = true;
        //            model.LastQueryDate = dtAdd.AddDays(5);
        //        }
        //        else
        //        {
        //            int chaday = (dtLastQuery - dtAdd).Days;//获取最后查询日期与添加日期时间差
        //            int nowday = (dt - dtLastQuery).Days;//当前时间与最后查询时间差
        //            int addnowDay = (dt - dtAdd).Days;//当前时间与添加时间差
        //            if (nowday == 0)
        //            {
        //                //resquet.jsrq00 = "";
        //                //resquet.ksrq00 = "";
        //                result = true;
        //                model.IsDel = false;
        //                model.QueryResult += "&nbsp" + DateTime.Now.ToLocalTime() + " " + Msg + oldModel.QueryResult;
        //            }
        //            if (nowday > 0)//当前时间与最后查询时间差大于0
        //            {
        //                if (addnowDay == 0)
        //                {
        //                    result = true;
        //                    model.IsDel = false;
        //                    model.QueryResult += "&nbsp" + DateTime.Now.ToLocalTime() + " " + Msg + oldModel.QueryResult;
        //                }
        //                if (chaday >= getDays)
        //                {
        //                    model.IsDel = true;
        //                }
        //                else
        //                {
        //                    resquet.ksrq00 = dtLastQuery.ToString("yyyy-MM-dd");
        //                    resquet.jsrq00 = dtLastQuery.AddDays(1).ToString("yyyy-MM-dd");
        //                    result = true;
        //                    //添加日期是距离添加日期是5天内的
        //                    model.IsDel = false;
        //                    model.QueryResult += "&nbsp" + DateTime.Now.ToLocalTime() + " " + Msg + oldModel.QueryResult;
        //                }
        //            }
        //        }
        //        //本地数据库有数据
        //        result = queryRecoder.Update(model);
        //    }
        //    else
        //    {
        //        model.QueryResult += "&nbsp" + DateTime.Now.ToLocalTime() + " " + Msg.Trim();
        //        model.AddDate = DateTime.Now;
        //        model.LastQueryDate = DateTime.Now;
        //        bool bo = queryRecoder.Add(model) > 0;
        //        model.QueryType = "PatientDiagnose";
        //        bool boo = queryRecoder.Add(model) > 0;
        //        if (bo && boo)
        //        {
        //            result = true;
        //        }
        //        else { result = false; }
        //    }
        //    return result;
        //}
        private List<Model.QueryRecoder> CheckQueryRecord(Model.QueryRecoder model)
        {
            QueryRecoder queryRecoder = new QueryRecoder();
            //查询本地数据库有没有数据
            StringBuilder strWhere = new StringBuilder();
            strWhere.AppendFormat("Uname = {0} and ", "'" + model.Uname + "'");
            strWhere.AppendFormat("Code = {0} and ", "'" + model.Code + "'");
            strWhere.AppendFormat("CodeType = {0} and ", "'" + model.CodeType + "'");
            strWhere.AppendFormat("IsDel = {0} and ", "'" + model.IsDel + "'");
            strWhere.AppendFormat("QueryType = {0} and  ", "'" + model.QueryType + "'");
            strWhere.AppendFormat("IsDel = {0}", "'" + false + "'");

            //查询条件是,当前用户添加的卡号为X的卡号类型为Y的没有标记删除的并且临床数据类型为Z的数据
            return queryRecoder.GetModelList(strWhere.ToString());
        }
Beispiel #11
0
 /// <summary>
 /// ɾ������
 /// </summary>
 /// <param name="context"></param>
 private static void DeleteData(HttpContext context)
 {
     string mes = "";
     if (context.Request["pk"] != null)
     {
         string pk = context.Request["pk"];
         string[] ArrayPk = pk.Split(',');
         ArrayList list = new ArrayList();
         for (int i = 0; i < ArrayPk.Length - 1; i++)
         {
             string strnull = ArrayPk[i];
             if (strnull != "")
             {
                 list.Add(ArrayPk[i]);
             }
         }
         RuRo.BLL.QueryRecoder bll_QueryRecoder = new BLL.QueryRecoder();
         int successNumber = 0;
         string errorMessage = "";
         foreach (string strPk in list)
         {
             if (bll_QueryRecoder.Delete(int.Parse(strPk)))
             {
                 successNumber += 1;
             }
         }
         mes = "�ɹ�ɾ��[" + successNumber.ToString() + "/" + ArrayPk.Length.ToString() + "]������;" + errorMessage;
     }
     else
     {
         mes = "PK�ֶ�ΪNull";
     }
     context.Response.Write(mes);
 }
Beispiel #12
0
 /// <summary>
 /// ��ѯ����
 /// </summary>
 /// <param name="context"></param>
 private static void QueryData(HttpContext context)
 {
     string adddate = context.Request.Params["adddate"].ToString();
     string username = Common.CookieHelper.GetCookieValue("username");
     RuRo.BLL.QueryRecoder bll = new BLL.QueryRecoder();
     List<Model.QueryRecoder> list = bll.GetModelList("IsDel=0 and AddDate!='" + adddate + "' and Uname='" + username + "'");
     string mes = FreezerProUtility.Fp_Common.FpJsonHelper.ObjectToJsonStr(list);
     context.Response.Write(mes);
 }