Beispiel #1
0
        // 更新主表关联数据
        private void btnUpdateRelData_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            // 获取主表编号
            string mainIds = string.Empty;

            FuelDataSysClient.Tool.Tool_Mits.MitsUtils mitsUtil = new FuelDataSysClient.Tool.Tool_Mits.MitsUtils();
            try
            {
                List <string> ctnyList = mitsUtil.GetMainIdFromControl(this.gvCljbxx, (DataTable)this.gcCljbxx.DataSource);

                foreach (string ctnyId in ctnyList)
                {
                    mainIds += string.Format(",'{0}'", ctnyId);
                }
                if (!string.IsNullOrEmpty(mainIds))
                {
                    mainIds = mainIds.Substring(1);
                }
                if (string.IsNullOrEmpty(mainIds))
                {
                    MessageBox.Show("请选择数据");
                    return;
                }
                ReviewUpdateVinForm reviewVinForm = new ReviewUpdateVinForm(mainIds);
                reviewVinForm.ShowDialog();
            }
            catch (Exception)
            {
            }
        }
Beispiel #2
0
        // 更新主表关联数据
        private void btnUpdateRelData_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            // 获取主表编号
            string mainIds = string.Empty;

            FuelDataSysClient.Tool.Tool_Mits.MitsUtils mitsUtil = new FuelDataSysClient.Tool.Tool_Mits.MitsUtils();
            try
            {
                List <string> ctnyList = mitsUtil.GetMainIdFromControl(this.gvCtny, (DataTable)this.dgvCtny.DataSource);
                //List<string> fcdsList = mitsUtil.GetMainIdFromControl(this.gvFcds, (DataTable)this.dgvFcds.DataSource);


                //if (ctnyList.Count + fcdsList.Count < 1)
                //{
                //    MessageBox.Show("请选择主表信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}

                foreach (string ctnyId in ctnyList)
                {
                    mainIds += string.Format(",'{0}'", ctnyId);
                }
                //foreach (string fcdsId in fcdsList)
                //{
                //    mainIds += string.Format(",'{0}'", fcdsId);
                //}

                if (!string.IsNullOrEmpty(mainIds))
                {
                    mainIds = mainIds.Substring(1);
                }
                if (string.IsNullOrEmpty(mainIds))
                {
                    MessageBox.Show("请选择数据");
                    return;
                }
                ReviewUpdateVinForm reviewVinForm = new ReviewUpdateVinForm(mainIds);
                reviewVinForm.ShowDialog();
            }
            catch (Exception)
            {
            }
        }