Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            videoSourcePlayer1.NewFrame += new AForge.Controls.VideoSourcePlayer.NewFrameHandler(videoSourcePlayer1_NewFrame);
            string sb = "";

            string[] ss = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Split(new char[] { '/', ':', ' ', '-' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (var s in ss)
            {
                sb += s;
            }
            Random rad = new Random();

            sb += rad.Next(1000, 9999);
            shInfoList model = new shInfoList();

            //model.jcName = textBox1.Text;
            //model.jcCardNumber = textBox3.Text;
            model.PinPai     = comboBox2.Text;
            model.Color      = comboBox3.Text;
            model.YMoney     = Convert.ToInt32(textBox13.Text.Trim());
            model.Type       = comboBox1.Text;
            model.FuWuName   = textBox9.Text;
            model.Remark     = textBox11.Text;
            model.CJQuestion = textBox10.Text;
            model.PaiNumber  = "";
            model.YMPerson   = comboBox4.Text;
            //model.d = DateTime.Now.ToString("yyyy MM dd");
            //model.jcEndDate = TimeGuiGe.TimePicter(dateTimePicker1.Text);
            while (path1 == "")
            {
                Thread.Sleep(1000);
            }
            model.ImgUrl = path1;
            List <shInfoList> list = new List <shInfoList>();

            list.Add(model);
            bool result = jcinfobll.addJCList(list, textBox3.Text.Trim(), textBox1.Text.Trim(), TimeGuiGe.TimePicterBegin((dateTimePicker1.Text)), sb, "1", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            if (result)
            {
                MessageBox.Show("添加成功!");
                this.Close();
            }
        }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            List <shInfoList> list1 = new List <shInfoList>();
            shInfoList        model1;
            double            hjje = 0;
            int    hjcg            = 0;
            double yfje            = 0;

            if (dataGridView1.SelectedRows.Count != 1)
            {
                MessageBox.Show("请选择一条记录!");
                return;
            }
            string dnanumber             = dataGridView1.SelectedRows[0].Cells["danNumber"].Value.ToString();
            string painumber             = dataGridView1.SelectedRows[0].Cells["danNumber"].Value.ToString();
            string websb                 = "http://yhc19950315.imwork.net:28948?id=" + dnanumber;
            Bitmap bitmap                = writer.Write(websb);
            List <LiShiConsumption> list = lsbll.SelectForDanNumber(dnanumber);

            //List<JCInfoModel> list = jcbll.SelectJCListForDAN(dnanumber);
            foreach (var iteam in list)
            {
                model1        = new shInfoList();
                model1.JiCun  = iteam.IsJC;
                model1.Count  = Convert.ToInt32(iteam.LSCount);
                model1.FuKuan = false;
                string[] str = iteam.LSStaff.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                model1.Type = str[0];
                if (str.Length > 1)
                {
                    model1.FuWuName = str[1];
                }
                model1.PinPai     = iteam.LSPinPai;
                model1.Color      = iteam.LSColor;
                model1.CountMoney = Convert.ToDouble(iteam.LSMoney);
                model1.YMoney     = Convert.ToDouble(iteam.LSYMoney);
                hjje += Convert.ToDouble(iteam.LSMoney);
                hjcg += Convert.ToInt32(iteam.LSCount);
                yfje += Convert.ToDouble(iteam.LSYMoney);
                list1.Add(model1);
            }
            PirentDocumentClass.PirentSH(hjje.ToString(), hjcg.ToString(), yfje.ToString(), list1, bitmap, dnanumber, list[0].LSName, list[0].LSCardNumber, list[0].LSDate, "补打");
        }
Пример #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            //dataBind
            bool       IsHuaKa = false;
            shInfoList model   = new shInfoList();
            double     money   = 0;

            if (radioButton1.Checked)
            {
                DialogResult result = MessageBox.Show("确认赠送", "提示信息", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (result == DialogResult.Cancel)
                {
                    return;
                }
                model.CountMoney = money;
                //赠送
            }
            else if (radioButton2.Checked)
            {
                try
                {
                    //指定单价
                    double mm = Convert.ToDouble(textBox2.Text.Trim());
                    money            = Convert.ToDouble(numericUpDown2.Value) * mm;
                    model.CountMoney = money;
                }
                catch
                {
                    MessageBox.Show("单价请输入数字!");
                    return;
                }
            }
            else if (radioButton3.Checked)
            {
                if (dataGridView1.SelectedRows.Count != 1)
                {
                    MessageBox.Show("请选择一条数据!");
                    return;
                }
                double price = Convert.ToDouble(dataGridView1.SelectedRows[0].Cells["spPrice"].Value);
                //指定折扣spPrice
                try
                {
                    int zk = Convert.ToInt32(numericUpDown1.Value);
                    money            = price * Convert.ToInt32(numericUpDown2.Value) * zk / 100;
                    model.CountMoney = money;
                }
                catch
                {
                    MessageBox.Show("信息错误!");
                    return;
                }
            }
            else//直接以指定价格出售
            {
                try
                {
                    double price = Convert.ToDouble(dataGridView1.SelectedRows[0].Cells["spPrice"].Value);
                    //指定单价
                    //double mm = Convert.ToDouble(textBox2.Text.Trim());
                    money            = Convert.ToDouble(numericUpDown2.Value) * price;
                    model.CountMoney = money;
                }
                catch
                {
                    MessageBox.Show("单价请输入数字!");
                    return;
                }
            }
            model.JiCun      = false;
            model.FuWuName   = "购买商品[" + dataGridView1.SelectedRows[0].Cells["spName"].Value.ToString().Trim();
            model.YMoney     = 0;
            model.FuKuan     = false;
            model.Count      = Convert.ToInt32(numericUpDown2.Value);
            model.Type       = dataGridView1.SelectedRows[0].Cells["spType"].Value.ToString();
            model.CiCount    = 0;
            model.PaiNumber  = "";
            model.CJQuestion = "";
            model.Remark     = "";
            model.PinPai     = "";
            model.Color      = "";
            model.ImgUrl     = dataGridView1.SelectedRows[0].Cells["Gid"].Value.ToString();
            model.YMPerson   = "";
            //model.TCMoney = Convert.ToDouble(textBox3.Text.Trim() == "" ? "0" : textBox3.Text.Trim());
            if (radioButton1.Checked)
            {
                //赠送
            }
            else
            {
                DialogResult huaka = MessageBox.Show("是否划卡?(划卡即消费用户的卡里的余额,否则用户支付现金。)", "提示信息", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                IsHuaKa = true;
                if (huaka == DialogResult.No)
                {
                    model.YMoney = money;
                    IsHuaKa      = false;
                }
                else if (huaka == DialogResult.Cancel)
                {
                    return;
                }
            }
            fhmodel = model;
            ishk    = IsHuaKa;
            IsSpRemark from = IsSpRemark.CreateForm(AddRemark);

            from.Show();
        }