コード例 #1
0
ファイル: Rfid_tag_DAL.cs プロジェクト: Qq247534686/SCRT_MES
        /// <summary>
        /// 构建搜索条件
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        private string AppendWhere(object p)
        {
            string sqlWhere = " 1=1 ";

            if (p != null)
            {
                Rfid_tag obj = p as Rfid_tag;
                sqlWhere += string.IsNullOrEmpty(obj.Code) ? "" : " AND Code LIKE '%" + obj.Code + "%' ";
                sqlWhere += string.IsNullOrEmpty(obj.Empty_pt) ? "" : " AND Empty_pt LIKE '%" + obj.Empty_pt + "%' ";
                sqlWhere += obj.Actived <= 0 ? "" : " AND Actived=" + obj.Actived;
                sqlWhere += string.IsNullOrEmpty(obj.StartTime) ? "" : " AND Created>=" + obj.StartTime;
                sqlWhere += string.IsNullOrEmpty(obj.Matnr) ? "" : " AND matnr LIKE '%" + obj.Matnr + "%' ";
                sqlWhere += string.IsNullOrEmpty(obj.Exidv) ? "" : " AND exidv LIKE '%" + obj.Exidv + "%' ";
                sqlWhere += string.IsNullOrEmpty(obj.BinCode) ? "" : " AND binCode = '" + obj.BinCode + "' ";
                sqlWhere += string.IsNullOrEmpty(obj.tagFirst) ? "" : " AND tagfirst LIKE '%" + obj.tagFirst + "%' ";
                sqlWhere += string.IsNullOrEmpty(obj.tagLast) ? "" : " AND taglast LIKE '%" + obj.tagLast + "%' ";
                sqlWhere += string.IsNullOrEmpty(obj.StartTime) ? "" : " AND Created>=" + obj.StartTime;
                sqlWhere += string.IsNullOrEmpty(obj.EndTime) ? "" : " AND Created<=" + obj.EndTime;
            }
            return(sqlWhere);
        }
コード例 #2
0
        public ServerMessage InsertOrUpdateTag(Rfid_tag tag)
        {
            ServerMessage newServerMessage = new ServerMessage();
            var           codeStr          = ConfigurationManager.AppSettings["CodeRegex"].ToString();
            string        msg = this.SqlProcedure <string>("InsertOrUpdateTag", new { codeStr = codeStr, tagFirstC = tag.tagFirst, tagLastC = tag.tagLast }).FirstOrDefault();

            if (string.IsNullOrEmpty(msg))
            {
                newServerMessage = new ServerMessage()
                {
                    Code = 1, Msg = "This Code Is Null"
                };
            }
            else
            {
                newServerMessage = new ServerMessage()
                {
                    Code = 0, Msg = msg
                };
            }

            return(newServerMessage);
        }
コード例 #3
0
 public ServerMessage InsertOrUpdateTag(Rfid_tag tag)
 {
     return(bll.InsertOrUpdateTag(tag));
 }
コード例 #4
0
        public ActionResult EditSaveMethod(Rfid_tag theRfid_tag)
        {
            MessageShow msg = bll.EditSaveMethod(theRfid_tag);

            return(Json(new { success = msg.success, message = msg.message }, JsonRequestBehavior.AllowGet));
        }
コード例 #5
0
 public void SearchWhere(Rfid_tag theRfid_tag)
 {
     rfid_tag = theRfid_tag;
 }