Exemplo n.º 1
0
        private void btnInput_Click(object sender, EventArgs e)
        {
            string LoadFile = null;
            OpenFileDialog openexcle = new OpenFileDialog();
            openexcle.Filter = "excel files (*.xls)|*.xls";
            openexcle.ShowHelp = true;
            if(openexcle.ShowDialog()==DialogResult.OK)
            {
                LoadFile = openexcle.FileName.ToString();
                if (!string.IsNullOrEmpty(LoadFile))
                {
                    FrmUnusualStockImporCheck from = new FrmUnusualStockImporCheck(LoadFile);
                    from.Tag = "JC_C_YCKC_CHECK";
                    from.Text = "非正常库存导入EXCEL数据检测";
                    if (from.ShowDialog()==DialogResult.OK)
                    {
                        xpServerCollectionSource1.FixedFilterString = "[CZYID] =\'" + FrmLogin.getUserID + "\'";
                        this.unitOfWork1.DropIdentityMap();
                        xpServerCollectionSource1.Reload();
                        SetCZLXMC();
                        this.gridView1.BestFitColumns();
                    }
                  //  CheckInputData(LoadFile);
                }
                else
                {
                    MessageBox.Show("你还没有加载文件");
                }

            }
        }
Exemplo n.º 2
0
        private void btnBillInput_Click(object sender, EventArgs e)
        {
            if (selection1.SelectedCount != 1)
            {
                MessageBox.Show("必须选择一条进退单进行明细导入");
            }
            else
            {
                bool fgCheck = false;

                int RowIndex = selection1.GetSelectedRowIndex(0);
                int RowHandle = gridView1.GetRowHandle(RowIndex);

                string strZTID = gridView1.GetRowCellDisplayText(RowHandle, colZTID).ToString().Trim();
                string strZT = gridView1.GetRowCellDisplayText(RowHandle, colZT).ToString().Trim();
                string strJTDH = gridView1.GetRowCellDisplayText(RowHandle, colJTDH).ToString().Trim();
                string strJTDID = gridView1.GetRowCellDisplayText(RowHandle, colJTDID).ToString().Trim();
                string strczyid = gridView1.GetRowCellDisplayText(RowHandle, colCZYID).ToString().Trim();

                if (Convert.ToInt32(strZT) > 02)
                {
                    fgCheck = false;
                    MessageBox.Show("这个单子已经确认过了无法导入");
                }
                else if (strZTID != FrmLogin.getZTID.ToString())
                {
                    fgCheck = false;
                    MessageBox.Show("只有自己帐套下建立的单子才可以导入");

                }
                else if (string.IsNullOrEmpty(strJTDH))
                {
                    fgCheck = false;
                    MessageBox.Show("该进退单为空号");

                }
                else if (strczyid != FrmLogin.getUserID.ToString())
                {
                    fgCheck = false;
                    MessageBox.Show("只能导入自己建立的进退单");
                }
                else
                {
                    fgCheck = true;
                }

                if (fgCheck == true)
                {
                    string LoadFile = null;
                    OpenFileDialog openexcle = new OpenFileDialog();
                    openexcle.Filter = "excel files (*.xls)|*.xls";
                    openexcle.ShowHelp = true;
                    if (openexcle.ShowDialog() == DialogResult.OK)
                    {
                        LoadFile = openexcle.FileName.ToString();
                        if (!string.IsNullOrEmpty(LoadFile))
                        {
                            FrmUnusualStockImporCheck from = new FrmUnusualStockImporCheck(LoadFile, strJTDID);
                            from.Tag = "JC_G_JTD_CHECK";
                            from.Text = "非正常库存导入EXCEL数据检测";
                            if (from.ShowDialog() == DialogResult.OK)
                            {

                                selection1.ClearSelection();
                                //    xpServerCollectionSource1.FixedFilterString = "[CZYID] =\'" + FrmLogin.getUserID + "\'";
                                this.unitOfWork1.DropIdentityMap();
                                xpServerCollectionSource1.Reload();
                                //    SetCZLXMC();
                                this.gridView1.BestFitColumns();
                            }
                            //  CheckInputData(LoadFile);
                        }
                        else
                        {
                            MessageBox.Show("你还没有加载文件");
                        }

                    }

                }

            }
        }