Ejemplo n.º 1
0
        /// <summary>
        /// 修改变更申请
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem6_ItemClick(object sender, ItemClickEventArgs e)
        {
            var view = dgvCtny.MainView;

            view.PostEditor();
            DataView      dv     = (DataView)view.DataSource;
            List <string> listID = C2M.SelectedParamEntityIds(dv, "ID");

            if (listID.Count > 1)
            {
                MessageBox.Show("每次只能操作一条记录,您选择了" + listID.Count + "条!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (listID.Count == 0)
            {
                MessageBox.Show("请选择要操作的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (listID.Count == 1)
            {
                string            ID   = (string)listID[0];
                ChangeAddXtraForm caxf = new ChangeAddXtraForm(ID);
                caxf.Show();
            }
        }
Ejemplo n.º 2
0
        private void dgvCtny_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ColumnView  cv = (ColumnView)dgvCtny.FocusedView;
            DataRowView dr = (DataRowView)cv.GetFocusedRow();

            if (dr == null)
            {
                return;
            }
            string            ID   = (string)dr.Row.ItemArray[1];
            ChangeAddXtraForm caxf = new ChangeAddXtraForm(ID);

            caxf.Show();
        }
Ejemplo n.º 3
0
        private void barButtonItem7_ItemClick(object sender, ItemClickEventArgs e)
        {
            var checkList = GetCheckData();

            if (checkList.Count == 1)
            {
                string            ID   = checkList[0];
                ChangeAddXtraForm caxf = new ChangeAddXtraForm(ID);
                caxf.Show();
            }
            else
            {
                MessageBox.Show("每次只能操作一条记录,您选择了" + checkList.Count + "条!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }
Ejemplo n.º 4
0
 private void repositoryItemButtonEdit2ButtonClick(object sender, EventArgs e)
 {
     try
     {
         DevExpress.XtraGrid.Views.Grid.GridView view = ((DevExpress.XtraGrid.Views.Grid.GridView)(this.dgvCtny.MainView));
         int               rowhandle = view.FocusedRowHandle;
         DataRow           dr        = view.GetDataRow(rowhandle);
         string            ID        = dr["ID"].ToString();
         ChangeAddXtraForm caxf      = new ChangeAddXtraForm(ID);
         caxf.simpleButton4_Click(sender, e);
         caxf.Dispose();
     }
     catch (Exception ex)
     {
         MessageBox.Show("发送失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 5
0
        private void simpleButton4_Click(object sender, EventArgs e)
        {
            DataView dv = GetCheckData();

            if (dv != null && dv.Table.Rows.Count > 0)
            {
                ChangeAddXtraForm caxf = (ChangeAddXtraForm)this.Owner;
                caxf.LoadDataByVin(dv);
                if (MessageBox.Show("添加成功,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("请选择要操作的数据", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 导入变更申请单模板
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem8_ItemClick(object sender, ItemClickEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Excel|*.xls;*.xlsx|All Files|*.*";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    MitsUtils miutils = new MitsUtils();
                    DataSet   ds      = miutils.ReadExcel(ofd.FileName, "Sheet1");

                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        var dt = ds.Tables[0];
                        dt.Columns["备案号(VIN)"].ColumnName  = "VIN";
                        dt.Columns["产品型号"].ColumnName      = "CLXH";
                        dt.Columns["通用名称"].ColumnName      = "TYMC";
                        dt.Columns["燃料种类"].ColumnName      = "RLLX";
                        dt.Columns["燃料消耗量(综合)"].ColumnName = "CT_ZHGKRLXHL";
                        dt.Columns["整备质量"].ColumnName      = "ZCZBZL";
                        dt.Columns["变速器型式"].ColumnName     = "CT_BSQXS";
                        dt.Columns["座椅排数"].ColumnName      = "ZWPS";
                        dt.Columns["操作类型"].ColumnName      = "APPLYTYPE";
                        dt.Columns.Add("UPDATEFIELD");
                        dt.Columns.Add("FIELDOLD");
                        dt.Columns.Add("FIELDNEW");
                        ChangeAddXtraForm caxf = new ChangeAddXtraForm();
                        caxf.import = true;
                        caxf.LoadDataByVin(dt.AsDataView());
                        caxf.Show();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("导入失败:" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Ejemplo n.º 7
0
        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            ChangeAddXtraForm caxf = new ChangeAddXtraForm();

            caxf.ShowDialog();
        }