Пример #1
0
 public frmMedGuide(frmCropGuide fcg, frmMainShopSimple fms, frmPestGuide fpg)
     : base("收銀作業")
 {
     InitializeComponent();
     this.fcg = fcg;
     frs      = fms;
     this.fpg = fpg;
     addMed(this.fpg.realcropcode, this.fpg.pestcode);
 }
Пример #2
0
        public frshyscorp(frmMainShopSimple fms, string barcodeNum, string name)
        {
            this.fms        = fms;
            this.barcodeNum = barcodeNum;
            InitializeComponent();
            string[] strWhereParameterArray = new string[1]
            {
                barcodeNum
            };
            DataTable dataTable = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, "*", "hypos_GOODSLST", "GDSNO = {0}", "", null, strWhereParameterArray, CommandOperationType.ExecuteReaderReturnDataTable);

            hyscope.Text = "【" + getCommodityName(dataTable.Rows[0]) + "】" + hyscope.Text.ToString();
            _pesticideId = dataTable.Rows[0]["pesticideId"].ToString();
            _formCode    = dataTable.Rows[0]["formCode"].ToString();
            _contents    = dataTable.Rows[0]["contents"].ToString();
            loaddata();
        }
Пример #3
0
        public frmMainShopSimpleCheckout(frmMainShopSimple fms, DataGridView temp)
            : base("銷售作業")
        {
            this.fms  = fms;
            infolist1 = new DataGridView();
            string text = DateTime.Now.ToString("yyyyMMdd");

            string[] strWhereParameterArray = new string[1]
            {
                text
            };
            DataTable dataTable = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, "*", "ECRHDHS", "Hdate = {0}", "", null, strWhereParameterArray, CommandOperationType.ExecuteReaderReturnDataTable);

            if (dataTable.Rows.Count > 0)
            {
                string text2 = dataTable.Rows.Count.ToString();
                if (text2.Length == 1)
                {
                    HseqNo = text + "00" + text2;
                }
                else if (text2.Length == 2)
                {
                    HseqNo = text + "0" + text2;
                }
                else
                {
                    HseqNo = text + text2;
                }
            }
            else
            {
                HseqNo = text + "001";
            }
            setMasterFormName("銷售作業 | 單號: " + HseqNo);
            InitializeComponent();
            for (int i = 0; i < temp.Rows.Count; i++)
            {
                infolist1.Rows.Add(temp.Rows[i].Cells[0].Value, temp.Rows[i].Cells[1].Value, temp.Rows[i].Cells[2].Value, temp.Rows[i].Cells[3].Value);
                items.Text = fms.gettotalprice();
                total.Text = fms.gettotalpriceDiscount();
            }
        }
Пример #4
0
        public frmDialogMed(frmMainShopSimple frs, int count, string barcode)
        {
            InitializeComponent();
            this.frs   = frs;
            this.count = count;
            barcodeid  = barcode;
            string[] strWhereParameterArray = new string[1]
            {
                barcodeid
            };
            DataTable dataTable = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, "GDName", "hypos_GOODSLST", "GDSNO = {0}", "", null, strWhereParameterArray, CommandOperationType.ExecuteReaderReturnDataTable);

            label1.Text = "【" + dataTable.Rows[0]["GDName"].ToString() + "】用藥範圍設定";
            string    sql        = "select cropId,pestId from hypos_user_pair where barcode = '" + barcodeid + "' order by total desc";
            DataTable dataTable2 = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, sql, null, CommandOperationType.ExecuteReaderReturnDataTable);

            if (dataTable2.Rows.Count <= 0)
            {
                return;
            }
            foreach (DataRow row in dataTable2.Rows)
            {
                string[] strWhereParameterArray2 = new string[1]
                {
                    row["cropId"].ToString()
                };
                DataTable dataTable3 = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, "code,name", "HyCrop", "code = {0}", "", null, strWhereParameterArray2, CommandOperationType.ExecuteReaderReturnDataTable);
                string[]  strWhereParameterArray3 = new string[1]
                {
                    row["pestId"].ToString()
                };
                DataTable dataTable4 = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, "code,name", "HyBlight", "code = {0}", "", null, strWhereParameterArray3, CommandOperationType.ExecuteReaderReturnDataTable);
                infolist.Rows.Add(dataTable3.Rows[0]["name"].ToString(), dataTable4.Rows[0]["name"].ToString(), barcodeid, dataTable3.Rows[0]["code"].ToString(), dataTable4.Rows[0]["code"].ToString());
                DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
                dataGridViewButtonColumn.Text       = "選擇";
                dataGridViewButtonColumn.Name       = "btn";
                dataGridViewButtonColumn.HeaderText = "選取";
                dataGridViewButtonColumn.UseColumnTextForButtonValue = true;
                infolist.Columns.Add(dataGridViewButtonColumn);
            }
        }
Пример #5
0
        public frmDialogMedNew(frmMainShopSimple frs, int count, string barcode)
        {
            InitializeComponent();
            this.frs   = frs;
            this.count = count;
            barcodeid  = barcode;
            string[] strWhereParameterArray = new string[1]
            {
                barcodeid
            };
            DataTable dataTable = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, "*", "hypos_GOODSLST", "GDSNO = {0}", "", null, strWhereParameterArray, CommandOperationType.ExecuteReaderReturnDataTable);

            _pesticideId = dataTable.Rows[0]["pesticideId"].ToString();
            _formCode    = dataTable.Rows[0]["formCode"].ToString();
            _content     = dataTable.Rows[0]["contents"].ToString();
            hyscope.Text = "【" + getCommodityName(dataTable.Rows[0]) + "】用藥範圍設定";
            string    sql        = "select cropId,pestId from hypos_user_pair where barcode = '" + barcodeid + "' order by total desc";
            DataTable dataTable2 = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, sql, null, CommandOperationType.ExecuteReaderReturnDataTable);

            if (dataTable2.Rows.Count <= 0)
            {
                return;
            }
            foreach (DataRow row in dataTable2.Rows)
            {
                string[] strWhereParameterArray2 = new string[1]
                {
                    row["cropId"].ToString()
                };
                DataTable dataTable3 = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, "code,name", "HyCrop", "code = {0}", "", null, strWhereParameterArray2, CommandOperationType.ExecuteReaderReturnDataTable);
                string[]  strWhereParameterArray3 = new string[1]
                {
                    row["pestId"].ToString()
                };
                DataTable dataTable4 = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, "code,name", "HyBlight", "code = {0}", "", null, strWhereParameterArray3, CommandOperationType.ExecuteReaderReturnDataTable);
                infolist.Rows.Add(dataTable3.Rows[0]["name"].ToString(), dataTable4.Rows[0]["name"].ToString(), "選擇", "用藥說明", barcodeid, dataTable3.Rows[0]["code"].ToString(), dataTable4.Rows[0]["code"].ToString());
            }
        }
Пример #6
0
 public frmCommdityList(frmMainShopSimple frs, string commodityName, string commodityNum, string CommodityClass, string[] strSearchConditionCommodityStatus)
     : base("銷售作業")
 {
     InitializeComponent();
     ucMembers = new CommodityInfoforSearch[10]
     {
         uC_Member1,
         uC_Member2,
         uC_Member3,
         uC_Member4,
         uC_Member5,
         uC_Member6,
         uC_Member7,
         uC_Member8,
         uC_Member9,
         uC_Member10
     };
     this.frs            = frs;
     this.commodityName  = commodityName;
     this.commodityNum   = commodityNum;
     this.CommodityClass = CommodityClass;
     _strSearchConditionCommodityStatus = strSearchConditionCommodityStatus;
 }
Пример #7
0
 public void setfms(frmMainShopSimple fms)
 {
     this.fms = fms;
 }
Пример #8
0
        public printsimple(frmMainShopSimple frs, DataGridView infolist)
        {
            InitializeComponent();
            string text = DateTime.Now.ToString("yyyyMMdd HH:mm:ss");

            string[,] strFieldArray = new string[11, 2]
            {
                {
                    "sellNo",
                    frs.getHseqNo()
                },
                {
                    "sellTime",
                    text
                },
                {
                    "memberId",
                    "test"
                },
                {
                    "sum",
                    "0"
                },
                {
                    "sumDiscount",
                    "0"
                },
                {
                    "sumRebate",
                    "0"
                },
                {
                    "cash",
                    "0"
                },
                {
                    "Credit",
                    "0"
                },
                {
                    "items",
                    frs.gettotalprice()
                },
                {
                    "itemstotal",
                    frs.gettotalpriceDiscount()
                },
                {
                    "status",
                    "1"
                }
            };
            DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Insert, "", "hypos_main_sell", "", "", strFieldArray, null, CommandOperationType.ExecuteNonQuery);
            for (int i = 0; i < infolist.Rows.Count; i++)
            {
                strFieldArray = new string[10, 2]
                {
                    {
                        "sellNo",
                        frs.getHseqNo()
                    },
                    {
                        "barcode",
                        infolist.Rows[i].Cells[3].Value.ToString()
                    },
                    {
                        "fixedPrice",
                        "0"
                    },
                    {
                        "sellingPrice",
                        "0"
                    },
                    {
                        "num",
                        infolist.Rows[i].Cells[2].Value.ToString()
                    },
                    {
                        "discount",
                        "0"
                    },
                    {
                        "subtotal",
                        "0"
                    },
                    {
                        "total",
                        "0"
                    },
                    {
                        "PRNO",
                        "test"
                    },
                    {
                        "BLNO",
                        "test2"
                    }
                };
                DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Insert, "", "hypos_detail_sell", "", "", strFieldArray, null, CommandOperationType.ExecuteNonQuery);
            }
            MessageBox.Show("新增成功");
            Barcode barcode = new Barcode();

            barcode.IncludeLabel = true;
            barcode.LabelFont    = new Font("Verdana", 8f);
            barcode.Width        = 120;
            barcode.Height       = 60;
            Image image = barcode.Encode(TYPE.CODE128, frs.getHseqNo(), barcode.Width, barcode.Height);

            barcodeimg.Image           = image;
            label8.Text                = frs.getHseqNo();
            label9.Text                = text;
            itemsnum.Text              = frs.gettotalprice();
            totalnum.Text              = frs.gettotalpriceDiscount();
            tableLayoutPanel1.RowCount = 1;
            Label label = new Label();

            label.Text = "商品名稱";
            Label label2 = label;

            label2.Anchor = AnchorStyles.None;
            tableLayoutPanel1.Controls.Add(label2, 1, 0);
            Label label3 = new Label();

            label3.Text   = "數量";
            label2        = label3;
            label2.Anchor = AnchorStyles.None;
            tableLayoutPanel1.Controls.Add(label2, 2, 0);
            Label label4 = new Label();

            label4.Text   = "用藥範圍";
            label2        = label4;
            label2.Anchor = AnchorStyles.None;
            tableLayoutPanel1.Controls.Add(label2, 3, 0);
            for (int j = 0; j < infolist.Rows.Count; j++)
            {
                tableLayoutPanel1.RowCount += 1;
                tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
                Label label5 = new Label();
                label5.Text   = infolist.Rows[j].Cells[0].Value.ToString();
                label2        = label5;
                label2.Anchor = AnchorStyles.None;
                tableLayoutPanel1.Controls.Add(label2, 0, tableLayoutPanel1.RowCount - 1);
                Label label6 = new Label();
                label6.Text   = infolist.Rows[j].Cells[1].Value.ToString();
                label2        = label6;
                label2.Anchor = AnchorStyles.None;
                tableLayoutPanel1.Controls.Add(label2, 1, tableLayoutPanel1.RowCount - 1);
                Label label7 = new Label();
                label7.Text   = infolist.Rows[j].Cells[2].Value.ToString();
                label2        = label7;
                label2.Anchor = AnchorStyles.None;
                tableLayoutPanel1.Controls.Add(label2, 2, tableLayoutPanel1.RowCount - 1);
            }
        }