示例#1
0
        protected void GridViewDic_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridViewDic.PageIndex = e.NewPageIndex;
            if (tbKeyWord.Text.Trim().Equals(""))
            {
                bind(lbType.Text);
            }
            else
            {
                string strwhere = " like ";
                string strcondition = ddlSType.SelectedValue;
                if (strcondition == "0")
                {
                    strwhere = " Code " + strwhere;
                }
                else
                {
                    strwhere = " Name " + strwhere;
                }
                strwhere = strwhere + " '%" + tbKeyWord.Text.Trim() + "%' ";

                LabMS.BLL.Dictionary dic = new LabMS.BLL.Dictionary();
                strwhere += " and DClass = '" + lbType.Text + "' " + " order by ID desc ";
                List<LabMS.Model.Dictionary> listDic = dic.GetModelList(strwhere);

                GridViewDic.DataSource = listDic;
                GridViewDic.DataBind();
            }
        }
示例#2
0
        //�������ֵ� ����List
        protected List<LabMS.Model.Dictionary> DictionaryDropdownlist(string code)
        {
            string strwhere = "DClass='" + code + "'";
            LabMS.BLL.Dictionary dic = new LabMS.BLL.Dictionary();

            List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>();
            list = dic.GetModelList(strwhere);
            return list;
        }
示例#3
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string strwhere = " like ";
            string strcondition = ddlSType.SelectedValue;
            if (strcondition == "0")
            {
                strwhere = " Code " + strwhere;
            }
            else
            {
                strwhere = " Name " + strwhere;
            }
            strwhere = strwhere + " '%" + tbKeyWord.Text.Trim() + "%' ";

            LabMS.BLL.Dictionary dic = new LabMS.BLL.Dictionary();
            strwhere += " and DClass = '" + lbType.Text + "' " + " order by ID desc ";
            List<LabMS.Model.Dictionary> listDic = dic.GetModelList(strwhere);

            GridViewDic.DataSource = listDic;
            GridViewDic.DataBind();
        }
示例#4
0
 /// <summary>
 /// 在新增项时检查Code是否存在
 /// </summary>
 /// <param name="DClass"></param>
 /// <param name="Code"></param>
 /// <returns></returns>
 public int IsCodeExist(string DClass, string Code)
 {
     string str = "DClass='" + DClass + "' and Code='"+Code+"'";
     LabMS.BLL.Dictionary BD = new LabMS.BLL.Dictionary();
     List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>();
     list=BD.GetModelList(str);
     if (list.Count > 0)
     {
         //已经存在
         return 0;
     }
     else
     {
         //不存在
         return 1;
     }
 }
示例#5
0
 /// <summary>
 /// 根据ID获得字典表中其它项的内容
 /// </summary>
 public List<LabMS.Model.Dictionary> GetListByID(long ID)
 {
     string str = "ID="+ID;
     LabMS.BLL.Dictionary BD = new LabMS.BLL.Dictionary();
     List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>();
     list=BD.GetModelList(str);
     return list;
 }
示例#6
0
        public List<LabMS.Model.Dictionary> GetItemListByDClass(string DClass)
        {
            string StrWhere = "";
            List<LabMS.Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>();
            LabMS.BLL.Dictionary bDictionary = new LabMS.BLL.Dictionary();

            if (!DClass.Equals(string.Empty))
            {
                StrWhere = "DClass = '" + DClass + "' ";
            }
            else
            {
                return null;
            }
            try
            {
                listCClass = bDictionary.GetModelList(StrWhere);
            }
            catch(Exception ex)
            {
                throw(new Exception("数据库链接错误"));
            }
            return listCClass;
        }