Example #1
0
        private void Temp_Click(object sender, EventArgs e)
        {
            Label lb = sender as Label;

            Tiname = lb.Text.Trim();
            m_menu_list mml = new m_menu_list();

            mml.Select("and tname='" + Tiname + "' and uname='" + Uiname + "'");
        }
Example #2
0
        private void Uman_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < -1)
            {
                return;
            }

            info.Text  = "用户:" + Uman.SelectedRows[0].Cells["turename"].Value;
            info.Text += " 职务:" + Uman.SelectedRows[0].Cells["dept"].Value;
            Uiname     = Uman.SelectedRows[0].Cells["turename"].Value.ToString();


            List <m_menu_list> pp = new m_menu_list().Select("and tname='" + Tiname + "' and uname='" + Uiname + "'");

            SetCheckBox((from r in pp select r.MNAME).ToList());
        }
Example #3
0
        private void Ad_Click(object sender, EventArgs e)
        {
            if (Uiname == "" || Uiname is null || Tiname == "" || Tiname is null)
            {
                return;
            }

            string Miname = string.Empty;

            if (Mlist.Count <= 0)
            {
                Miname = "";
            }
            else
            {
                for (int i = 0; i < Mlist.Count; i++)
                {
                    Miname += Mlist[i] + ",";
                }
                Miname = Ifun.Left(Miname, Miname.Length - 1);
            }

            m_menu_list        mml = new m_menu_list();
            List <m_menu_list> ms  = mml.Select("and tname='" + Tiname + "' and uname='" + Uiname + "'");

            mml.Reset_m_menu_list();
            mml.UNAME = Uiname;
            mml.TNAME = Tiname;
            mml.MNAME = Miname;
            if (ms.Count > 0)
            {
                mml.Updata("and tname='" + Tiname + "' and uname='" + Uiname + "'");
            }
            else
            {
                mml.Insert();
            }

            Msg err = new Msg(3, "保存成功!");
        }