Exemplo n.º 1
0
        public LetterSettingForm(ProductCirculation c, string p)
        {
            InitializeComponent();
            cir    = c;
            pieces = p;
            this.textBox_timeFormat.Text = ConfDao.getInstance().Get(12);
            if (string.IsNullOrEmpty(this.textBox_timeFormat.Text) || this.textBox_timeFormat.Text == "0")
            {
                resetTime();
            }

            if (cir.CustomerID != 0)
            {
                Customer customer = CustomerDao.getInstance().FindByID(cir.CustomerID);
                this.textBox_name.Text    = customer.Name;
                this.textBox_address.Text = customer.Address;
                this.textBox_tel.Text     = customer.Contract;

                this.textBox_contractor.Text      = ConfDao.getInstance().Get(5);
                this.textBox_contractorPhone.Text = ConfUtility.getContract();
            }
            this.textBox_pieces.Text = pieces;

            try
            {
                this.textBox_time.Text = cir.CirculationTime.ToString(this.textBox_timeFormat.Text);
            }
            catch {
                resetTime();
                this.textBox_time.Text = cir.CirculationTime.ToString(this.textBox_timeFormat.Text);
            }
            this.textBox_comment.Text = cir.Comment;
        }
Exemplo n.º 2
0
 public SignForm()
 {
     InitializeComponent();
     this.textBox1.Text = AuthUtility.getCPU();
     this.toolStripStatusLabel1.Text = ConfUtility.GetSoftName();
     this.label4.Text = ConfUtility.GetProductName();
 }
Exemplo n.º 3
0
        public AboutForm()
        {
            InitializeComponent();

            this.label1.Text = ConfUtility.GetProductName();
            this.label2.Text = ConfUtility.GetSoftName();
        }
Exemplo n.º 4
0
        public LoginForm()
        {
            InitializeComponent();

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

            this.toolStripStatusLabel1.Text = ConfUtility.GetProductNameWithCopyRight();
        }
        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);
        }
        private void lookupText1_valueSetted(object sender, LookupArg arg)
        {
            //转移控件焦点,使得能够重新生成历史price
            if (dataGridView1.Rows.Count > 0 && dataGridView1.Columns["totalPrice"].Visible == true)
            {
                dataGridView1.CurrentCell = dataGridView1.Rows[0].Cells["totalPrice"];
            }

            //有两个地方修改serial,initCirculation和company_valueChange
            //如果有涉及到initCirculation,那么initCirculation应该放在valueChange后面
            //valueChange也是在serialType2时才需要修改serial
            string serialType = ConfUtility.GetSerialType();

            //add 2018-4-13如果为已审核,就不需要重新计算previousArrear、serial、lastPayReceipt
            if (arg != null)
            {
                //新增、初始化编辑,编辑(未审核)
                //编辑初始化时serial是不用重新计算的,但是要判断编辑初始化比较困难,为了代码方便,一刀切,在initCirculation那里会重新设回serial
                if (circulation == null || circulation.Status <= 1)
                {
                    Customer customer = CustomerDao.getInstance().FindByID((int)arg.Value);
                    this.textBox_previousArrears.Text = (this.conf.arrearsDirection * customer.arrear).ToString();
                    //2018-3-28修复
                    if (serialType == "serialType2")
                    {
                        int max = cirDao.getMaxCode(string.Format("{0}-ID{1}-{2}-", conf.code, customer.ID, DateTime.Now.ToString("yyyyMM")));
                        this.textBox_serial.Text = string.Format("{0}-ID{1}-{2}-{3:000}", conf.code, customer.ID, DateTime.Now.ToString("yyyyMM"), max + 1);
                    }

                    if (this.panel_lastPayReceipt.Visible)
                    {
                        setLastPayReceipt(customer.ID);
                    }
                }
                //编辑(已审核)不需要重新计算
            }
            //新增初始化
            else
            {
                if (serialType == "serialType2")
                {
                    this.textBox_serial.Text = "";
                }

                this.textBox_previousArrears.Text = "";
                this.label_lastPayReceipt.Text    = "";
            }

            resetNeedSave(true);
        }
        private void initCirculation()
        {
            if (openMode == 0)
            {
                switchMode(openMode);
                this.dateTime_sellTime.Value = DateTime.Now;
                this.textBox_comment.Text    = null;
                this.lookupText1.LookupArg   = null;
                this.lookupText1.Text_Lookup = null;

                //23018-04-20
                //重新设置company后,如果company为null(这种情况发生在原来编辑页面打开新增页面)
                //会引发changed事件,从而修改serial,所以这段代码要放在company设定之后
                //
                if (ConfUtility.GetSerialType() == "serialType1" || (int)conf.type > 4)
                {
                    int max = cirDao.getMaxCode(string.Format("{0}-{1}-", conf.code, DateTime.Now.ToString("yyyyMMdd")));
                    this.textBox_serial.Text = string.Format("{0}-{1}-{2:0000}", conf.code, DateTime.Now.ToString("yyyyMMdd"), max + 1);
                }

                this.textBox_operator.Text = ConfDao.getInstance().Get(5).ToString();
                this.dataGridView1.Rows.Clear();
                this.dataGridView2[1, 0].Value = null;

                this.textBox_cutoff.Text    = "100";
                this.textBox_realTotal.Text = "";

                this.textBox_previousArrears.Text = null;
                this.textBox_thisPayed.Text       = null;
                this.textBox_accumulative.Text    = null;
                this.textBox_freight.Text         = null;

                this.resetNeedSave(false);
                this.recordChanged = false;

                return;
            }

            circulation = cirDao.FindByID(circulationID);

            this.textBox_serial.Text     = circulation.Code;
            this.dateTime_sellTime.Value = circulation.CirculationTime;
            this.textBox_comment.Text    = circulation.Comment;
            this.textBox_operator.Text   = circulation.Oper;

            this.dataGridView2[1, 0].Value = circulation.Total;

            this.backgroundWorker.RunWorkerAsync(circulation.ID);
            this.invokeBeginLoadNotify();
        }
Exemplo n.º 8
0
        private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            string path = ConfUtility.GetBackupPath();

            if (!Directory.Exists(path))         //判断是否存在
            {
                Directory.CreateDirectory(path); //创建新路径
            }

            path += "\\ERP_back_" + DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss") + ".mdb";
            try
            {
                File.Copy(Application.StartupPath + "\\ERP.mdb", path, true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "备份错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 9
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;
            }
        }
Exemplo n.º 10
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;
            }
        }
Exemplo n.º 11
0
 public BackupForm()
 {
     InitializeComponent();
     this.textBox_oldPs.Text = ConfUtility.GetBackupPath();
 }
Exemplo n.º 12
0
        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);
        }