예제 #1
0
        /// <summary>
        /// 按条件查询
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="useage">使用场景</param>
        /// <param name="zType">类型</param>
        /// <returns></returns>
        public DataTable Search(string name, string useage, string ztype, string use = "", string fun = "", string style = "")
        {
            string where = "name LIKE @name";
            List <SqlParameter> sp = new List <SqlParameter> {
                new SqlParameter("name", "%" + name + "%")
            };

            if (!string.IsNullOrEmpty(useage))
            {
                where += " AND useage = @useage";
                sp.Add(new SqlParameter("useage", useage));
            }
            if (!string.IsNullOrEmpty(ztype))
            {
                where += " AND ztype = @ztype";
                sp.Add(new SqlParameter("ztype", ztype));
            }
            if (!string.IsNullOrEmpty(use))
            {
                where += " AND [use] LIKE @use";
                sp.Add(new SqlParameter("use", "%" + use + "%"));
            }
            if (!string.IsNullOrEmpty(fun))
            {
                where += " AND [fun] LIKE @fun";
                sp.Add(new SqlParameter("fun", "%" + fun + "%"));
            }
            if (!string.IsNullOrEmpty(style) && !style.Equals("全部"))
            {
                where += " AND [style] LIKE @style";
                sp.Add(new SqlParameter("style", "%" + style + "%"));
            }
            return(DBCenter.Sel(TbName, where, PK + " DESC", sp));
        }
예제 #2
0
        public DataTable Sel(int type, int state, string flow, string name, string stime, string etime)
        {
            string where = " 1=1 ";
            List <SqlParameter> sp = new List <SqlParameter>();

            if (type != -100)
            {
                where += " AND type=" + type;
            }
            if (state != -100)
            {
                where += " AND state=" + state;
            }
            if (!string.IsNullOrEmpty(flow))
            {
                where += " AND flow=@flow"; sp.Add(new SqlParameter("flow", flow));
            }
            if (!string.IsNullOrEmpty(name))
            {
                where += " AND ArriveName LIKE @name"; sp.Add(new SqlParameter("name", "%" + name + "%"));
            }
            if (!string.IsNullOrEmpty(stime))
            {
                where += " AND AgainTime>=@stime"; sp.Add(new SqlParameter("stime", stime));
            }
            if (!string.IsNullOrEmpty(etime))
            {
                where += " AND EndTime<=@etime"; sp.Add(new SqlParameter("etime", etime));
            }
            return(DBCenter.Sel(TbName, where, PK + " DESC", sp));
        }
예제 #3
0
        /// <summary>
        /// 获取通过审核的某版位的广告列表
        /// </summary>
        public static DataTable GetADList(int zoneId)
        {
            string where = "Passed=1 AND ADID IN (SELECT ADID FROM ZL_Zone_Advertisement WHERE ZoneID=" + zoneId + ")";
            DataTable dt = DBCenter.Sel(strTableName, where, "Priority DESC,ADID DESC");

            return(dt);
        }
예제 #4
0
        public DataTable Sel(Com_Filter filter)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = "1=1 ";
            if (filter.storeId != -100)
            {
                where += " AND StoreId=" + filter.storeId;
            }
            if (!string.IsNullOrEmpty(filter.status))
            {
                where += " AND ZStatus IN (" + filter.status + ")";
            }
            //根据姓名或号码搜索
            if (!string.IsNullOrEmpty(filter.uname))
            {
                sp.Add(new SqlParameter("uname", "%" + filter.uname + "%"));
                where += " AND (ClientName LIKE @uname  OR ClientMobile LIKE @uname)";
            }
            if (!string.IsNullOrEmpty(filter.addon))
            {
                sp.Add(new SqlParameter("addon", "%" + filter.addon + "%"));
                where += " AND EmployName LIKE @addon";
            }
            return(DBCenter.Sel(TbName, where, PK + " DESC", sp));
        }
예제 #5
0
        public DataTable Sel(Com_Filter filter)
        {
            string where = "";
            string order = "";

            switch (filter.orderBy)
            {
            case "money_desc":
                order = "Min DESC";
                break;

            case "money_asc":
                order = "Min ASC";
                break;

            case "id_desc":
            default:
                order = "ID DESC";
                break;
            }
            if (filter.storeId > 0)
            {
                where += " AND StoreID=" + filter.storeId;
            }
            return(DBCenter.Sel(TbName, where, order));
        }
예제 #6
0
        /// <summary>
        /// 点赞操作
        /// </summary>
        public bool AddLike(int uid, int infoID, string source)
        {
            source = source.ToLower();
            int taguser = 0;//受赞人

            switch (source)
            {
            case "plat":
                taguser = new B_Blog_Msg().SelReturnModel(infoID).CUser;
                break;

            case "bar":
                taguser = new B_Guest_Bar().SelReturnModel(infoID).CUser;
                break;

            case "baike":
            case "guest":
            default:
                break;
            }
            List <SqlParameter> sp = new List <SqlParameter> {
                new SqlParameter("@source", source)
            };
            string    sql = "SELECT * FROM " + TbName + " WHERE CUser="******" AND MsgID=" + infoID + " AND Source=@source";
            DataTable dt  = DBCenter.Sel(TbName, "CUser="******" AND MsgID=" + infoID + " AND Source=@source", "", sp);

            if (dt.Rows.Count <= 0)
            {
                return(Insert(new M_Plat_Like()
                {
                    CUser = uid, MsgID = infoID, TagUser = taguser, Source = source
                }) > 0);
            }
            return(false);
        }
예제 #7
0
        public DataTable SelByType(string ztype, string infotitle, int uid)
        {
            string where = "1=1 ";
            List <SqlParameter> sp = new List <SqlParameter>();

            if (!string.IsNullOrEmpty(ztype))
            {
                string typestr = "";
                foreach (string type in ztype.ToLower().Split(','))
                {
                    if (typeArr.Contains(type))
                    {
                        typestr += "'" + type + "',";
                    }
                }
                where += " AND ZType IN (" + typestr.Trim(',') + ")";
            }
            if (!string.IsNullOrEmpty(infotitle))
            {
                where += " AND InfoTitle LIKE @infotitle";
                sp.Add(new SqlParameter("infotitle", "%" + infotitle + "%"));
            }
            if (uid > 0)
            {
                where += " AND UserID = " + uid;
            }
            return(DBCenter.Sel(TbName, where, "CDate DESC,InfoID ASC", sp));
        }
예제 #8
0
        public DataTable Sel(string ntype = "", int zstatus = -100, int infoid = -100, string sdate = "", string title = "")
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = "1=1 ";
            if (!string.IsNullOrEmpty(ntype))
            {
                SafeSC.CheckIDSEx(ntype); where += " AND NType IN(" + ntype + ")";
            }
            if (zstatus != -100)
            {
                where += " AND ZStatus=" + zstatus;
            }
            if (infoid != -100)
            {
                where += " AND InfoID=" + infoid;
            }
            if (!string.IsNullOrEmpty(sdate))
            {
                where += " AND BeginDate>=@sdate"; sp.Add(new SqlParameter("sdate", sdate));
            }
            if (!string.IsNullOrEmpty(title))
            {
                where += " AND Title LIKE @title"; sp.Add(new SqlParameter("title", "%" + title + "%"));
            }
            return(DBCenter.Sel(TbName, where, "ID DESC", sp));
        }
예제 #9
0
파일: B_Admin.cs 프로젝트: baixue001/IPS
 public DataTable SelByIds(string ids, int islock = -1)
 {
     SafeSC.CheckDataEx(ids);
     string where = "AdminID IN (" + ids + ")";
     where       += islock > -1 ? " AND IsLock=" + islock : "";
     return(DBCenter.Sel(tbName, where, "CDATE DESC"));
 }
예제 #10
0
        public DataTable Search(string skey)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            sp.Add(new SqlParameter("Title", "%" + skey + "%"));
            return(DBCenter.Sel(TbName, "Title LIKE @Title", PK + " DESC", sp));
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         C_CopyRight.CheckLogin();
         CheckHasRule();
         if (GeneralID > 0)
         {
             M_CommonData conMod = conBll.SelReturnModel(GeneralID);
             NodeID       = conMod.NodeID;
             ModelID      = conMod.ModelID;
             Title_T.Text = conMod.Title;
             DataTable conDT = DBCenter.Sel(conMod.TableName, "ID=" + conMod.ItemID);
             if (conDT.Rows.Count > 0 && conDT.Columns.Contains("content"))
             {
                 content_t.Text = conDT.Rows[0]["content"].ToString();
             }
         }
         else
         {
             NodeID = 1; ModelID = 2;
         }
         M_Node      nodeMod = nodeBll.SelReturnModel(NodeID);
         M_ModelInfo model   = modelBll.SelReturnModel(ModelID);
         string      bread   = "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>" + Resources.L.工作台 + "</a></li><li><a href='ContentManage.aspx'>" + Resources.L.内容管理 + "</a></li><li><a href='ContentManage.aspx?NodeID=" + nodeMod.NodeID + "'>" + nodeMod.NodeName + "</a></li>";
         bread += "<li class='active'>[向本栏目添加" + model.ItemName + "]</li>";
         Call.SetBreadCrumb(Master, bread);
     }
 }
예제 #12
0
        /// <summary>
        /// 获取关键词信息
        /// </summary>
        /// <param name="skey">关键词</param>
        /// <param name="order">排序字段</param>
        /// <param name="sort">正序|倒序</param>
        public DataTable SelAll(string skey = "", string order = "", string sort = "")
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = "";
            if (!string.IsNullOrEmpty(skey))
            {
                where += " KeyWordText LIKE @skey"; sp.Add(new SqlParameter("skey", "%" + skey + "%"));
            }
            switch (order)
            {
            case "priority":
                order = "Priority";
                break;

            case "quote":
                order = "QuoteTimes";
                break;

            default:
                order = PK;
                break;
            }
            switch (sort)
            {
            case "asc":
                order += " ASC";
                break;

            default:
                order += " DESC";
                break;
            }
            return(DBCenter.Sel(TbName, where, order, sp));
        }
예제 #13
0
 public DataTable Search(string orderType, string logistics, string orderStatus, string payStatus, string stime, string etime, int storeid, string uname, string uids, string quickSql, string skeySql, List <SqlParameter> sp)
 {
     string where = " 1=1 ";
     if (!string.IsNullOrEmpty(orderType))
     {
         where += " AND Ordertype IN(" + orderType + ")"; SafeSC.CheckIDSEx(orderType);
     }
     if (!string.IsNullOrEmpty(logistics))
     {
         where += " AND StateLogistics IN (" + logistics + ")"; SafeSC.CheckIDSEx(logistics);
     }
     if (!string.IsNullOrEmpty(orderStatus))
     {
         where += " AND orderStatus IN (" + orderStatus + ")"; SafeSC.CheckIDSEx(orderStatus);
     }
     if (!string.IsNullOrEmpty(stime))
     {
         where += " AND DATEDIFF(DAY,@stime,AddTime) >= 0"; DateTime sdt; DateTime.TryParse(stime, out sdt); sp.Add(new SqlParameter("stime", stime));
     }
     if (!string.IsNullOrEmpty(etime))
     {
         where += " AND DATEDIFF(DAY,AddTime,@etime) >= 0"; DateTime edt; if (!DateTime.TryParse(etime, out edt))
         {
             edt = DateTime.Now;
         }
         sp.Add(new SqlParameter("etime", etime));
     }
     if (!string.IsNullOrEmpty(uname))
     {
         where += " AND ReName = @uname"; sp.Add(new SqlParameter("uname", uname));
     }
     if (!string.IsNullOrEmpty(payStatus))
     {
         where += " AND Paymentstatus=" + Convert.ToInt32(payStatus);
     }
     if (!string.IsNullOrEmpty(uids))
     {
         SafeSC.CheckIDSEx(uids); where += " AND UserID IN (" + uids + ")";
     }
     if (storeid == -100)//取全部
     {
     }
     else if (storeid == -99)//仅店铺
     {
         where += " AND StoreID>0";
     }
     else //仅取商城,或指定店铺
     {
         where += " AND StoreID=" + storeid;
     }
     if (!string.IsNullOrEmpty(quickSql))
     {
         where += " " + quickSql;
     }
     if (!string.IsNullOrEmpty(skeySql))
     {
         where += " " + skeySql;
     }
     return(DBCenter.Sel(TbName, where, PK + " DESC", sp));
 }
예제 #14
0
        public IActionResult ClientView()
        {
            if (Mid < 1)
            {
                return(WriteErr("未指定客户信息")); return(null);
            }
            if (!B_ARoleAuth.AuthCheckEx(ZLEnum.Auth.office, "crm"))
            {
                return(null);
            }
            M_CRMS_Client clientMod = new M_CRMS_Client();
            M_ModelInfo   modMod    = modBll.SelReturnModel(48);

            ViewBag.fieldDT = new B_ModelField().SelByModelID(modMod.ModelID, false, false);

            clientMod = clientBll.SelReturnModel(Mid);
            if (!string.IsNullOrEmpty(modMod.TableName) && clientMod.ItemID > 0)
            {
                ViewBag.valueDT = DBCenter.Sel(modMod.TableName, "ID=" + clientMod.ItemID);
            }
            ViewBag.conSetting = contactBll.SelPage(CPage, PSize, new F_CRMS_Contact()
            {
                ClientID = clientMod.ID
            });
            if (!string.IsNullOrEmpty(clientMod.LinkIds))
            {
                SafeSC.CheckIDSEx(clientMod.LinkIds);
                ViewBag.linkDT = DBCenter.SelWithField(clientMod.TbName, "id,ClientName AS name,phone", "ID IN (" + clientMod.LinkIds + ")");
            }
            return(View(clientMod));
        }
예제 #15
0
파일: B_Message.cs 프로젝트: baixue001/IPS
        public DataTable Sel(string type, string skey)
        {
            string where = " 1=1 ";
            List <SqlParameter> sp = new List <SqlParameter>();

            switch (type)
            {
            case "all":
                break;

            case "sys":
                where += " AND MsgType = 1";
                break;

            case "mb":
                where += " AND MsgType = 2";
                break;

            case "code":
                where += "AND MsgType = 3";
                break;
            }
            if (!string.IsNullOrEmpty(skey))
            {
                where += " AND Title LIKE @skey"; sp.Add(new SqlParameter("skey", "%" + skey + "%"));
            }
            return(DBCenter.Sel(strTableName, where, " PostDate DESC", sp));
        }
예제 #16
0
        protected void Print_Btn_Click(object sender, EventArgs e)
        {
            int devID = DataConvert.CLng(Request.Form["Dev_R"]);

            if (devID < 1)
            {
                function.WriteErrMsg("你还没有选择打印设备!");
            }
            int Num = DataConvert.CLng(Num_T.Text.Replace(" ", ""));

            if (Num < 1)
            {
                function.WriteErrMsg("请输入正确的打印数量!");
            }
            int orderID = DataConvert.CLng(Order_DP.SelectedValue);
            int tlpID   = DataConvert.CLng(Tlp_DP.SelectedValue);
            //------------------------------
            DataTable          orderDT = DBCenter.Sel("ZL_OrderInfo", "ID=" + orderID);
            M_Shop_PrintTlp    tlpMod  = tlpBll.SelReturnModel(tlpID);
            M_Shop_PrintDevice devMod  = devBll.SelReturnModel(devID);
            string             msg     = orderCOM.TlpDeal(tlpMod.Content, orderDT);

            msgBll.Insert(msg, tlpMod.ID, devMod, Num);
            function.WriteSuccessMsg("信息已发送", "MessageList.aspx");
        }
예제 #17
0
파일: B_Product.cs 프로젝트: baixue001/IPS
        /// <summary>
        /// 从数据库中移动商品相关信息
        /// </summary>
        public bool RealDelByIDS(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            DataTable dt    = DBCenter.Sel(TbName, "ID IN (" + ids + ")");
            string    items = StrHelper.GetIDSFromDT(dt, "ItemID");

            return(RealDelByIDS(ids, items));
        }
예제 #18
0
 //得到模型数据
 public DataTable GetContent(string tbname, int itemid)
 {
     if (string.IsNullOrEmpty(tbname))
     {
         return(null);
     }
     return(DBCenter.Sel(tbname, "ID=" + itemid));
 }
예제 #19
0
 public DataTable Sel(int emailID)
 {
     string where = "1=1";
     if (emailID > 0)
     {
         where += " AND EMailID=" + emailID;
     }
     return(DBCenter.Sel(TbName, where, PK + " DESC"));
 }
예제 #20
0
 public DataTable Sel(int uid)
 {
     string where = " 1=1 ";
     if (uid != -100)
     {
         where += " AND CUser="******"ID DESC"));
 }
예제 #21
0
파일: B_Product.cs 프로젝트: baixue001/IPS
        /// <summary>
        /// 判断库中是否已有相同编号商品
        /// </summary>
        /// <returns></returns>
        public bool IsExistProCode(string code)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            sp.Add(new SqlParameter("code", code));
            DataTable dt = DBCenter.Sel(TbName, "ProCode = @code", "", sp);

            return(dt.Rows.Count > 0);
        }
예제 #22
0
파일: B_Product.cs 프로젝트: baixue001/IPS
 public DataTable U_GetProductAll(int uid, int nodeid)
 {
     string where = "UserID=" + uid;
     if (nodeid > 0)
     {
         where += " AND NodeID=" + nodeid;
     }
     return(DBCenter.Sel(TbName, where, PK + " DESC"));
 }
예제 #23
0
 public DataTable Sel(Filter_Order filter)
 {
     string where = "1=1 ";
     if (!string.IsNullOrEmpty(filter.storeType))
     {
         where += " AND StoreID=" + Convert.ToInt32(filter.storeType);
     }
     return(DBCenter.Sel(TbName, where, "ID DESC"));
 }
예제 #24
0
파일: B_Node.cs 프로젝트: baixue001/IPS
 /// <summary>
 /// 获取选定的单页节点信息
 /// </summary>
 public DataTable GetCreateSingleByID(string nids)
 {
     if (string.IsNullOrEmpty(nids))
     {
         return(null);
     }
     SafeSC.CheckIDSEx(nids);
     return(DBCenter.Sel(TbName, "NodeType=2 and NodeID in (" + nids + ")", "OrderID"));
 }
예제 #25
0
        public DataTable SelByFieldName(string fieldName)
        {
            List <SqlParameter> spList = new List <SqlParameter>()
            {
                new SqlParameter("fieldName", fieldName)
            };

            return(DBCenter.Sel(TbName, "FieldName=@fieldName", "", spList));
        }
예제 #26
0
파일: B_Product.cs 프로젝트: baixue001/IPS
 public DataTable GetContent(string tablename, int Itemid)
 {
     if (string.IsNullOrEmpty(tablename) || Itemid < 1)
     {
         return(null);
     }
     SafeSC.CheckDataEx(tablename);
     return(DBCenter.Sel(tablename, "ID=" + Itemid));
 }
예제 #27
0
파일: B_Favorite.cs 프로젝트: baixue001/IPS
 public DataTable SelByType(int uid, int type = -100)
 {
     string where = "Owner=" + uid;
     if (type != -100)
     {
         where += " AND FavoriType=" + type;
     }
     return(DBCenter.Sel(TbName, where, PK + " DESC"));
 }
예제 #28
0
 public DataTable SelByUserGroup(int groupid)
 {
     string where = " State=1 AND Type=2 ";
     if (groupid > 0)
     {
         where += " AND (UserGroup='' OR  ','+UserGroup+',' LIKE '%,'+'" + groupid + "'+',%' ) ";
     }
     return(DBCenter.Sel(strTableName, where, "OrderID DESC"));
 }
예제 #29
0
        public M_UserBaseField getUserBaseFieldByFieldName(string fieldName)
        {
            List <SqlParameter> spList = new List <SqlParameter>()
            {
                new SqlParameter("fieldName", fieldName)
            };

            return(initMod.GetInfoFromDataTable(DBCenter.Sel("ZL_UserBaseField", "fieldName=@fieldName", "", spList)));
        }
예제 #30
0
 //-----------------------------------User
 public DataTable U_Sel(int uid, int status)
 {
     string where = "UserID=" + uid;
     if (status != -100)
     {
         where += " AND Status=" + status;
     }
     return(DBCenter.Sel(TbName, where, PK + " DESC"));
 }