Beispiel #1
0
        // 添加
        void UC_AddEvent(object sender, EventArgs e)
        {
            UCCompanyAddOrEdit uc = new UCCompanyAddOrEdit(WindowStatus.Add, null, this.Name);

            uc.RefreshDataStart -= new UCCompanyAddOrEdit.RefreshData(this.BindPageData);
            uc.RefreshDataStart += new UCCompanyAddOrEdit.RefreshData(this.BindPageData);
            base.addUserControl(uc, "公司档案-新增", "CompanyAdd", this.Tag.ToString(), this.Name);
        }
Beispiel #2
0
        //复制操作
        void UC_CopyEvent(object sender, EventArgs e)
        {
            if (dgvRecord.CurrentRow == null)
            {
                MessageBoxEx.Show("请选择复制记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataRow            dr          = (this.dgvRecord.CurrentRow.DataBoundItem as DataRowView).Row;
            string             id          = dr["com_id"].ToString();
            UCCompanyAddOrEdit CompanyEdit = new UCCompanyAddOrEdit(WindowStatus.Copy, dr, this.Name);

            base.addUserControl(CompanyEdit, "公司档案-复制", "CompanyCopy" + id, this.Tag.ToString(), this.Name);
        }
Beispiel #3
0
        //编辑
        void UC_EditEvent(object sender, EventArgs e)
        {
            if (dgvRecord.CurrentRow == null)
            {
                MessageBoxEx.Show("请选择编辑记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataRow            dr = (this.dgvRecord.CurrentRow.DataBoundItem as DataRowView).Row;
            string             id = dr["com_id"].ToString();
            UCCompanyAddOrEdit uc = new UCCompanyAddOrEdit(WindowStatus.Edit, dr, this.Name);

            uc.RefreshDataStart -= new UCCompanyAddOrEdit.RefreshData(this.BindPageData);
            uc.RefreshDataStart += new UCCompanyAddOrEdit.RefreshData(this.BindPageData);
            base.addUserControl(uc, "公司档案-编辑", "CompanyEdit" + id, this.Tag.ToString(), this.Name);
        }
Beispiel #4
0
        //编辑
        void UCCompanyView_EditEvent(object sender, EventArgs e)
        {
            DataSet ds = SelectCom();

            if (ds == null || ds.Tables[0].Rows.Count <= 0)
            {
                MessageBoxEx.Show("查询公司失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            DataTable          dt      = ds.Tables[0];
            UCCompanyAddOrEdit editFrm = new UCCompanyAddOrEdit(WindowStatus.Edit, dt.Rows[0], uc.Name, uc);

            deleteMenuByTag(this.Tag.ToString(), uc.Name);
            base.addUserControl(editFrm, "公司档案-编辑", "UCCompanyEdit" + id, this.Tag.ToString(), this.Name);
        }
 // 添加      
 void UC_AddEvent(object sender, EventArgs e)
 {
     UCCompanyAddOrEdit uc = new UCCompanyAddOrEdit(WindowStatus.Add, null, this.Name);
     uc.RefreshDataStart -= new UCCompanyAddOrEdit.RefreshData(this.BindPageData);
     uc.RefreshDataStart += new UCCompanyAddOrEdit.RefreshData(this.BindPageData);
     base.addUserControl(uc, "公司档案-新增", "CompanyAdd", this.Tag.ToString(), this.Name);
 }
 //编辑
 void UC_EditEvent(object sender, EventArgs e)
 {
     if (dgvRecord.CurrentRow == null)
     {
         MessageBoxEx.Show("请选择编辑记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     DataRow dr = (this.dgvRecord.CurrentRow.DataBoundItem as DataRowView).Row;
     string id = dr["com_id"].ToString();
     UCCompanyAddOrEdit uc = new UCCompanyAddOrEdit(WindowStatus.Edit, dr, this.Name);
     uc.RefreshDataStart -= new UCCompanyAddOrEdit.RefreshData(this.BindPageData);
     uc.RefreshDataStart += new UCCompanyAddOrEdit.RefreshData(this.BindPageData);
     base.addUserControl(uc, "公司档案-编辑", "CompanyEdit" + id, this.Tag.ToString(), this.Name);
 }
 //复制操作
 void UC_CopyEvent(object sender, EventArgs e)
 {
     if (dgvRecord.CurrentRow == null)
     {
         MessageBoxEx.Show("请选择复制记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     DataRow dr = (this.dgvRecord.CurrentRow.DataBoundItem as DataRowView).Row;
     string id = dr["com_id"].ToString();
     UCCompanyAddOrEdit CompanyEdit = new UCCompanyAddOrEdit(WindowStatus.Copy, dr, this.Name);
     base.addUserControl(CompanyEdit, "公司档案-复制", "CompanyCopy" + id, this.Tag.ToString(), this.Name);
 }
        //编辑
        void UCCompanyView_EditEvent(object sender, EventArgs e)
        {
            DataSet ds = SelectCom();

            if (ds == null || ds.Tables[0].Rows.Count <= 0)
            {
                MessageBoxEx.Show("查询公司失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            DataTable dt = ds.Tables[0];
            UCCompanyAddOrEdit editFrm = new UCCompanyAddOrEdit(WindowStatus.Edit, dt.Rows[0], uc.Name, uc);
            deleteMenuByTag(this.Tag.ToString(), uc.Name);
            base.addUserControl(editFrm, "公司档案-编辑", "UCCompanyEdit" + id, this.Tag.ToString(), this.Name);
        }