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 LoginForm()
        {
            InitializeComponent();

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

            this.toolStripStatusLabel1.Text = ConfUtility.GetProductNameWithCopyRight();
        }
Exemplo n.º 3
0
        public static string GetLastPayReceiptOpen()
        {
            string serialType = ConfDao.getInstance().Get(16);

            if (!string.IsNullOrEmpty(serialType) && serialType.Equals("lastPayReceiptOpen"))
            {
                return("lastPayReceiptOpen");
            }
            return("lastPayReceiptClose");
        }
Exemplo n.º 4
0
        public static string GetPrintLetterOpen()
        {
            string serialType = ConfDao.getInstance().Get(17);

            if (!string.IsNullOrEmpty(serialType) && serialType.Equals("printLetterOpen"))
            {
                return("printLetterOpen");
            }
            return("printLetterClose");
        }
Exemplo n.º 5
0
        public static String GetProductNameWithCopyRight()
        {
            string product = ConfDao.getInstance().Get(11).ToString();

            if (string.IsNullOrEmpty(product) || product == "0")
            {
                product = ConfUtility.PRODUCT_NAME;
            }
            return(product + " copyright (c) 2018");
        }
Exemplo n.º 6
0
        public static string GetBackupPath()
        {
            string path = ConfDao.getInstance().Get(13);

            if (!string.IsNullOrEmpty(path) && !path.Equals("0") && !path.Equals("1"))
            {
                return(path);
            }
            return("D:\\飞翔软件备份");
        }
Exemplo n.º 7
0
        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            ConfDao.getInstance().Update(19, this.radioButton2.Checked == true?"serialType2":"serialType1");
            ConfDao.getInstance().Update(18, this.checkBox_backFreight.Checked == true ? "backFreightOpen" : "backFreightClose");
            ConfDao.getInstance().Update(17, this.checkBox_printLetter.Checked == true ? "printLetterOpen" : "printLetterClose");
            ConfDao.getInstance().Update(16, this.checkBox_lastPayReceipt.Checked == true ? "lastPayReceiptOpen" : "lastPayReceiptClose");

            MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
Exemplo n.º 8
0
 /// <summary>
 /// event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripButton3_Click(object sender, EventArgs e)
 {
     string path = null;
     if (ValidateUtility.getName(this.textBox_oldPs, this.errorProvider1, out path) == false)
         return;
     ConfDao.getInstance().Update(13, path);
     MessageBox.Show("保存路径成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     this.Close();
     
 }
Exemplo n.º 9
0
        public static string GetSerialType()
        {
            string serialType = ConfDao.getInstance().Get(19);

            if (!string.IsNullOrEmpty(serialType) && serialType.Equals("serialType2"))
            {
                return("serialType2");
            }
            return("serialType1");
        }
Exemplo n.º 10
0
        //2018-3-22,如果数据库Conf表有设置软件的名称,则用数据库的,否则使用默认
        public static String GetSoftName()
        {
            string soft = ConfDao.getInstance().Get(10).ToString();

            if (string.IsNullOrEmpty(soft) || soft == "0")
            {
                soft = ConfUtility.SOFT_NAME;
            }
            return(soft);
        }
Exemplo n.º 11
0
        public static string GetBackFreightOpen()
        {
            string serialType = ConfDao.getInstance().Get(18);

            if (!string.IsNullOrEmpty(serialType) && serialType.Equals("backFreightOpen"))
            {
                return("backFreightOpen");
            }
            return("backFreightClose");
        }
Exemplo n.º 12
0
        //对内提供服务的函数,调用switch mode,其实可以把openMode作为参数
        private void initCard()
        {
            //2020-1-18 这里只分两种情况,除了0之外,其他情况还要根据card的status来重设openMode
            if (openMode == 0)
            {
                int max = 1;// CirDao.getMaxCode(string.Format("CARD-{0}-", DateTime.Now.ToString("yyyyMMdd")));
                this.textBox_serial.Text     = string.Format("CARD-{0}-{1:0000}", DateTime.Now.ToString("yyyyMMdd"), max + 1);
                this.dateTime_cardTime.Value = DateTime.Now;
                this.textBox_num.Text        = "";
                this.textBox_realTotal.Text  = "";

                this.textBox_comment.Text    = null;
                this.textBox_operator.Text   = ConfDao.getInstance().Get(5).ToString();
                this.lookupText1.LookupArg   = null;
                this.lookupText1.Text_Lookup = null;
            }
            else
            {
                card = CardDao.getInstance().FindByID(cardID);

                this.textBox_serial.Text     = card.Code;
                this.dateTime_cardTime.Value = card.CardTime;
                this.textBox_realTotal.Text  = card.Total.ToString();
                this.textBox_num.Text        = card.Number.ToString();
                this.textBox_leftNum.Text    = card.LeftNumber.ToString();
                this.textBox_comment.Text    = card.Comment;
                this.textBox_operator.Text   = card.Oper;
                this.lookupText1.LookupArg   = new LookupArg(card.CustomerID, card.CustomerName);
                this.lookupText1.Text_Lookup = card.CustomerName;

                List <Consume> list = ConsumeDao.getInstance().FindList(cardID, 4);
                this.dataGridView1.Rows.Clear();

                for (int i = 0; i < list.Count; i++)
                {
                    Consume consume = list[i];
                    this.dataGridView1.Rows.Add();
                    this.dataGridView1.Rows[i].Cells["ID"].Value   = consume.ID;
                    this.dataGridView1.Rows[i].Cells["name"].Value = consume.Code;

                    this.dataGridView1.Rows[i].Cells["num"].Value = consume.Number;

                    int status = consume.Status;
                    this.dataGridView1.Rows[i].Cells["status"].Value = Consume.consumeStatusContext[status - 1];

                    this.dataGridView1.Rows[i].Cells["sellTime"].Value = consume.ConsumeTime.ToString("yyyy-MM-dd HH:mm:ss");
                }

                openMode = card.Status;
            }
            switchMode(openMode);
            resetNeedSave(false);
        }
Exemplo n.º 13
0
        /// <summary>
        /// event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            string ps;

            if (this.getOldPs(out ps) &&
                this.getNewPs(out ps) &&
                this.getNewPsAgain(out ps))
            {
                ConfDao.getInstance().Update(1, ps);
                MessageBox.Show("保存密码成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
        }
Exemplo n.º 14
0
        private void ReportInfoForm_Load(object sender, EventArgs e)
        {
            DataTable dt = ConfDao.getInstance().GetAll();

            this.textBox_company.Text      = dt.Rows[2]["conf"].ToString();
            this.textBox_address.Text      = dt.Rows[3]["conf"].ToString();
            this.textBox_contact.Text      = dt.Rows[4]["conf"].ToString();
            this.textBox_phone.Text        = dt.Rows[5]["conf"].ToString();
            this.textBox_mobile.Text       = dt.Rows[6]["conf"].ToString();
            this.textBox_bank.Text         = dt.Rows[7]["conf"].ToString();
            this.textBox_other.Text        = dt.Rows[8]["conf"].ToString();
            this.pictureBox1.ImageLocation = Application.StartupPath + ConfUtility.debugPath + "\\" + dt.Rows[13]["conf"].ToString();
        }
Exemplo n.º 15
0
        //对内提供服务的函数,如果是edit,会自动调整openMode,并调用switch mode
        private void initConsume()
        {
            //2020-1-18 这里只分两种情况,除了0之外,其他情况还要根据card的status来重设openMode
            if (openMode == 0)
            {
                int max = 1;// CirDao.getMaxCode(string.Format("CARD-{0}-", DateTime.Now.ToString("yyyyMMdd")));
                this.textBox_code.Text = string.Format("XF-{0}-{1:0000}", DateTime.Now.ToString("yyyyMMdd"), max + 1);

                this.dateTime_consumeTime.Value = DateTime.Now;
                this.textBox_comment.Text       = null;
                this.lookupText1.LookupArg      = null;
                this.lookupText1.Text_Lookup    = null;

                this.textBox_operator.Text = ConfDao.getInstance().Get(5).ToString();
                //this.dataGridView1.Rows.Clear();
                //this.dataGridView2[1, 0].Value = null;
            }
            else
            {
                consume = ConsumeDao.getInstance().FindByID(consumeID);

                this.textBox_code.Text          = consume.Code;
                this.dateTime_consumeTime.Value = consume.ConsumeTime;

                this.textBox_comment.Text  = consume.Comment;
                this.textBox_operator.Text = consume.Oper;


                int leftNumber = 0;
                //如果是为审核,那么需要定时更新
                if (openMode == 1)
                {
                    leftNumber = consume.Card.LeftNumber;
                }
                else
                {
                    leftNumber = consume.LeftNumber;
                }
                string cardInfo = consume.Card.getInfo(leftNumber);

                this.lookupText2.LookupArg = new LookupArg(consume.CardID, cardInfo);
                //借这个存放leftNumber;
                this.lookupText2.LookupArg.ArgName = leftNumber.ToString();
                this.lookupText2.Text_Lookup       = cardInfo;


                openMode = consume.Status;
            }
            switchMode(openMode);
            resetNeedSave(false);
        }
Exemplo n.º 16
0
        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.º 17
0
        private void resetNegativeItem()
        {
            string negative = ConfDao.getInstance().Get(20);

            if (!string.IsNullOrEmpty(negative) && negative == "1")
            {
                this.permitNegativeItem.Checked    = true;
                this.notPermitNegativeItem.Checked = false;
            }
            else
            {
                this.permitNegativeItem.Checked    = false;
                this.notPermitNegativeItem.Checked = true;
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// get value from control with valiadating
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private bool getPs(out string ps)
        {
            if (string.IsNullOrEmpty(this.textBox_ps.Text) ||
                !this.textBox_ps.Text.Equals(ConfDao.getInstance().Get(1)))
            {
                this.errorProvider1.SetError(this.textBox_ps, "ÊäÈëΪ¿Õ»ò´íÎó!");
                ps = "";
                return(false);
            }
            else
            {
                this.errorProvider1.SetError(this.textBox_ps, string.Empty);
                ps = this.textBox_ps.Text;
                return(true);
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// get value from control with valiadating
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            string[] names       = pictureBox1.ImageLocation.Split('\\');
            string   picLocation = Application.StartupPath + ConfUtility.debugPath + "\\" + names[names.Length - 1];

            try {
                File.Delete(Application.StartupPath + ConfUtility.debugPath + "\\" + ConfDao.getInstance().Get(14));
                File.Copy(pictureBox1.ImageLocation, picLocation, true);
            }
            catch { }

            ConfDao.getInstance().UpdateCompanyInfo(this.textBox_company.Text, this.textBox_address.Text, this.textBox_contact.Text,
                                                    this.textBox_phone.Text, this.textBox_mobile.Text, this.textBox_bank.Text, this.textBox_other.Text, names[names.Length - 1]);
            MessageBox.Show("保存信息成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
Exemplo n.º 20
0
        /// <summary>
        /// get value from control with valiadating
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private bool getOldPs(out string oldPs)
        {
            if (string.IsNullOrEmpty(this.textBox_oldPs.Text) ||
                !this.textBox_oldPs.Text.Equals(ConfDao.getInstance().Get(1)))
            {
                this.errorProvider1.SetError(this.textBox_oldPs, "输入为空或错误!");
                oldPs = "";
                return(false);
            }
            else
            {
                this.errorProvider1.SetError(this.textBox_oldPs, string.Empty);
                oldPs = this.textBox_oldPs.Text;
                return(true);
            }
        }
Exemplo n.º 21
0
        private void ReportFetchRecord()
        {
            Report.ControlByName("title").AsStaticBox.Text    = ConfDao.getInstance().Get(3).ToString() + " 客户对账单";
            Report.ControlByName("customer").AsStaticBox.Text = "客户:" + this.textBox_search.Text;
            Report.ControlByName("time").AsStaticBox.Text     = string.Format("对账时间: {0}至{1}", this.dateTimePicker_start.Value.ToShortDateString(), this.dateTimePicker_end.Value.ToShortDateString());

            // 处理 明细
            foreach (DataGridViewRow row in this.dataGridView1.Rows)
            {
                Report.DetailGrid.Recordset.Append();
                Report.FieldByDBName("date").AsString        = row.Cells["time"].Value.ToString();
                Report.FieldByDBName("type").AsString        = row.Cells["type"].Value.ToString() + "\n" + row.Cells["serial"].Value.ToString();
                Report.FieldByDBName("product").AsString     = row.Cells["detail"].Value.ToString();
                Report.FieldByDBName("needReceipt").AsString = row.Cells["needReceipt"].Value.ToString();
                Report.FieldByDBName("thisReceipt").AsString = row.Cells["thisReceipt"].Value.ToString();
                Report.FieldByDBName("accTotal").AsString    = row.Cells["accNeedReceipt"].Value.ToString();
                Report.DetailGrid.Recordset.Post();
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// get value from control with valiadating
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private bool checkAndUpdateSN()
        {
            if (string.IsNullOrEmpty(this.textBox_ps.Text) || AuthUtility.checkSN(this.textBox_ps.Text) == false)
            {
                this.errorProvider1.SetError(this.textBox_ps, "×¢²áÂëΪ¿Õ»ò´íÎó!");
                return(false);
            }
            else
            {
                this.errorProvider1.SetError(this.textBox_ps, string.Empty);
                string newSn = this.textBox_ps.Text;

                string oldSn = ConfDao.getInstance().Get(2);
                if (oldSn != null && oldSn.Trim() != "")
                {
                    newSn = oldSn.Trim() + "/" + newSn;
                }
                ConfDao.getInstance().Update(2, newSn);
                return(true);
            }
        }
Exemplo n.º 23
0
        public static string getContract()
        {
            string phone = ConfDao.getInstance().Get(6).ToString();
            string tel   = ConfDao.getInstance().Get(7).ToString();

            string temp = "";

            if (string.IsNullOrEmpty(phone))
            {
                temp = tel;
            }
            else if (string.IsNullOrEmpty(tel))
            {
                temp = phone;
            }
            else
            {
                temp = string.Format("{0} / {1}", tel, phone);
            }
            return(temp);
        }
Exemplo n.º 24
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.º 25
0
 private void resetTime()
 {
     this.textBox_timeFormat.Text = "yyyy MM dd";
     ConfDao.getInstance().Update(12, this.textBox_timeFormat.Text);
 }
Exemplo n.º 26
0
 //保存字段设置
 private void button2_Click(object sender, EventArgs e)
 {
     ConfDao.getInstance().Update(12, this.textBox_timeFormat.Text);
     this.textBox_time.Text = cir.CirculationTime.ToString(this.textBox_timeFormat.Text);
     MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
Exemplo n.º 27
0
        //审核
        private void toolStripButton_finish_Click(object sender, EventArgs e)
        {
            string tips = "审核后,将修改库存数量和债务信息,是否审核?";

            if ((int)conf.type > 4)
            {
                tips = "审核后,将修改库存数量,是否审核?";
            }
            if (MessageBox.Show(tips, "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            {
                return;
            }

            //2017-11-20防止多个窗口打开,并同时审核
            this.refreshArrears();

            //2018-3-29:其实审核的时候不需要重新获取 cir 和 record,考虑把这几行去掉?不行!!!因为债务有可能更新
            List <ProductCirculationRecord> records;

            this.getRecords(out records);

            ProductCirculation sell;

            this.getCirculation(out sell);

            //2018-4-20修复的bug
            if (cirDao.FindByID(sell.ID) == null)
            {
                MessageBox.Show("该单据已经被删除了。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //this.Enabled = true;
                return;
            }

            //判断是否支持负库存
            string negative = ConfDao.getInstance().Get(20);

            if ((string.IsNullOrEmpty(negative) || negative != "1") && conf.productDirection == -1)
            {
                foreach (ProductCirculationRecord record in records)
                {
                    int leftNum = cirDao.getProductDao().FindNumByID(record.ProductID);
                    if (record.TotalNum > leftNum)
                    {
                        MessageBox.Show(string.Format("{0} 库存不足,数量为{1},审核失败!", record.ProductName, leftNum), "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.Enabled = true;
                        return;
                    }
                }
            }

            //2017-11-20,相应的信息也要更新
            sell.CirculationTime         = DateTime.Now;
            this.dateTime_sellTime.Value = sell.CirculationTime;
            //重置了dateTime控件后,neeSave会变为true,但是由于是系统自动更新时间,所以不需要用户保存!耦合度太高了
            this.needSave = false;
            cirDao.UpdateBaiscInfo(sell);

            //这个地方需要事务处理
            foreach (ProductCirculationRecord record in records)
            {
                //更新产品的成本总价和数量,新增利润
                this.updateCostAndProfit(sell, record);
            }

            cirDao.UpdateStatus(circulationID, 4);
            CustomerDao.getInstance().update_arrear(sell.CustomerID, conf.arrearsDirection * Convert.ToDouble(this.textBox_accumulative.Text));

            //2018-3-30
            this.initCirculation();

            MessageBox.Show("审核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

            openMode = 4;
            this.switchMode(4);

            this.invokeUpdateNotify(this.conf.finishNotifyType);
        }
Exemplo n.º 28
0
        //弃核
        private void toolStripButton_finishCancel_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("是否弃核,退回到未审核状态?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            {
                return;
            }

            //判断是否支持负库存
            string negative = ConfDao.getInstance().Get(20);

            if ((string.IsNullOrEmpty(negative) || negative != "1") && conf.productDirection == 1)
            {
                foreach (ProductCirculationRecord record in records)
                {
                    int leftNum = cirDao.getProductDao().FindNumByID(record.ProductID);
                    if (record.TotalNum > leftNum)
                    {
                        MessageBox.Show(string.Format("{0} 库存不足,数量为{1},弃核失败!", record.ProductName, leftNum), "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.Enabled = true;
                        return;
                    }
                }
            }

            //circulation不用重新get,因为考虑到审核过的有重新init,而且其值不能改变
            ProductCirculation maxCir = cirDao.FindLastestByCustomerID(this.circulation.CustomerID, false);

            if (maxCir != null && !maxCir.Code.Equals(circulation.Code))
            {
                MessageBox.Show(string.Format("弃核失败,在此单之后存在已审核的单据,请先弃核{0}", maxCir.Code), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            PayReceipt payReceipt = PayReceiptDao.getInstance().FindLastestByCustomerID(circulation.CustomerID, false);

            if (payReceipt != null && circulation.CirculationTime < payReceipt.bill_time)
            {
                MessageBox.Show(string.Format("弃核失败,在此单之后存在已审核的单据,请先弃核{0}", payReceipt.serial), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            foreach (ProductCirculationRecord record in records)
            {
                //更新产品数量
                this.cancelUpdateCostAndProfit(circulation, record);
            }

            double arrear;

            double.TryParse(this.textBox_previousArrears.Text, out arrear);

            CustomerDao.getInstance().update_arrear(circulation.CustomerID, conf.arrearsDirection * arrear);
            cirDao.UpdateStatus(circulationID, 1);

            MessageBox.Show("弃核成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

            openMode = 1;
            this.switchMode(1);

            this.invokeUpdateNotify(this.conf.finishNotifyType);
        }
Exemplo n.º 29
0
        private void load_print_info()
        {
            Customer  customer = CustomerDao.getInstance().FindByID(payReceipt.customer_id);
            DataTable dt       = ConfDao.getInstance().GetAll();

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

            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();
            }

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

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

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

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


            // 备注
            if (Report.ControlByName("text_comment") != null)
            {
                Report.ControlByName("text_comment").AsStaticBox.Text = payReceipt.comment;
            }

            if ((conf.type == PayReceipt.BillType.BuyRefund || conf.type == PayReceipt.BillType.SellRefund) && Report.ControlByName("amount") != null)
            {
                Report.ControlByName("amount").AsStaticBox.Text = string.Format("{0}    {1:0.00}元", this.label_needPayed.Text, double.Parse(this.textBox_sum.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("label_arr").AsStaticBox.Text = this.label_arrears.Text;
            Report.ControlByName("text_arr").AsStaticBox.Text  = string.Format("{0:0.00}元", double.Parse(this.textBox_previousArrears.Text));

            Report.ControlByName("label_acc").AsStaticBox.Text = this.label_accumulative.Text;
            decimal temp1;

            decimal.TryParse(this.textBox_accumulative.Text, out temp1);
            Report.ControlByName("text_acc").AsStaticBox.Text = string.Format("{0:0.00}元 ({1})", this.textBox_accumulative.Text, DataUtility.CmycurD(temp1));
            //因为有些单据是没有的
            if (Report.ControlByName("oper") != null)
            {
                Report.ControlByName("oper").AsStaticBox.Text = payReceipt.handle_people;
            }
        }
Exemplo n.º 30
0
 private void notPermitNegativeItem_Click(object sender, EventArgs e)
 {
     ConfDao.getInstance().Update(20, "0");
     resetNegativeItem();
 }