private void btnCancel_Click(object sender, EventArgs e)
        {
            frmProjectManagement fm = frmProjectManagement.GetInstance();

            frmProEdit = null;
            this.Close();
        }
 public static frmProjectEdit GetInstance(EditProjectRequest model)
 {
     if (frmProEdit == null)
     {
         frmProEdit = new frmProjectEdit(model);
     }
     return(frmProEdit);
 }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView1.Columns[e.ColumnIndex].Name == "Operate")
     {
         //可以在此打开新窗口,把参数传递过去
         model.HouseEstateID   = Convert.ToInt32(this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
         model.HouseEstateName = this.dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
         frmProjectEdit fm = new frmProjectEdit();
         fm.ShowDialog();
     }
 }
        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();
            }
        }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView1.Columns[e.ColumnIndex].Name == "Operate")
     {
         //可以在此打开新窗口,把参数传递过去
         model.ID             = Convert.ToInt32(this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
         model.Number         = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
         model.Name           = this.dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
         model.DevelopCompany = this.dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
         model.IdentityNumber = this.dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString();
         model.ProjectArea    = this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString();
         frmProjectEdit fm = new frmProjectEdit();
         fm.ShowDialog();
     }
 }
示例#6
0
 private void dgvDataSource_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvDataSource.Columns[e.ColumnIndex].Name == "Operate")
     {
         //可以在此打开新窗口,把参数传递过去
         model.ID             = Convert.ToInt32(this.dgvDataSource.Rows[e.RowIndex].Cells["ID"].Value.ToString());
         model.Number         = this.dgvDataSource.Rows[e.RowIndex].Cells["Number"].Value.ToString();
         model.Name           = this.dgvDataSource.Rows[e.RowIndex].Cells["Name"].Value.ToString();
         model.DevelopCompany = this.dgvDataSource.Rows[e.RowIndex].Cells["DevelopCompany"].Value == null?"":this.dgvDataSource.Rows[e.RowIndex].Cells["DevelopCompany"].Value.ToString();
         model.IdentityNumber = this.dgvDataSource.Rows[e.RowIndex].Cells["IdentityNumber"].Value == null?"": this.dgvDataSource.Rows[e.RowIndex].Cells["IdentityNumber"].Value.ToString();
         model.ProjectArea    = this.dgvDataSource.Rows[e.RowIndex].Cells["ProjectArea"].Value.ToString();
         frmProjectEdit fm = frmProjectEdit.GetInstance(model);
         fm.Exec(model);
         fm.ShowDialog();
     }
 }
 private void frmProjectEdit_FormClosed(object sender, FormClosedEventArgs e)
 {
     frmProEdit = null;
     this.Close();
     //this.Dispose();
 }