Exemplo n.º 1
0
        public bool del(string ID1)
        {
            bool a = false;

            if (ID1 != null & ID1 != "")
            {
                user_x ux1 = new user_x(username, "删除", "台账");
                if (ux1.sy() > 0)
                {
                    sql_sel      sqq1 = new sql_sel();
                    DialogResult dr;
                    dr = MessageBox.Show(username + "您好!您确定要删除台账: " + sqq1.select_only("B台账", "R名称", "R序号", ID1) + " 吗?删除后不可恢复!!!", "警告!!!", MessageBoxButtons.YesNo);
                    if (dr == DialogResult.Yes)
                    {
                        ux1.insert_log(ux1.TZ_name(ID1));
                        MessageBox.Show("删除了编号为:" + ID1 + "的" + sqq1.delete_only("B台账", "R序号", ID1) + "个台账,台账的" + sqq1.delete_only("B示意图", "R所属台账编号", ID1) + "张示意图和" + sqq1.delete_only("B图片", "R所属台账序号", ID1) + "张图片也被同时删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        sqq1.delete_only("B维护记录", "R所属台账编号", ID1);
                        a = true;
                    }
                }
                else
                {
                    ux1.cw_message();
                }
            }
            else
            {
                MessageBox.Show("未选择台账!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                a = false;
            }
            return(a);
        }
Exemplo n.º 2
0
 private void del_whjl_Click(object sender, EventArgs e)
 {
     if (wh_id != null)
     {
         user_x ux1 = new user_x(username, "删除", "维护记录");
         if (ux1.sy() > 0)
         {
             DialogResult dr;
             dr = MessageBox.Show(username + "您好!您确定要删除台账 " + mincheng.Text + " 的维护记录" + whxm.Text + "吗?删除后不可恢复!!!", "警告!!!", MessageBoxButtons.YesNo);
             if (dr == DialogResult.Yes)
             {
                 sql_sel sqq1 = new sql_sel();
                 ux1.insert_log(mincheng.Text);
                 MessageBox.Show("删除了台账 " + mincheng.Text + " 的" + sqq1.delete_only("B维护记录", "R序号", wh_id) + "条维护记录" + whxm.Text + " !", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 b1 = true;
                 Close();
             }
         }
         else
         {
             ux1.cw_message();
         }
     }
     else
     {
         MessageBox.Show("未选择台账!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 3
0
        private void zhiwei_del(string select_zhiwei)
        {
            DialogResult dr;

            dr = MessageBox.Show(username + "您好!您确定要删除职位: " + select_zhiwei + " 吗?", "警告!!!", MessageBoxButtons.YesNo);
            if (dr == DialogResult.Yes)
            {
                if (select_zhiwei != null & select_zhiwei != "")
                {
                    sql_sel s1 = new sql_sel();
                    if (s1.delete_only("B职位", "R职位", select_zhiwei) == 1)
                    {
                        MessageBox.Show("删除" + select_zhiwei + "成功!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        zhiwei_load();
                    }
                    else
                    {
                        MessageBox.Show("删除" + select_zhiwei + "失败,请重试!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    MessageBox.Show("未选择要删除的职位!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 4
0
 void del(string select_name)
 {
     if (select_name == username)
     {
         MessageBox.Show("你不能删除自己!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         DialogResult dr;
         dr = MessageBox.Show(username + "您好!您确定要删除用户: " + select_name + " 吗?删除后不可恢复!!!", "警告!!!", MessageBoxButtons.YesNo);
         if (dr == DialogResult.Yes)
         {
             if (select_name != null & select_name != "")
             {
                 sql_sel s1 = new sql_sel();
                 if (s1.delete_only("B用户", "R姓名", select_name) == 1)
                 {
                     MessageBox.Show("删除" + select_name + "成功!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     user_load();
                 }
                 else
                 {
                     MessageBox.Show("删除" + select_name + "失败,请重试!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
             else
             {
                 MessageBox.Show("未选择要删除的用户!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
 }
Exemplo n.º 5
0
        private void save_Click(object sender, EventArgs e)
        {
            user_x ux1 = new user_x(username, "修改", "台账");

            if (ux1.sy() > 0)
            {
                DialogResult dr;
                dr = MessageBox.Show("你确定要修改台账吗?修改后不可恢复!!!", "警告!!!", MessageBoxButtons.YesNo);
                if (dr == DialogResult.Yes)
                {
                    sql_sel sq1 = new sql_sel();
                    ux1.insert_log(mincheng.Text);
                    sq1.delete_only("B图片", "R所属台账序号", ID1);
                    sq1.delete_only("B示意图", "R所属台账编号", ID1);
                    MessageBox.Show("修改了" + sq1.update_only("B台账", dbo(), values(), "R序号", ID1) + "条数据!台账里有" + img_add() + "张图片," + shiyitu_add() + "示意图!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            else
            {
                ux1.cw_message();
            }
        }
Exemplo n.º 6
0
 private void del_cg_Click(object sender, EventArgs e)
 {
     try
     {
         sql_sel s1 = new sql_sel();
         MessageBox.Show("成功删除型号 " + cg_list.SelectedItem.ToString() + " " + s1.delete_only("B设备型号", "R型号", cg_list.SelectedItem.ToString()) + "个磁钢型号!", "添加成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
         load();
     }
     catch
     {
         MessageBox.Show("没有选择要删除的型号!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 7
0
 private void zt_del_Click(object sender, EventArgs e)
 {
     try
     {
         sql_sel s1 = new sql_sel();
         MessageBox.Show("成功删除型号 " + zt_list.SelectedItem.ToString() + " " + s1.delete_only("B安装状态", "R安装状态", zt_list.SelectedItem.ToString()) + "个安装状态型号!", "删除成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
         load();
     }
     catch
     {
         MessageBox.Show("没有选择要删除的项目!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }