Exemplo n.º 1
0
        private void btnSaveTitle_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.cmbAction.Text))
            {
                MessageBox.Show("请输入描述信息");
                return;
            }

            ALS.BLL.actiontitle bllat = new ALS.BLL.actiontitle();
            if (bllat.GetModel(this.cmbAction.Text, GetmethodStyle(_method)) == null)
            {
                ALS.Model.actiontitle mat = new ALS.Model.actiontitle();
                mat.info   = this.cmbAction.Text.Trim();
                mat.method = GetmethodStyle(_method);
                if (bllat.Add(mat))
                {
                    GetActionInfoList(this.cmbAction, GetmethodStyle(_method));
                    MessageBox.Show("保存成功!");
                }
            }
            else
            {
                MessageBox.Show("已存在的描述信息!");
            }
        }
Exemplo n.º 2
0
        private void GetActionInfoList(ComboBox cmb, string method)
        {
            cmb.Items.Clear();
            ALS.BLL.actiontitle bllat = new ALS.BLL.actiontitle();
            DataSet             dsAt  = bllat.GetList("method='" + method + "'");
            int count = dsAt.Tables[0].Rows.Count;

            for (int i = 0; i < count; i++)
            {
                cmb.Items.Add(dsAt.Tables[0].Rows[i]["info"].ToString());
            }
            //List<CustomActions.Model.actiontitle> lstMat = bllat.GetModelList("");
            //foreach(var v in lstMat)
            //{
            //    cmb.Items.Add(v.info);
            //}
        }