public ProductCirculationForm(CirculationTypeConf c, ProductCirculationDao cirDao)
        {
            InitializeComponent();

            openMode      = 0;
            circulationID = 0;

            this.conf = c;

            //有些控件的显示控制,下面还有一个virtual的hideSomeControls
            //除了采购销售,要隐藏一些东西
            if ((int)conf.type > 4)
            {
                this.toolStripButton_print.Visible       = false;
                this.toolStripButton_printLetter.Visible = false;
            }

            int close = 0;

            if (ConfUtility.GetBackFreightOpen() == "backFreightClose")
            {
                this.panel_payBackFreight.Visible = false;
                close++;
            }

            if (ConfUtility.GetLastPayReceiptOpen() == "lastPayReceiptClose")
            {
                this.panel_lastPayReceipt.Visible = false;
                close++;
            }

            if (close == 2)
            {
                this.panel_payBasic.Location = new Point(this.panel_payBasic.Location.X, this.panel_payBasic.Location.Y - 20);
            }

            if (ConfUtility.GetPrintLetterOpen() == "printLetterClose")
            {
                this.toolStripButton_printLetter.Visible = false;
            }

            this.Text             = conf.name + "单";
            this.label_title.Text = this.Text;
            //this.label2.Text = conf.business+"时间:";
            this.label2.Text         = "开单时间:";
            this.label_customer.Text = conf.customer;

            this.label_sum.Text           = conf.productDirection == 1 ? "本单实计应付:" : "本单实计应收:";
            this.label_thisPayed.Text     = conf.productDirection == 1 ? LabelUtility.THIS_PAY : LabelUtility.THIS_RECEIPT;
            this.label_arrears.Text       = conf.arrearsDirection == 1? "以上欠款(应付):":"以上欠款(应收):";
            this.label1_accumulative.Text = conf.arrearsDirection == 1 ? "累计欠款(应付):" : "累计欠款(应收):";

            this.cirDao = cirDao;

            initDatagridview(this.dataGridView1);
        }
Exemplo n.º 2
0
        public CirSettingForm()
        {
            InitializeComponent();

            string serialType = ConfUtility.GetSerialType();

            //string可以用==,String就不行?
            if (serialType == "serialType2")
            {
                this.radioButton2.Checked = true;
            }
            else
            {
                this.radioButton1.Checked = true;
            }

            string backFreight = ConfUtility.GetBackFreightOpen();

            if (backFreight == "backFreightOpen")
            {
                this.checkBox_backFreight.Checked = true;
            }

            string printLetter = ConfUtility.GetPrintLetterOpen();

            if (printLetter == "printLetterOpen")
            {
                this.checkBox_printLetter.Checked = true;
            }

            string lastPayReceipt = ConfUtility.GetLastPayReceiptOpen();

            if (lastPayReceipt == "lastPayReceiptOpen")
            {
                this.checkBox_lastPayReceipt.Checked = true;
            }
        }
        private void load_with_customer(ProductCirculation sell, List <ProductCirculationRecord> records)
        {
            // 获取供应商的信息
            Customer customer = CustomerDao.getInstance().FindByID(sell.CustomerID);

            DataTable dt = ConfDao.getInstance().GetAll();

            Report.ControlByName("title").AsStaticBox.Text = ConfDao.getInstance().Get(3).ToString() + conf.name + "单";

            //Report.ControlByName("info").AsStaticBox.Text = string.Format("地    址 : {0}\n银行账号 : {1}\n其他信息 : {2}", dt.Rows[3]["conf"], dt.Rows[7]["conf"], dt.Rows[8]["conf"]);
            //Report.ControlByName("contract").AsStaticBox.Text = string.Format("联 系 人 : {0}\n电话号码 : {1}\n手机号码 : {2}", dt.Rows[4]["conf"], dt.Rows[5]["conf"], dt.Rows[6]["conf"]);

            if (Report.ControlByName("addressValue") != null)
            {
                Report.ControlByName("addressValue").AsStaticBox.Text = dt.Rows[3]["conf"].ToString();
            }

            if (Report.ControlByName("bankValue") != null)
            {
                Report.ControlByName("bankValue").AsStaticBox.Text = dt.Rows[7]["conf"].ToString();
            }

            if (Report.ControlByName("commentValue") != null)
            {
                Report.ControlByName("commentValue").AsStaticBox.Text = dt.Rows[8]["conf"].ToString();
            }

            if (Report.ControlByName("contractorValue") != null)
            {
                Report.ControlByName("contractorValue").AsStaticBox.Text = dt.Rows[4]["conf"].ToString();
            }

            if (Report.ControlByName("telValue") != null)
            {
                Report.ControlByName("telValue").AsStaticBox.Text = dt.Rows[5]["conf"].ToString();
            }

            if (Report.ControlByName("phoneValue") != null)
            {
                Report.ControlByName("phoneValue").AsStaticBox.Text = dt.Rows[6]["conf"].ToString();
            }

            string filePath = Application.StartupPath + ConfUtility.debugPath + "\\" + ConfDao.getInstance().Get(14);

            if (Report.ControlByName("PictureBox1") != null && File.Exists(filePath))
            {
                Report.ControlByName("PictureBox1").AsPictureBox.LoadFromFile(filePath);
            }

            // (用户,供应商)
            Report.ControlByName("customer").AsStaticBox.Text = string.Format("{0}{1}{2}", conf.customer, sell.CustomerName, String.IsNullOrEmpty(customer.Phone) ? "" : "(手机:" + customer.Phone + ")");

            if (Report.ControlByName("customerAddr") != null)
            {
                Report.ControlByName("customerAddr").AsStaticBox.Text = "客户地址: " + customer.Address;
            }

            // (日期)
            Report.ControlByName("date").AsStaticBox.Text = "开单时间: " + sell.CirculationTime.ToString("yyyy年MM月dd日");

            // 右(单号)
            if (Report.ControlByName("serial") != null)
            {
                Report.ControlByName("serial").AsStaticBox.Text = "单号: NO." + sell.Code;
            }

            // 备注
            if (Report.ControlByName("cirComment") != null)
            {
                Report.ControlByName("cirComment").AsStaticBox.Text = string.Format("备注:{0}", sell.Comment);
            }

            Report.ControlByName("realTotal").AsStaticBox.Text = string.Format("{0:0.00}元", sell.RealTotal);
            if (Report.ControlByName("text_backFreight") != null)
            {
                Report.ControlByName("text_backFreight").AsStaticBox.Text = string.Format("{0}件×{1}元 = {2}元", this.label_totalPieces.Text, this.textBox_backFreightPerPiece.Text, this.label_totalBackFreight.Text);
            }

            if (ConfUtility.GetLastPayReceiptOpen() == "lastPayReceiptOpen" && Report.ControlByName("lastPayReceipt") != null)
            {
                Report.ControlByName("lastPayReceipt").AsStaticBox.Text = this.label_lastPayReceipt.Text;
            }

            Report.ControlByName("label_pay").AsStaticBox.Text = this.label_thisPayed.Text;

            Report.ControlByName("text_pay").AsStaticBox.Text = string.Format("{0:0.00}元", double.Parse(this.textBox_thisPayed.Text));
            Report.ControlByName("text_arr").AsStaticBox.Text = string.Format("{0:0.00}元", double.Parse(this.textBox_previousArrears.Text));
            Report.ControlByName("text_acc").AsStaticBox.Text = string.Format("{0:0.00}元 ({1})", this.textBox_accumulative.Text, this.label_accCap.Text);
            //因为有些单据是没有的
            if (Report.ControlByName("oper") != null)
            {
                Report.ControlByName("oper").AsStaticBox.Text = sell.Oper;
            }

            fill_records(records);
        }