Exemplo n.º 1
0
 private void SetInfo(Foresight.DataAccess.Wechat_Business data)
 {
     this.tdBusinessName.Value    = data.BusinessName;
     this.tdBusinessSummary.Value = data.BusinessSummary;
     this.tdIsPublish.Value       = data.IsPublish ? "1" : "0";
     this.tdPhoneNumber.Value     = data.PhoneNumber;
     this.BusinessImgPath         = !string.IsNullOrEmpty(data.BusinessImg) ? WebUtil.GetContextPath() + data.BusinessImg : string.Empty;
 }
Exemplo n.º 2
0
        public static Ui.DataGrid GeWechat_BusinessGridByKeywords(string Keywords, string orderBy, long startRowIndex, int pageSize)
        {
            long totalRows = 0;
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add(" 1=1 ");
            if (!string.IsNullOrEmpty(Keywords))
            {
                conditions.Add("([BusinessName] like @Keywords or [PhoneNumber] like @Keywords)");
                parameters.Add(new SqlParameter("@Keywords", "%" + Keywords + "%"));
            }
            string fieldList = "[Wechat_Business].*";
            string Statement = " from [Wechat_Business] where  " + string.Join(" and ", conditions.ToArray());

            Wechat_Business[] list = new Wechat_Business[] { };
            list = GetList <Wechat_Business>(fieldList, Statement, parameters, orderBy, startRowIndex, pageSize, out totalRows).ToArray();
            DataAccess.Ui.DataGrid dg = new Ui.DataGrid();
            dg.rows  = list;
            dg.total = totalRows;
            dg.page  = pageSize;
            return(dg);
        }