Пример #1
0
        async private void 添加NToolStripButton_Click(object sender, EventArgs e)
        {
            switch (lastTable)
            {
            case "申购计划":
                break;

            case "局申购汇总":
                break;

            case "报废记录":
                break;

            case "局报废汇总":
                break;

            case "工作类别":
                var f = new FormWorkType();
                f.ShowDialog();
                await WorkTypeList();

                break;

            case "缺陷类别":
                var t = new FormUpdateInsertDefect();
                t.ShowDialog();
                await ReadDefectsList(page);

                listViewLeft_DoubleClick(null, null);
                break;

            case "员工权限":
                var a = new FormInsertUpdateUser();
                a.ShowDialog();
                await ReadUserList(page);

                listViewLeft_DoubleClick(null, null);
                break;
            }
        }
Пример #2
0
        async private void 修改OToolStripButton_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 1)
            {
                switch (lastTable)
                {
                case "申购计划":
                    dataGridView1.DataSource = null;
                    break;

                case "局申购汇总":
                    dataGridView1.DataSource = null;

                    break;

                case "报废记录":
                    dataGridView1.DataSource = null;

                    break;

                case "局报废汇总":
                    dataGridView1.DataSource = null;

                    break;

                case "工作类别":
                    await Server.GetWorkTypeList();

                    var f = new FormWorkType();
                    f.IsUpdate = true;
                    f.WorkType = Global.WorkTypeList.Find(t => t.work_id == dataGridView1.SelectedRows[0].Cells[0].Value as string);
                    f.ShowDialog();
                    await WorkTypeList();

                    break;

                case "缺陷类别":
                    var d = new FormUpdateInsertDefect();
                    d.IsUpdate = true;
                    if (page != 0)
                    {
                        d.Defect = Global.DefectList.Find(t => t.defect_id == dataGridView1.SelectedRows[0].Cells[0].Value as string);
                        d.ShowDialog();
                    }

                    //                       await ReadDefectsList(page);
                    listViewLeft_DoubleClick(null, null);
                    break;

                case "员工权限":
                    await Server.GetUserList(Global.LoginInfo.user_id, Global.LoginInfo.user_code, page, 100);

                    var c = new FormInsertUpdateUser();
                    c.UpdateUser      = true;
                    c.updateUserItems = Global.UserList.list.Find(t => t.user_id == dataGridView1.SelectedRows[0].Cells[8].Value as string);
                    c.ShowDialog();
                    listViewLeft_DoubleClick(null, null);
                    break;
                }
            }
            else
            {
                MessageBox.Show("请先选择要修改的数据");
            }
        }