Exemplo n.º 1
0
        private int GetTypeID(String name,XYECOM.Model.LabelTypeInfo info)
        {
            DataTable dt = new DataTable();

            XYECOM.Business.LabelType labeltype = new XYECOM.Business.LabelType();
            XYECOM.Model.LabelTypeInfo typeinfo = new XYECOM.Model.LabelTypeInfo();

            dt = XYECOM.Core.Data.SqlHelper.ExecuteTable("select * from b_labeltype where LT_Name = '"+ name +"'");
            if (dt.Rows.Count > 0)
            {
                return Convert.ToInt32(dt.Rows[0]["LT_ID"].ToString());
            }
            else {
                labeltype.Insert(info);
                dt = XYECOM.Core.Data.SqlHelper.ExecuteTable("select * from b_labeltype where LT_Name = '" + info.LT_Name + "'");
                return Convert.ToInt32(dt.Rows[0]["LT_ID"].ToString());
            }
        }
Exemplo n.º 2
0
        protected void ListBox_DataBound()
        {
            this.ddlclassID.Items.Clear();
            this.ddlclassID.Items.Add(new ListItem("��ѡ��Ҫ�����ı�ǩ����", "-1"));
            XYECOM.Business.LabelType lt = new XYECOM.Business.LabelType();
            String strwhere = " where LT_ParentID=0 ";
            DataTable dt = lt.GetDataTable(strwhere);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    this.ddlclassID.Items.Add(new ListItem(dt.Rows[i]["LT_Name"].ToString(), dt.Rows[i]["LT_ID"].ToString()));
                }
            }
        }