Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            frmProjectManagement fm = new frmProjectManagement();

            fm.Show();
            this.Hide();
        }
Exemplo n.º 2
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            frmProjectManagement fm = frmProjectManagement.GetInstance();

            frmProEdit = null;
            this.Close();
        }
Exemplo n.º 3
0
 public static frmProjectManagement GetInstance()
 {
     if (frmProMgt == null)
     {
         frmProMgt = new frmProjectManagement();
     }
     return(frmProMgt);
 }
Exemplo n.º 4
0
        private void picMenuSub2_Click(object sender, EventArgs e)
        {
            frmProjectManagement childForm = frmProjectManagement.GetInstance();

            childForm.MdiParent = this;
            childForm.Parent    = splitContainer.Panel2;

            childForm.WindowState = FormWindowState.Normal;
            childForm.Dock        = DockStyle.Fill;
            childForm.Size        = new Size(splitContainer.Width - splitContainer.SplitterDistance, splitContainer.Height);
            childForm.BringToFront();
            childForm.Show();
        }
Exemplo n.º 5
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string           msg    = string.Empty;
            BaseResultEntity result = IsValidProjectInfo();

            if (result.Code != 0)
            {
                msg = "输入信息有误, 错误信息: " + result.ErrMsg;
                DisPlayPrompt(0, msg);
                return;
            }

            EditProjectRequest para = new EditProjectRequest()
            {
                ID             = projectId,
                Number         = lblContent.Text,
                Name           = txtName.Text,
                DevelopCompany = txtCompany.Text,
                IdentityNumber = txtIdentityNumber.Text,
                ProjectArea    = cbArea.Text
            };

            TokenResultEntity getToken = provide.GetToken();

            if (getToken.Code != 0)
            {
                msg = "获取Token失败, 错误信息: " + getToken.ErrMsg;
                DisPlayPrompt(0, msg);
                return;
            }

            BaseResultEntity getProject = provide.EditProject(para);

            if (getProject.Code != 0)
            {
                msg = "修改项目失败, 错误信息: " + getProject.ErrMsg;
                DisPlayPrompt(0, msg);
                return;
            }
            else
            {
                int curPageIndex = 1;
                msg = "修改项目成功!";
                DisPlayPrompt(0, msg);
                frmProjectManagement fm = frmProjectManagement.GetInstance();
                fm.GetProjectInfo(false, curPageIndex);
                frmProEdit = null;
                this.Close();
            }
        }
Exemplo n.º 6
0
        private void InitForm()
        {
            BaseHelper baseHelper = new BaseHelper();

            comboBox1.DataSource    = baseHelper.GetAreaList(); //绑定数据源
            comboBox1.DisplayMember = "Name";                   //主要是设置下拉框显示的值
            comboBox1.ValueMember   = "ID";                     //实际值

            frmProjectManagement fm = new frmProjectManagement();

            projectId      = fm.model.ID;
            label1.Text    = fm.model.Number;
            textBox1.Text  = fm.model.Name;
            textBox2.Text  = fm.model.DevelopCompany;
            textBox3.Text  = fm.model.IdentityNumber;
            comboBox1.Text = fm.model.ProjectArea;
        }
Exemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            BaseResultEntity result = IsValidProjectInfo();

            if (result.Code != 0)
            {
                MessageBox.Show("输入信息有误, 错误信息: " + result.ErrMsg);
            }

            EditProjectRequest para = new EditProjectRequest()
            {
                ID             = projectId,
                Number         = label1.Text,
                Name           = textBox1.Text,
                DevelopCompany = textBox2.Text,
                IdentityNumber = textBox3.Text,
                ProjectArea    = comboBox1.Text
            };

            TokenResultEntity getToken = provide.GetToken();

            if (getToken.Code != 0)
            {
                MessageBox.Show("获取Token失败, 错误信息: " + getToken.ErrMsg);
                return;
            }

            BaseResultEntity getProject = provide.EditProject(para);

            if (getProject.Code != 0)
            {
                MessageBox.Show("修改项目失败, 错误信息: " + getProject.ErrMsg);
                return;
            }
            else
            {
                MessageBox.Show("修改项目成功!");
                frmProjectManagement fm = new frmProjectManagement();
                fm.GetProjectInfo(false);
                this.Close();
            }
        }
Exemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            int i = 0;

            List <ProjectGroupAndRoomTypeRoleTemp> list1 = new List <ProjectGroupAndRoomTypeRoleTemp>();

            foreach (KeyValuePair <int, string> gpkv in ProjectGroupa1st)
            {
                i++;
                foreach (KeyValuePair <int, string> rtkv in RoomType1st)
                {
                    string value = rtkv.Value;
                    if (Convert.ToInt32(value.Substring(10, 1)) == i)
                    {
                        if (((CheckBox)panel1.Controls.Find("value", true)[0]).Checked == true)
                        {
                            ProjectGroupAndRoomTypeRoleTemp item = new ProjectGroupAndRoomTypeRoleTemp();
                            item.ProjectGroupID = gpkv.Key;
                            item.RoomTypeID     = rtkv.Key;
                            list1.Add(item);
                        }
                    }
                }
            }

            i = 0;
            List <FamilyNumberAndRoomTypeRoleTemp> list2 = new List <FamilyNumberAndRoomTypeRoleTemp>();

            foreach (KeyValuePair <int, string> gpkv in FamilyNumber2nd)
            {
                i++;
                foreach (KeyValuePair <int, string> rtkv in RoomType2nd)
                {
                    string value = rtkv.Value;
                    if (Convert.ToInt32(value.Substring(10, 1)) == i)
                    {
                        if (((CheckBox)panel2.Controls.Find("value", true)[0]).Checked == true)
                        {
                            FamilyNumberAndRoomTypeRoleTemp item = new FamilyNumberAndRoomTypeRoleTemp();
                            item.FamilyNumber = gpkv.Key;
                            item.RoomTypeID   = rtkv.Key;
                            list2.Add(item);
                        }
                    }
                }
            }

            i = 0;
            List <ProjectGroupAndHouseGroupRoleTemp> list3 = new List <ProjectGroupAndHouseGroupRoleTemp>();

            foreach (KeyValuePair <int, string> gpkv in ProjectGroupa3rd)
            {
                i++;
                foreach (KeyValuePair <int, string> rtkv in HouseGroup3rd)
                {
                    string value = rtkv.Value;
                    if (Convert.ToInt32(value.Substring(10, 1)) == i)
                    {
                        if (((CheckBox)panel3.Controls.Find("value", true)[0]).Checked == true)
                        {
                            ProjectGroupAndHouseGroupRoleTemp item = new ProjectGroupAndHouseGroupRoleTemp();
                            item.ProjectGroupID = gpkv.Key;
                            item.HouseGroupID   = rtkv.Key;
                            list3.Add(item);
                        }
                    }
                }
            }


            TokenResultEntity getToken = provide.GetToken();

            if (getToken.Code != 0)
            {
                MessageBox.Show("获取Token失败, 错误信息: " + getToken.ErrMsg);
                return;
            }

            BaseResultEntity getProject = provide.EditSelectRole(projectId, list1, list2, list3);

            if (getProject.Code != 0)
            {
                MessageBox.Show("添加项目失败, 错误信息: " + getProject.ErrMsg);
                return;
            }
            else
            {
                MessageBox.Show("添加项目成功!");
                frmProjectManagement fm = new frmProjectManagement();
                fm.GetProjectInfo();
                this.Close();
            }
        }