コード例 #1
0
ファイル: CIndBand.cs プロジェクト: superMiracle/testfat
        public void setCacheData(CCacheData cacheData)
        {
            m_cacheData_A = cacheData;

            m_indMA.setCacheData(cacheData);
            m_indSTD.setCacheData(cacheData);
        }
コード例 #2
0
ファイル: DrawingUpLoad.cs プロジェクト: seezeef/YS_ERP
        private void DrawingUpLoad_Load(object sender, EventArgs e)
        {
            this.dgvData.AutoGenerateColumns   = false;
            this.dgvData.AllowUserToAddRows    = false;
            this.dgvData.AllowUserToDeleteRows = false;

            string  _tmpAttachedDirectoryName = SLIPNUMBER;
            string  _attachedDirectory        = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_PRODUCTION);
            DataSet ds = bProductionDrawing.GetProductionDrawing(" PSDL_SLIP_NUMBER = '" + SLIPNUMBER + "'" + " AND PSDL_STATUS_FLAG= '0'");

            clbDrawing.DataSource    = ds.Tables[0];
            clbDrawing.ValueMember   = "PSDL_DRAWING_CODE";
            clbDrawing.DisplayMember = "NAME";
            DataSet dsUpload = bProductionDrawing.GetProductionDrawingUpload(" SLIP_NUMBER = '" + SLIPNUMBER + "'" + " AND DRAWING_CODE= '" + DRAWING_CODE + "'");

            dgvData.DataSource = dsUpload.Tables[0];
            _currentDt.Columns.Add("NAME", Type.GetType("System.String"));
            try
            {
                if (Directory.Exists(_attachedDirectory + _tmpAttachedDirectoryName + "\\"))
                {
                    DirectoryInfo di    = new DirectoryInfo(_attachedDirectory + _tmpAttachedDirectoryName + "\\");
                    FileInfo[]    files = di.GetFiles();

                    foreach (FileInfo file in files)
                    {
                        AddAttached(file);
                    }
                }
            }
            catch (IOException ex)
            {
            }
        }
コード例 #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["DOWN_LOAD"].Index)
         {
             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);
                     FrmProductionDownLoadCustomer frm = new FrmProductionDownLoadCustomer(slipNumber, attachedDirectory);
                     frm.CTag = CConstant.ORDER_MODIFY;
                     frm.ShowDialog(this);
                     frm.Dispose();
                 }
             }
         }
     }
 }
コード例 #4
0
ファイル: FrmOrdersSearch.cs プロジェクト: zhr008/ERP-1
 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();
                 }
             }
         }
     }
 }
コード例 #5
0
ファイル: FrmOrdersSearch.cs プロジェクト: seezeef/YS_ERP
        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;
                    }
                }
            }
        }
コード例 #6
0
        private void newMinFrmPictureBox(Panel panel, int x, int y, string name, string text, Image image, Image image_enabled, string tag)
        {
            bool roles = CheckRoles(CCacheData.GetRolesFunction(UserTable.ROLES_CODE), "", name, text, tag);

            x = Int32.Parse(Math.Ceiling(x * newx).ToString());
            y = Int32.Parse(Math.Ceiling(y * newy).ToString());
            PictureBox pic = new System.Windows.Forms.PictureBox();

            pic.Location = new System.Drawing.Point(x, y);
            pic.Name     = "Frm" + name;
            pic.Size     = new System.Drawing.Size(80, 80);
            pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            pic.TabIndex = 1;
            pic.Tag      = tag;
            pic.TabStop  = false;
            pic.Cursor   = Cursors.Hand;
            if (roles)
            {
                if (!"Invoice".Equals(name))
                {
                    pic.Image            = image;
                    pic.Click           += new System.EventHandler(this.Pic_Click);
                    pic.ContextMenuStrip = menuAdd;
                    pic.MouseLeave      += new System.EventHandler(this.Pic_MouseLeave);
                    pic.MouseMove       += new System.Windows.Forms.MouseEventHandler(this.Pic_MouseMove);
                    pic.MouseDown       += new System.Windows.Forms.MouseEventHandler(this.Pic_MouseDown);
                }
                else
                {
                    pic.Image            = image;
                    pic.Click           += new System.EventHandler(this.Invoice_click);
                    pic.ContextMenuStrip = menuAdd;
                    pic.MouseLeave      += new System.EventHandler(this.Pic_MouseLeave);
                    pic.MouseMove       += new System.Windows.Forms.MouseEventHandler(this.Pic_MouseMove);
                    pic.MouseDown       += new System.Windows.Forms.MouseEventHandler(this.Pic_MouseDown);
                }
            }
            else
            {
                pic.Image = image_enabled;
            }

            panel.Controls.Add(pic);

            Label lbl = new System.Windows.Forms.Label();

            lbl.ForeColor = Color.Black;
            lbl.Location  = new System.Drawing.Point(x - 15, y + 84);
            lbl.Name      = "LBL" + name + CConvert.ToString(tag, 2);
            lbl.Size      = new System.Drawing.Size(130, 20);
            lbl.TabIndex  = 0;
            lbl.Text      = text;
            lbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            panel.Controls.Add(lbl);
        }
コード例 #7
0
ファイル: DrawingUpLoad.cs プロジェクト: seezeef/YS_ERP
        private void dgvData_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int result = 0;

            try
            {
                if (e.ColumnIndex == dgvData.Columns["BTN_DELETE"].Index)
                {
                    if (MessageBox.Show("确定要删除当前行吗?", this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
                    {
                        string SLIPNUMBER         = dgvData.Rows[e.RowIndex].Cells["SLIP_NUMBER"].Value.ToString();
                        string DRAWINGCODE        = dgvData.Rows[e.RowIndex].Cells["DRAWINGCODE"].Value.ToString();
                        string SERVERFILENAME     = dgvData.Rows[e.RowIndex].Cells["FILENAME"].Value.ToString();
                        string LOCATION_FILE_NAME = dgvData.Rows[e.RowIndex].Cells["LOCATION_FILE_NAME"].Value.ToString();

                        result = bProductionDrawing.Delete(SLIPNUMBER, DRAWINGCODE, SERVERFILENAME);
                        if (result < 1)
                        {
                            MessageBox.Show("删除失败!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        else
                        {
                            txtFileName.Text = "";
                            DataTable dt = new DataTable();
                            clbDrawing.DataSource = dt;
                            dgvData.DataSource    = dt;
                            DataSet ds1 = bProductionDrawing.GetProductionDrawing(" PSDL_SLIP_NUMBER = '" + SLIPNUMBER + "'" + " AND PSDL_STATUS_FLAG= '0'");
                            clbDrawing.DataSource    = ds1.Tables[0];
                            clbDrawing.ValueMember   = "PSDL_DRAWING_CODE";
                            clbDrawing.DisplayMember = "NAME";
                            DataSet dsUpload = bProductionDrawing.GetProductionDrawingUpload(" SLIP_NUMBER = '" + SLIPNUMBER + "'" + " AND DRAWING_CODE= '" + DRAWING_CODE + "'");
                            dgvData.DataSource = dsUpload.Tables[0];
                            //MessageBox.Show("删除成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

                            DataSet ds = bProductionDrawing.GetProductionDrawingUpload(" SLIP_NUMBER = '" + SLIPNUMBER + "'" + " AND SERVER_FILE_NAME = '" + SERVERFILENAME + "'");
                            if (ds.Tables[0].Rows.Count < 1)
                            {
                                string _tmpAttachedDirectoryName = SLIPNUMBER;
                                string _attachedDirectory        = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_PRODUCTION);
                                // File.Delete(_attachedDirectory + _tmpAttachedDirectoryName + "\\" + openFileDialog.SafeFileName + SERVERFILENAME);
                                Czzd.Common.Library.FTPOperate myftp = new Czzd.Common.Library.FTPOperate("112.82.245.2", "YS_ERP\\production\\" + _tmpAttachedDirectoryName, "FTP_user", "czzd", 21);
                                myftp.Delete(LOCATION_FILE_NAME);
                                MessageBox.Show("您选择的文件删除成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #8
0
ファイル: FrmBaseReceive.cs プロジェクト: seezeef/YS_ERP
 /// <summary>
 /// 数据库表字段发生变化时
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cboBaseTable_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(CConvert.ToString(cboBaseTable.SelectedValue)))
     {
         //_currentTableStruct = bCommon.GetTableStruct(CConvert.ToString(cboBaseTable.SelectedValue)).Tables[0];
         _currentTableStruct = CCacheData.GetTableColumn(CConvert.ToString(cboBaseTable.SelectedValue));
     }
     else
     {
         _currentTableStruct = new DataTable();
     }
     DataBind();
 }
コード例 #9
0
ファイル: CProductCFD.cs プロジェクト: superMiracle/testfat
        public void setRenkoInfo(bool bUseRenko = false, double dRenkoStep = 0)
        {
            if (!bUseRenko)
            {
                return;
            }

            m_bUseRenko  = true;
            m_dRenkoStep = dRenkoStep;

            m_product_A_rk = new CCacheData();
            m_product_B_rk = new CCacheData();


            m_rates.setRenkoStep(dRenkoStep);
        }
コード例 #10
0
ファイル: NavigationForm.cs プロジェクト: zhr008/ERP-1
        /// <summary>
        /// 从我的桌面删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuDeskDelete_Click(object sender, EventArgs e)
        {
            Control[]     control   = this.Controls.Find(_pic.Name.Replace("Frm", "LBL") + CConvert.ToString(_pic.Tag, 2), true);
            BaseDeskTable deskTable = new BaseDeskTable();

            deskTable.COMPANY_CODE = UserTable.COMPANY_CODE;
            deskTable.USER_CODE    = UserTable.CODE;
            deskTable.FORM_NAME    = _pic.Name.Replace("Frm", "");
            deskTable.FORM_TITLE   = control[0].Text;
            deskTable.FORM_ARGS    = _pic.Tag.ToString();

            //删除
            if (bCommon.DeleteDesk(deskTable))
            {
                CCacheData.ResetDesk(UserTable.COMPANY_CODE, UserTable.CODE);
                //页面刷新
                ChildShowForm(this.Text, "menuDesk");
            }
        }
コード例 #11
0
ファイル: FrmReceiptSearch.cs プロジェクト: zhr008/ERP-1
 private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         DataGridViewRow dr = dgvData.Rows[e.RowIndex];
         if (e.ColumnIndex == dgvData.Columns["FROMSET"].Index)
         {
             if (CConvert.ToString(dr.Cells["FROMSET"].Value) == "是")
             {
                 string        attachedDirectory = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_PURCHASE);
                 string        slipNumber        = txtSlipNumber.Text;
                 string        product           = CConvert.ToString(dr.Cells["PRODUCT_CODE"].Value);
                 FrmPOAttached frm = null;
                 frm = new FrmPOAttached(dr.Cells["PO_SLIP_NUMBER"].Value.ToString(), dr.Cells["PRODUCT_CODE"].Value.ToString(), attachedDirectory, CConstant.PURCHASE_NEW);
                 frm.ShowDialog(this);
                 frm.Dispose();
             }
         }
     }
 }
コード例 #12
0
        private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                DataGridViewRow row = dgvData.Rows[e.RowIndex];

                if (e.ColumnIndex == dgvData.Columns["UPDATE_COUNT"].Index)
                {
                    if (CConvert.ToInt32(row.Cells["UPDATE_COUNT"].Value) > 0)
                    {
                        FrmHistoryQuotation frm = new FrmHistoryQuotation(CConvert.ToString(row.Cells["SLIP_NUMBER"].Value));
                        if (DialogResult.OK == frm.ShowDialog(this))
                        {
                            FrmBase frmOrder = new FrmQuotation(frm.historySlipNumber);
                            frmOrder.CTag      = CConstant.ORDER_HISTORY;
                            frmOrder.UserTable = _userInfo;
                            frmOrder.ShowDialog();
                        }
                    }
                }

                else if (e.ColumnIndex == dgvData.Columns["ATTACHED_NAME"].Index)
                {
                    if (CConvert.ToString(row.Cells["SLIP_NUMBER"].Value) != "")
                    {
                        Czzd.Common.Library.FTPOperate myftp = new Czzd.Common.Library.FTPOperate("112.82.245.2", "YS_ERP\\quotation\\" + row.Cells["SLIP_NUMBER"].Value, "FTP_user", "czzd", 21);
                        string[] files = myftp.Dir("\\YS_ERP\\quotation\\" + row.Cells["SLIP_NUMBER"].Value);
                        #region 附件
                        if (files.Length > 1)
                        {
                            string attachedDirectory = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_QUOTATION);
                            string slipNumber        = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value);
                            FrmAttachedQuatation frm = new FrmAttachedQuatation(slipNumber, attachedDirectory, true);
                            frm.CTag = CConstant.QUOTATION_MODIFY;
                            frm.ShowDialog(this);
                            frm.Dispose();
                        }
                    }
                }
            }
        }
コード例 #13
0
ファイル: NavigationForm.cs プロジェクト: zhr008/ERP-1
        /// <summary>
        /// 添加到我的桌面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuDeskAdd_Click(object sender, EventArgs e)
        {
            Control[]     control   = this.Controls.Find(_pic.Name.Replace("Frm", "LBL") + CConvert.ToString(_pic.Tag, 2), true);
            BaseDeskTable deskTable = new BaseDeskTable();

            deskTable.COMPANY_CODE = UserTable.COMPANY_CODE;
            deskTable.USER_CODE    = UserTable.CODE;
            deskTable.FORM_NAME    = _pic.Name.Replace("Frm", "");
            deskTable.FORM_TITLE   = control[0].Text;
            deskTable.FORM_ARGS    = _pic.Tag.ToString();
            deskTable.PIC          = ImageToByte(_pic.Image);

            try
            {
                DataTable dt = CCacheData.GetDesk(UserTable.COMPANY_CODE, UserTable.CODE);

                if (dt != null && dt.Rows.Count > maxSize)
                {
                    MessageBox.Show("我的桌面己经超出最大上限 " + maxSize, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
            catch (Exception ex)
            {
            }

            if (bCommon.Exists(deskTable))
            {
                MessageBox.Show(deskTable.FORM_TITLE + "己经存在!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            //添加
            if (bCommon.InsertDesk(deskTable))
            {
                CCacheData.ResetDesk(UserTable.COMPANY_CODE, UserTable.CODE);
            }
        }
コード例 #14
0
 public void setCacheData(CCacheData cacheData)
 {
     m_cacheData_A = cacheData;
 }
コード例 #15
0
ファイル: CIndicator.cs プロジェクト: superMiracle/testfat
        public double getPrice(CCacheData cacheData, int nPos, ETIME_FRAME nTimeFrame = ETIME_FRAME.MIN1, EPRICE_MODE nPriceMode = EPRICE_MODE.BID, EPRICE_VAL nPriceVal = EPRICE_VAL.CLOSE)
        {
            double dRet = 0;

            if (nTimeFrame == ETIME_FRAME.MIN1)
            {
                if (nPriceMode == EPRICE_MODE.ASK)
                {
                    if (nPriceVal == EPRICE_VAL.OPEN)
                    {
                        return(cacheData.getMin(nPos).dAsk_open);
                    }
                    if (nPriceVal == EPRICE_VAL.HIGH)
                    {
                        return(cacheData.getMin(nPos).dAsk_high);
                    }
                    if (nPriceVal == EPRICE_VAL.LOW)
                    {
                        return(cacheData.getMin(nPos).dAsk_low);
                    }
                    if (nPriceVal == EPRICE_VAL.CLOSE)
                    {
                        return(cacheData.getMin(nPos).dAsk_close);
                    }
                }

                if (nPriceMode == EPRICE_MODE.BID)
                {
                    if (nPriceVal == EPRICE_VAL.OPEN)
                    {
                        return(cacheData.getMin(nPos).dBid_open);
                    }
                    if (nPriceVal == EPRICE_VAL.HIGH)
                    {
                        return(cacheData.getMin(nPos).dBid_high);
                    }
                    if (nPriceVal == EPRICE_VAL.LOW)
                    {
                        return(cacheData.getMin(nPos).dBid_low);
                    }
                    if (nPriceVal == EPRICE_VAL.CLOSE)
                    {
                        return(cacheData.getMin(nPos).dBid_close);
                    }
                }
            }

            if (nTimeFrame == ETIME_FRAME.TICK)
            {
                if (nPriceMode == EPRICE_MODE.ASK)
                {
                    return(cacheData.getTick(nPos).dAsk);
                }
                if (nPriceMode == EPRICE_MODE.BID)
                {
                    return(cacheData.getTick(nPos).dBid);
                }
            }

            return(dRet);
        }
コード例 #16
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            lblUserName.Text       = _userInfo.NAME;
            lblDepartmentName.Text = _userInfo.DEPARTMENT_NAME;
            lblCompanyName.Text    = _userInfo.COMPANY_NAME;
            initCompany();
            try
            {
                CCacheData.SetRolesFunction(_userInfo.ROLES_CODE);
            }
            catch { }
            //我的桌面的重新整理
            try
            {
                bCommon.ReSetMyDesk(_userInfo.COMPANY_CODE, _userInfo.CODE, _userInfo.ROLES_CODE);
            }
            catch (Exception ex)
            {
                Logger.Error("我的桌面的重新整理异常!", ex);
            }

            menuManage_Click(this.menuDesk, null);

            #region 通知

            //入库预定
            int receivingCount = 0;
            try
            {
                receivingCount = (new BReceipt()).GetRecordCount(" STATUS_FLAG =" + CConstant.INIT_STATUS + " and DUE_DATE<= '" + DateTime.Now.ToString("yyyy-MM-dd") + "' ");
            }
            catch { }
            if (receivingCount > 0)
            {
                notifyMessage += "您有未处理的入库预定!\r\n";
            }

            //安全库存
            int stockCount = 0;
            try
            {
                stockCount = (new BStock()).GetStockNotifyRecordCount(" STATUS_FLAG <> " + CConstant.DELETE_STATUS + " and QUANTITY < SAFETY_STOCK ");
            }
            catch { }

            if (stockCount > 0)
            {
                notifyMessage += "商品库存不足,请尽快采购!\r\n";
            }

            //通知提示
            int depositCount = 0;
            try
            {
                string strWhere = "STATUS_FLAG <> " + CConstant.DELETE_STATUS + " AND COMPANY_CODE = '" + _userInfo.COMPANY_CODE + "' AND CUSTOMER_CLAIM_DATE <= '" + DateTime.Now.AddDays(7).ToString("yyyy-MM-dd") + "'";
                depositCount = (new BSales()).GetUnReceiptRecordCount(strWhere);
            }
            catch { }

            if (depositCount > 0)
            {
                notifyMessage += "快到收款预定日期,请尽快收款!\r\n";
            }

            if (notifyMessage != "")
            {
                Thread notifyThread = new Thread(new ThreadStart(ShowNotify));
                notifyThread.Start();
            }
            #endregion

            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
            this.FormClosed  += new System.Windows.Forms.FormClosedEventHandler(this.FrmMain_FormClosed);
        }
コード例 #17
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            foreach (Control ctl in this.Controls)
            {
                try
                {
                    // Attempt to cast the control to type MdiClient.
                    MdiClient ctlMDI = (MdiClient)ctl;

                    // Set the BackColor of the MdiClient control.
                    ctlMDI.BackColor = this.BackColor;
                }
                catch (InvalidCastException exc)
                {
                    // Catch and ignore the error if casting failed.
                }
            }

            lblUserName.Text       = _userInfo.NAME;
            lblDepartmentName.Text = _userInfo.DEPARTMENT_NAME;
            lblCompanyName.Text    = _userInfo.COMPANY_NAME;

            try
            {
                CCacheData.SetRolesFunction(_userInfo.ROLES_CODE);
            }
            catch { }
            //我的桌面的重新整理
            try
            {
                bCommon.ReSetMyDesk(_userInfo.COMPANY_CODE, _userInfo.CODE, _userInfo.ROLES_CODE);
            }
            catch (Exception ex)
            {
                Logger.Error("我的桌面的重新整理异常!", ex);
            }

            menuManage_Click(this.menuDesk, null);

            #region 通知

            BProductionPlanSearch bProductionPlanSearch = new BProductionPlanSearch();
            BProductionDrawing    bProductionDrawing    = new BProductionDrawing();
            try
            {
                int a = bProductionPlanSearch.GetProductionPlan(" DEPARTMENT_CODE = '" + _userInfo.DEPARTMENT_CODE + "'" + "  AND PSPP_STATUS_FLAG <> 2" + "  AND STATUS_FLAG <> 5").Tables[0].Rows.Count;
                int b = bProductionPlanSearch.GetProductionTechnology(" DEPARTMENT_CODE = '" + _userInfo.DEPARTMENT_CODE + "'" + "  AND PST_STATUS_FLAG <> 1" + "  AND STATUS_FLAG <> 5").Tables[0].Rows.Count;
                if (CConvert.ToInt32(a + b) > 0)
                {
                    menuProduceManage.Image           = Resources.warning;
                    menuProduceManage.BackgroundImage = null;
                    menuProduceManage.Top             = menuProduceManage.Top - 1;
                    menuProduceManage.Left            = menuProduceManage.Left - 1;
                }
                else if (_userInfo.DEPARTMENT_CODE.Equals("D05"))
                {
                    int c = bProductionDrawing.GetProductionDrawing("PSDL_STATUS_FLAG <> 1" + " AND PS_STATUS_FLAG <> 5").Tables[0].Rows.Count;
                    if (c > 0)
                    {
                        menuProduceManage.Image           = Resources.warning;
                        menuProduceManage.BackgroundImage = null;
                        menuProduceManage.Top             = menuProduceManage.Top - 1;
                        menuProduceManage.Left            = menuProduceManage.Left - 1;
                    }
                }
                else
                {
                    menuProduceManage.Image           = null;
                    menuProduceManage.BackgroundImage = Resources.buttonup;
                }
            }
            catch (Exception ex) { }


            ////入库预定
            //int receivingCount = 0;
            //try
            //{
            //    receivingCount = (new BReceipt()).GetRecordCount(" STATUS_FLAG =" + CConstant.INIT + " and DUE_DATE<= '" + DateTime.Now.ToString("yyyy-MM-dd") + "' ");
            //}
            //catch { }
            //if (receivingCount > 0)
            //{
            //    notifyMessage += "您有未处理的入库预定!\r\n";
            //}

            ////安全库存
            //int stockCount = 0;
            //try
            //{
            //    stockCount = (new BStock()).GetStockNotifyRecordCount(" STATUS_FLAG <> " + CConstant.DELETE + "and QUANTITY < SAFETY_STOCK ");
            //}
            //catch { }

            //if (stockCount > 0)
            //{
            //    notifyMessage += "商品库存不足,请尽快采购!\r\n";
            //}

            ////通知提示
            //if (notifyMessage != "")
            //{
            //    Thread notifyThread = new Thread(new ThreadStart(ShowNotify));
            //    notifyThread.Start();
            //}
            #endregion

            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
            this.FormClosed  += new System.Windows.Forms.FormClosedEventHandler(this.FrmMain_FormClosed);
        }
コード例 #18
0
        private void FrmQuotation_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Normal;
            this.Tag         = CTag;


            #region 税率的初始化
            //税率的初始化
            DataTable dtTaxation = CCacheData.Taxation.Copy();
            dtTaxation.Columns.Add("DISP_TAX_RATE", Type.GetType("System.String"));
            foreach (DataRow row in dtTaxation.Rows)
            {
                row["DISP_TAX_RATE"] = row["TAX_RATE"].ToString() + "%";
            }

            #endregion

            #region 货币的初始化
            //货币的初始化
            DataTable dtCurrency = CCacheData.Currency.Copy();
            cboCurrency.ValueMember   = "CODE";
            cboCurrency.DisplayMember = "NAME";
            cboCurrency.DataSource    = dtCurrency;
            #endregion

            txtver.Text = "1";


            if (string.IsNullOrEmpty(_oldSlipNumber))
            {
                init();
                dgvData.Rows.Add(1);
            }
            else if (CConstant.QUOTATION_OPERATE.Equals(CTag))
            {
                initData();
                this.btnOrderDelete.Visible = false;
                setStatus(false);
            }
            else if (CConstant.QUOTATION_MODIFY.Equals(CTag))
            {
                initData();
                dgvData.Rows.Add(1);
            }


            else if (CConstant.ORDER_HISTORY.Equals(CTag))
            {
                initHistoryData();
                this.btnSave.Visible        = false;
                this.btnOrderDelete.Visible = false;
                this.btnAttached.Visible    = false;
                checkboxflag.Selected       = true;

                setStatus(false);
            }

            #region 自动提示文本输入框
            AutoCompleteStringCollection strings = new AutoCompleteStringCollection();
            strings.AddRange(CCacheData.GetBaseNamesData("EnquiryMethod"));
            txtEnquiryMethod.AutoCompleteCustomSource = strings;
            txtEnquiryMethod.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtEnquiryMethod.AutoCompleteMode         = AutoCompleteMode.Suggest;

            strings = new AutoCompleteStringCollection();
            strings.AddRange(CCacheData.GetBaseNamesData("DeliveryPeriod"));
            txtDeliveryPeriod.AutoCompleteCustomSource = strings;
            txtDeliveryPeriod.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtDeliveryPeriod.AutoCompleteMode         = AutoCompleteMode.Suggest;

            strings = new AutoCompleteStringCollection();
            strings.AddRange(CCacheData.GetBaseNamesData("DeliveryTerms"));
            txtDeliveryTerms.AutoCompleteCustomSource = strings;
            txtDeliveryTerms.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtDeliveryTerms.AutoCompleteMode         = AutoCompleteMode.Suggest;

            strings = new AutoCompleteStringCollection();
            strings.AddRange(CCacheData.GetBaseNamesData("PaymentTerms"));
            txtPaymentTerms.AutoCompleteCustomSource = strings;
            txtPaymentTerms.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtPaymentTerms.AutoCompleteMode         = AutoCompleteMode.Suggest;
            #endregion
        }
コード例 #19
0
ファイル: DrawingUpLoad.cs プロジェクト: seezeef/YS_ERP
        private void btnUpLoad_Click(object sender, EventArgs e)
        {
            string _tmpAttachedDirectoryName = SLIPNUMBER;
            string _attachedDirectory        = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_PRODUCTION);

            if (txtFileName.Text.Trim() == "")
            {
                MessageBox.Show("文件名不能为空!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }


            try
            {
                if (!Directory.Exists(_attachedDirectory + _tmpAttachedDirectoryName + "\\"))
                {
                    Directory.CreateDirectory(_attachedDirectory + _tmpAttachedDirectoryName + "\\");
                    //Directory.CreateDirectory(_attachedDirectory + _tmpAttachedDirectoryName);
                    Czzd.Common.Library.FTPOperate myftp = new Czzd.Common.Library.FTPOperate("112.82.245.2", "YS_ERP\\production", "FTP_user", "czzd", 21);
                    myftp.MkDir(_tmpAttachedDirectoryName);
                }
                foreach (DataRow dr in _currentDt.Rows)
                {
                    if (openFileDialog.SafeFileName.Equals(dr["NAME"]))
                    {
                        MessageBox.Show("文件己经存在,请确认!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                }
                AddAttached(new FileInfo(openFileDialog.FileName));
                File.Copy(openFileDialog.FileName, _attachedDirectory + _tmpAttachedDirectoryName + "\\" + openFileDialog.SafeFileName);



                if (Directory.Exists(_attachedDirectory + _tmpAttachedDirectoryName))
                {
                    DirectoryInfo di    = new DirectoryInfo(_attachedDirectory + _tmpAttachedDirectoryName);
                    FileInfo[]    files = di.GetFiles();
                    Czzd.Common.Library.FTPOperate myftp1 = new Czzd.Common.Library.FTPOperate("112.82.245.2", "YS_ERP\\production\\" + _tmpAttachedDirectoryName, "FTP_user", "czzd", 21);
                    foreach (FileInfo file in files)
                    {
                        myftp1.Put("\\YY模具\\bin\\production\\" + _tmpAttachedDirectoryName + "\\" + file);
                    }

                    if (di.Exists)
                    {
                        DirectoryInfo[] childs = di.GetDirectories();
                        foreach (DirectoryInfo child in childs)
                        {
                            child.Delete(true);
                        }
                        di.Delete(true);
                    }
                }
            }

            catch (IOException ex)
            { }
            int result = 0;

            productionDrawing.Items.Clear();
            for (int i = 0; i < this.clbDrawing.Items.Count; i++)
            {
                BaseProductionDrawingTable productionDrawing1 = new BaseProductionDrawingTable();

                if (clbDrawing.GetItemChecked(i))
                {
                    productionDrawing1.SLIPNUMBER = SLIPNUMBER;
                    string[] sArray = Regex.Split(txtFileName.Text.Trim(), @"\\", RegexOptions.IgnoreCase);

                    //productionDrawing1.FILENAME = txtFileName.Text.Trim();
                    //productionDrawing1.SERVERFILENAME = sArray[sArray.Length - 1];


                    productionDrawing1.FILENAME       = sArray[sArray.Length - 1];
                    productionDrawing1.SERVERFILENAME = sArray[sArray.Length - 1] + "_" + DateTime.Now.ToString("yyyyMMddHHmmss");
                    clbDrawing.SelectedIndex          = i;
                    productionDrawing1.DRAWINGCODE    = clbDrawing.SelectedValue.ToString();

                    productionDrawing.AddItem(productionDrawing1);
                }
            }
            result = bProductionDrawing.Add(productionDrawing);
            if (result < 1)
            {
                MessageBox.Show("上传失败!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                MessageBox.Show("上传成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

                txtFileName.Text = "";
                DataTable dt = new DataTable();
                clbDrawing.DataSource = dt;
                dgvData.DataSource    = dt;
                DataSet ds = bProductionDrawing.GetProductionDrawing(" PSDL_SLIP_NUMBER = '" + SLIPNUMBER + "'" + " AND PSDL_STATUS_FLAG= '0'");
                clbDrawing.DataSource    = ds.Tables[0];
                clbDrawing.ValueMember   = "PSDL_DRAWING_CODE";
                clbDrawing.DisplayMember = "NAME";
                DataSet dsUpload = bProductionDrawing.GetProductionDrawingUpload(" SLIP_NUMBER = '" + SLIPNUMBER + "'" + " AND DRAWING_CODE= '" + DRAWING_CODE + "'");
                dgvData.DataSource = dsUpload.Tables[0];
            }
        }
コード例 #20
0
 public void setCacheData(CCacheData cacheData_A, CCacheData cacheData_B)
 {
     m_cacheData_A = cacheData_A;
     m_cacheData_B = cacheData_B;
 }