Exemplo n.º 1
0
        public void insert_log(string tz)
        {
            DateTime dt = DateTime.Now;

            string[] r = { "R操作记录", "R操作对象", "R操作类型", "R操作人", "R操作时间", "R操作日" };
            string[] v = { "台账名称:" + tz, dx, cz, user, dt.ToString(), dt.ToShortDateString() };
            s1.insert_only("B操作记录", r, v);
        }
Exemplo n.º 2
0
        private void save_Click(object sender, EventArgs e)
        {
            user_x  ux1 = new user_x(username, "添加", "台账");
            sql_sel s1  = new sql_sel();

            ux1.insert_log(mincheng.Text);
            MessageBox.Show("添加了" + s1.insert_only("B台账", dbo(), values()) + "条数据!台账里有" + img_add() + "张图片," + shiyitu_add() + "示意图!", "提示", MessageBoxButtons.OK);
            ID.Text = Convert.ToString(int.Parse(ID.Text) + 1);
        }
Exemplo n.º 3
0
 private void add_zt_Click(object sender, EventArgs e)
 {
     try
     {
         sql_sel  s1 = new sql_sel();
         string[] r  = { "R安装状态" };
         string[] v  = { zt.Text };
         MessageBox.Show("成功添加安装状态 " + zt.Text + " " + s1.insert_only("B安装状态", r, v) + "条!", "添加成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
         load();
     }
     catch
     {
         MessageBox.Show("添加失败,请重试!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 4
0
 private void add_Click(object sender, EventArgs e)
 {
     try
     {
         sql_sel  s1 = new sql_sel();
         string[] r  = { "R名称", "R型号" };
         string[] v  = { shebei.Text, xh.Text };
         MessageBox.Show("成功为" + shebei.Text + "添加型号 " + xh.Text + " " + s1.insert_only("B设备型号", r, v) + "条!", "添加成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
         load();
     }
     catch
     {
         MessageBox.Show("添加失败,请重试!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 5
0
        private void tjwhjl_Click(object sender, EventArgs e)
        {
            sql_sel s2 = new sql_sel();

            if (ID1 != null)
            {
                user_x ux1 = new user_x(username, "添加", "维护记录");
                ux1.insert_log(mincheng.Text);
                MessageBox.Show("向" + ID1 + "号台账" + mincheng.Text + "添加了" + s2.insert_only("B维护记录", lie(), zhi()) + "条维护记录!", username + ",维护记录添加成功!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("没有选择需要添加维护记录的台账!", username + ",维护记录添加失败!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 6
0
        void insert()
        {
            if (name_add.Text == "")
            {
                MessageBox.Show("用户名不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                DialogResult dr;
                dr = MessageBox.Show(username + "您确定要添加用户: " + name_add.Text + " 的信息吗?", "警告!!!", MessageBoxButtons.YesNo);
                if (dr == DialogResult.Yes)
                {
                    sql_sel  s1 = new sql_sel();
                    string[] r  = new string[5];
                    r[0] = "R姓名";
                    r[1] = "R密码";
                    r[2] = "R分中心";
                    r[3] = "R职位";
                    r[4] = "R电话";

                    string[] v = new string[5];
                    v[0] = name_add.Text;
                    v[1] = pw_add.Text;
                    v[2] = fzx_add.Text;
                    v[3] = zhiwei_add.Text;
                    v[4] = phone_add.Text;

                    if (s1.insert_only("B用户", r, v) == 1)
                    {
                        MessageBox.Show("添加用户 " + name_add.Text + " 的成功!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        user_load();
                    }
                    else
                    {
                        MessageBox.Show("添加用户失败,请重试!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }
Exemplo n.º 7
0
        private void insert_zhiwei()
        {
            string[] r = new string[4];
            r[0] = "R职位";
            r[1] = "R删除权限";
            r[2] = "R修改权限";
            r[3] = "R等级";
            string[] v = new string[4];
            v[0] = add_zhiwei.Text;
            v[1] = del_num.Text;
            v[2] = up_num.Text;
            v[3] = lv.Text;

            if (add_zhiwei.Text == "")
            {
                MessageBox.Show("职位名不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                DialogResult dr;
                dr = MessageBox.Show(username + "您确定要添加职位: " + v[0] + " 吗?", "提示", MessageBoxButtons.YesNo);
                if (dr == DialogResult.Yes)
                {
                    sql_sel s1 = new sql_sel();
                    if (s1.insert_only("B职位", r, v) == 1)
                    {
                        MessageBox.Show("添加职位 " + v[0] + " 成功!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        zhiwei_load();
                    }
                    else
                    {
                        MessageBox.Show("添加职位失败,请重试!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }