Exemplo n.º 1
0
 private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         DataGridViewRow row = dgvData.Rows[e.RowIndex];
         if (e.ColumnIndex == dgvData.Columns["ATTACHED_NAME"].Index)
         {
             if (CConvert.ToInt32(row.Cells["ATTACHED_FLAG"].Value) > 0)
             {
                 string      attachedDirectory = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_ORDER);
                 string      slipNumber        = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value);
                 FrmAttached frm = new FrmAttached(slipNumber, attachedDirectory, true);
                 frm.ShowDialog(this);
                 frm.Dispose();
             }
         }
         else if (e.ColumnIndex == dgvData.Columns["UPDATED_COUNT"].Index)
         {
             if (CConvert.ToInt32(row.Cells["UPDATED_COUNT"].Value) > 0)
             {
                 FrmHistoryOrderList frm = new FrmHistoryOrderList(CConvert.ToString(row.Cells["SLIP_NUMBER"].Value));
                 if (DialogResult.OK == frm.ShowDialog(this))
                 {
                     FrmBase frmOrder = new FrmOrdersEntry(frm.historySlipNumber);
                     frmOrder.CTag      = CConstant.ORDER_HISTORY;
                     frmOrder.UserTable = _userInfo;
                     frmOrder.ShowDialog();
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        private void btnAttached_Click(object sender, EventArgs e)
        {
            FrmAttached frm = new FrmAttached(_attachedDirectoryName, _parentAttachedDirectory);

            frm.ShowDialog(this);
            frm.Dispose();
        }
Exemplo n.º 3
0
        private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                DataGridViewRow row = dgvData.Rows[e.RowIndex];
                if (e.ColumnIndex == dgvData.Columns["ATTACHED_NAME"].Index)
                {
                    //if (CConvert.ToInt32(row.Cells["ATTACHED_FLAG"].Value) > 0)
                    //{
                    //    string attachedDirectory = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_ORDER);
                    //    string slipNumber = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value);
                    //    FrmAttached frm = new FrmAttached(slipNumber, attachedDirectory, true);
                    //    frm.ShowDialog(this);
                    //    frm.Dispose();
                    //}

                    if (CConvert.ToString(row.Cells["SLIP_NUMBER"].Value) != "")
                    {
                        Czzd.Common.Library.FTPOperate myftp = new Czzd.Common.Library.FTPOperate("112.82.245.2", "YS_ERP\\order\\" + row.Cells["SLIP_NUMBER"].Value, "FTP_user", "czzd", 21);
                        string[] files = myftp.Dir("\\YS_ERP\\order\\" + row.Cells["SLIP_NUMBER"].Value);
                        // 附件
                        if (files.Length > 1)
                        {
                            string      attachedDirectory = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_ORDER);
                            string      slipNumber        = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value);
                            FrmAttached frm = new FrmAttached(slipNumber, attachedDirectory, true);
                            frm.CTag = CConstant.ORDER_MODIFY;
                            frm.ShowDialog(this);
                            frm.Dispose();
                        }
                    }
                }
                else if (e.ColumnIndex == dgvData.Columns["UPDATED_COUNT"].Index)
                {
                    if (CConvert.ToInt32(row.Cells["UPDATED_COUNT"].Value) > 0)
                    {
                        FrmHistoryOrderList frm = new FrmHistoryOrderList(CConvert.ToString(row.Cells["SLIP_NUMBER"].Value));
                        if (DialogResult.OK == frm.ShowDialog(this))
                        {
                            FrmBase frmOrder = new FrmOrdersEntry(frm.historySlipNumber);
                            frmOrder.CTag      = CConstant.ORDER_HISTORY;
                            frmOrder.UserTable = _userInfo;
                            frmOrder.ShowDialog();
                        }
                    }
                }
                else if (e.ColumnIndex == dgvData.Columns["CHECK"].Index)
                {
                    if (Convert.ToBoolean(dgvData.Rows[e.RowIndex].Cells["CHECK"].Value))
                    {
                        dgvData.Rows[e.RowIndex].Cells["CHECK"].Value = false;
                    }
                    else
                    {
                        dgvData.Rows[e.RowIndex].Cells["CHECK"].Value = true;
                    }
                }
            }
        }