Ejemplo n.º 1
0
        //打开窗口时,检查是否需要更新
        void MyDockContent_Activated(object sender, EventArgs e)
        {
            //File.AppendAllText("e:\\debug.txt", string.Format("Form:{0} activted. time:{1}\r\n", this.Name, DateTime.Now.ToLongTimeString()));
            bool refresh = false;
            //reference to FormMgr is high coupling
            Dictionary <UpdateType, int> dic = FormSingletonFactory.getInstance().getVersions();
            List <UpdateType>            needUpdateVersions = new List <UpdateType>();

            foreach (UpdateType key in versionDic.Keys)
            {
                if (versionDic[key] < dic[key])
                {
                    needUpdateVersions.Add(key);
                    refresh = true;
                }
            }

            foreach (UpdateType version in needUpdateVersions)
            {
                versionDic[version] = dic[version];
            }

            if (refresh == true)
            {
                this.refresh();
            }
        }
Ejemplo n.º 2
0
 //更新form本身的version,主要用在categoryItemForm里
 protected void refreshVersion(UpdateType type)
 {
     //reference to FormMgr is high coupling
     if (this.versionDic.ContainsKey(type))
     {
         this.versionDic[type] = FormSingletonFactory.getInstance().getVersions()[type];
     }
 }
Ejemplo n.º 3
0
        public CardForm()
        {
            InitializeComponent();

            openMode = 0;
            cardID   = 0;

            this.lookupText1.LookupForm = FormSingletonFactory.getInstance().getCustomerCIForm_Select();
        }
Ejemplo n.º 4
0
        //protected CardDao cirDao;

        public ConsumeForm()
        {
            InitializeComponent();

            openMode  = 0;
            consumeID = 0;

            this.lookupText1.LookupForm = FormSingletonFactory.getInstance().getCustomerCIForm_Select();
            this.lookupText2.LookupForm = FormSingletonFactory.getInstance().getCardListForm_select();
        }
Ejemplo n.º 5
0
        private void PayReceiptForm_Load(object sender, EventArgs e)
        {
            this.lookupText1.LookupForm   = FormSingletonFactory.getInstance().getCustomerCIForm_Select();
            this.lookupText1.valueSetted += new LookupText.ValueSetted(lookupText1_valueSetted);

            this.textBox_sum.TextChanged             += new EventHandler(setAccumulative);
            this.textBox_previousArrears.TextChanged += new EventHandler(setAccumulative);
            this.textBox_thisPayed.TextChanged       += new EventHandler(setAccumulative);

            initPayReceipt();
        }
Ejemplo n.º 6
0
 private void toolStripButton_editType_Click(object sender, EventArgs e)
 {
     if (treeView1.SelectedNode != null)
     {
         int          id   = int.Parse(treeView1.SelectedNode.Name);
         CategoryForm form = FormSingletonFactory.getInstance().getCategoryForm(conf.CategoryTableName, 1, id);
         form.updateNotify -= new UpdateNotify(form_updateNotify_category);
         form.updateNotify += new UpdateNotify(form_updateNotify_category);
         form.ShowDialog();
     }
     else
     {
         MessageBox.Show("请选择类别.", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 7
0
        private void ProductCirculationForm_Load(object sender, EventArgs e)
        {
            this.lookupText1.LookupForm = FormSingletonFactory.getInstance().getCustomerCIForm_Select();

            dataGridView2.Rows.Add("总价合计/元:", "", "累计件数", "");
            dataGridView2[0, 0].Style.BackColor          = Color.Yellow;
            dataGridView2[0, 0].Style.SelectionBackColor = Color.Yellow;
            dataGridView2[1, 0].Style.BackColor          = Color.Yellow;
            this.backgroundWorker.DoWork             += new DoWorkEventHandler(backgroundWorker_DoWork);
            this.backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted);

            this.textBox_cutoff.TextChanged += new EventHandler(textBox_cutoff_TextChanged);
            this.textBox_backFreightPerPiece.TextChanged += new EventHandler(textBox_backFreightPerPiece_TextChanged);
            this.textBox_realTotal.TextChanged           += new EventHandler(textBox_realTotal_TextChanged);
            this.textBox_realTotal.TextChanged           += new EventHandler(setAccumulative);

            this.textBox_previousArrears.TextChanged += new EventHandler(setAccumulative);
            this.textBox_thisPayed.TextChanged       += new EventHandler(setAccumulative);

            initCirculation();
        }
Ejemplo n.º 8
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            loadingForm = new LoadingForm();

            this.Text = ConfDao.getInstance().Get(3).ToString();

            resetNegativeItem();

            NavigationUC navigation = new NavigationUC(this);

            navigation.Dock = DockStyle.Fill;
            this.panel1.Controls.Add(navigation);

            getWelcomeForm().Show(this.dockPanel1);
            this.toolStripStatusLabel1.Text = string.Format("{0}. 当前日期: {1}", ConfUtility.GetProductNameWithCopyRight(), DateTime.Now.ToShortDateString());

            FormSingletonFactory.getInstance().MainForm = this;

            Control.CheckForIllegalCrossThreadCalls = false;

            if (ConfUtility.softType == 0)
            {
                this.toolStripButton_card.Visible    = false;
                this.toolStripButton_consume.Visible = false;
            }
            else if (ConfUtility.softType == 1)
            {
                this.toolStripButton_purchase.Visible  = false;
                this.toolStripButton_sell.Visible      = false;
                this.toolStripButton_queryLib.Visible  = false;
                this.toolStripButton_statistic.Visible = false;

                this.允许ToolStripMenuItem.Visible   = false;
                this.单据设置ToolStripMenuItem.Visible = false;
            }
        }
Ejemplo n.º 9
0
        public void setForm(String buttonText, int openMode, int ID)
        {
            switch (buttonText)
            {
            case LabelUtility.PURCHASE_LIST:
                FormSingletonFactory.getInstance().getProductPurchaseListForm().Show(this.dockPanel1);
                break;

            case LabelUtility.PURCHASE:
                FormSingletonFactory.getInstance().getProductPurchaseForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getProductPurchaseForm().reload(openMode, ID);
                break;

            case LabelUtility.PURCHASE_BACK:
                FormSingletonFactory.getInstance().getProductPurchaseBackForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getProductPurchaseBackForm().reload(openMode, ID);
                break;

            case LabelUtility.MANUFACTURE_LIST:
                FormSingletonFactory.getInstance().getManufactureListForm().Show(this.dockPanel1);
                break;

            case LabelUtility.MANU_COST:
                FormSingletonFactory.getInstance().getManuCostForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getManuCostForm().reload(openMode, ID);
                break;

            case LabelUtility.MANU_IN:
                FormSingletonFactory.getInstance().getManuInForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getManuInForm().reload(openMode, ID);
                break;

            case LabelUtility.SELL_LIST:
                FormSingletonFactory.getInstance().getProductSellListForm().Show(this.dockPanel1);
                break;

            case LabelUtility.SELL:
                FormSingletonFactory.getInstance().getProductSellForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getProductSellForm().reload(openMode, ID);
                break;

            case LabelUtility.SELL_BACK:
                FormSingletonFactory.getInstance().getProductSellBackForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getProductSellBackForm().reload(openMode, ID);
                break;

            case LabelUtility.CASH_LIST:
                FormSingletonFactory.getInstance().getPayReceiptListForm().Show(this.dockPanel1);
                break;

            case LabelUtility.CASH_PAY:
                FormSingletonFactory.getInstance().getBuyPayBillForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getBuyPayBillForm().reload(openMode, ID);
                break;

            case LabelUtility.CASH_PAY_REFUND:
                FormSingletonFactory.getInstance().getBuyRefundBillForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getBuyRefundBillForm().reload(openMode, ID);
                break;

            case LabelUtility.CASH_RECEIPT:
                FormSingletonFactory.getInstance().getSellReceiptBillForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getSellReceiptBillForm().reload(openMode, ID);
                break;

            case LabelUtility.CASH_RECEIPT_REFUND:
                FormSingletonFactory.getInstance().getSellRefundBillForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getSellRefundBillForm().reload(openMode, ID);
                break;

            case LabelUtility.CASH_OTHER_PAY:
                FormSingletonFactory.getInstance().getOtherPayBillForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getOtherPayBillForm().reload(openMode, ID);
                break;

            case LabelUtility.CASH_OTHER_RECEIPT:
                FormSingletonFactory.getInstance().getOtherReceiptBillForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getOtherReceiptBillForm().reload(openMode, ID);
                break;

            case LabelUtility.STATISTIC_PROFIT:
                FormSingletonFactory.getInstance().getQuerySellProfitForm().Show(this.dockPanel1);
                break;

            case LabelUtility.LIB_LIST:
                FormSingletonFactory.getInstance().getProductLibListForm().Show(this.dockPanel1);
                break;

            case LabelUtility.LIB_OVERFLOW:
                FormSingletonFactory.getInstance().getProductLibOverflowForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getProductLibOverflowForm().reload(openMode, ID);
                break;

            case LabelUtility.LIB_LOSS:
                FormSingletonFactory.getInstance().getProductLibLossForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getProductLibLossForm().reload(openMode, ID);
                break;

            /*case LabelUtility.QUERY_LIB:
             *  FormSingletonFactory.getInstance().getQueryLibForm().Show(this.dockPanel1);
             *  break;*/
            case LabelUtility.QUERY_PRODUCT_DETAIL:
                FormSingletonFactory.getInstance().getQueryProductDetailForm().Show(this.dockPanel1);
                break;

            case LabelUtility.QUERY_CASH_DETAIL:
                FormSingletonFactory.getInstance().getQueryCashDetailForm().Show(this.dockPanel1);
                break;

            case LabelUtility.STATISTIC_PRODUCT:
                FormSingletonFactory.getInstance().getProductStatisticForm().Show(this.dockPanel1);
                break;

            case LabelUtility.STATISTIC_CASH:
                FormSingletonFactory.getInstance().getStatisticCashForm().Show(this.dockPanel1);
                break;

            case LabelUtility.DATA_CUSTOMER:
                FormSingletonFactory.getInstance().getCustomerCIForm().Show(this.dockPanel1);
                break;

            case LabelUtility.DATA_PRODUCT:
                FormSingletonFactory.getInstance().getProductCIForm().Show(this.dockPanel1);
                break;

            case LabelUtility.DATA_COMPANY:
                ReportInfoForm form = new ReportInfoForm();
                form.ShowDialog();
                break;


            case LabelUtility.CARD_LIST:
                FormSingletonFactory.getInstance().getCardListForm().Show(this.dockPanel1);
                //FormSingletonFactory.getInstance().getCardListForm().reload(openMode, ID);
                break;

            case LabelUtility.CARD_ADD:
                FormSingletonFactory.getInstance().getCardForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getCardForm().reload(openMode, ID);
                break;

            case LabelUtility.CONSUME_ADD:
                FormSingletonFactory.getInstance().getConsumeForm().Show(this.dockPanel1);
                FormSingletonFactory.getInstance().getConsumeForm().reload(openMode, ID);
                break;

            case LabelUtility.CONSUME_LIST:
                FormSingletonFactory.getInstance().getConsumeListForm().Show(this.dockPanel1);
                //FormSingletonFactory.getInstance().getConsumeListForm().reload(openMode, ID);
                break;

            default:
                break;
            }
        }