Exemple #1
0
        /// <summary>
        /// 新增 冷藏
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem13_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Frm_business02 frm_1 = new Frm_business02();

            frm_1.swapdata["dataset"]   = business_ds;
            frm_1.swapdata["SALESTYPE"] = "1";

            DialogResult result = frm_1.ShowDialog();

            if (result == DialogResult.OK)
            {
                string  s_itemId = frm_1.swapdata["ITEMID"].ToString();
                DataRow dr       = business_ds.Sa01.Rows.Add();
                dr["SA003"] = MiscAction.GetItemFullName(s_itemId);
                dr["SA002"] = "02";                                                                                  //类型:冷藏柜
                dr["SA004"] = s_itemId;
                dr["PRICE"] = MiscAction.GetItemFixPrice(s_itemId);                                                  //单价
                dr["SA005"] = "1";                                                                                   //临时性销售
                dr["NUMS"]  = Convert.ToDecimal(frm_1.swapdata["NUMS"]);                                             //数量
                dr["SA007"] = Convert.ToDecimal(dr["PRICE"]) * Convert.ToDecimal(dr["NUMS"]);                        //金额
                dr["SA020"] = "F";

                dr.EndEdit();
            }
            frm_1.Dispose();
            this.CalcSum();
        }
Exemple #2
0
        private void barButtonItem14_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Frm_business03 frm_1 = new Frm_business03();

            frm_1.swapdata["dataset"]   = business_ds;
            frm_1.swapdata["SALESTYPE"] = "1";

            DialogResult result = frm_1.ShowDialog();

            if (result == DialogResult.OK)
            {
                List <string> itemId_list = frm_1.swapdata["xxs"] as List <string>;
                for (int i = 0; i < itemId_list.Count; i++)
                {
                    DataRow dr = business_ds.Sa01.Rows.Add();
                    dr["SA003"] = MiscAction.GetItemFullName(itemId_list[i]);
                    dr["SA002"] = "03";
                    dr["SA004"] = itemId_list[i];
                    dr["PRICE"] = MiscAction.GetItemFixPrice(itemId_list[i]);
                    dr["SA005"] = "1";
                    dr["NUMS"]  = 1;
                    dr["SA007"] = dr["PRICE"];
                    dr["SA020"] = MiscAction.GetItemInvoiceType(itemId_list[i]);
                    dr.EndEdit();
                }
            }
            frm_1.Dispose();
            this.CalcSum();
        }
Exemple #3
0
        /// <summary>
        /// 休息室办理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BarButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int            re;
            Frm_business03 frm_xxs = new Frm_business03();

            frm_xxs.swapdata["businessObject"] = this;
            frm_xxs.swapdata["dataset"]        = sa01_ds;


            if (frm_xxs.ShowDialog() == DialogResult.OK)
            {
                List <string> itemIdList = this.swapdata["xxs"] as List <string>;
                foreach (string s in itemIdList)
                {
                    re = gridView1.LocateByValue("SA004", s);
                    if (re >= 0)
                    {
                        if (MessageBox.Show("【" + gridView1.GetRowCellValue(re, "SA003").ToString() + "】已经存在,要替换吗?",
                                            "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                        {
                            continue;
                        }
                        gridView1.DeleteRow(re);
                    }

                    DataRow dr = sa01_ds.Sa01.Rows.Add();
                    dr["SA003"] = MiscAction.GetItemFullName(s);
                    dr["SA002"] = "03";                                                 //类型:休息室
                    dr["SA004"] = s;
                    dr["PRICE"] = MiscAction.GetItemFixPrice(s);                        //单价
                    dr["SA005"] = "1";                                                  //临时性销售
                    dr["NUMS"]  = 1;
                    dr["SA007"] = dr["PRICE"];

                    dr.EndEdit();
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// 服务及商品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem17_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Frm_businessMisc frm_misc = new Frm_businessMisc();

            frm_misc.swapdata["SALESTYPE"] = "1";
            frm_misc.swapdata["dataset"]   = business_ds;

            DialogResult result = frm_misc.ShowDialog();

            if (result == DialogResult.OK)
            {
                List <string>  itemId_list          = frm_misc.swapdata["itemIdList"] as List <string>;
                List <string>  itemType_list        = frm_misc.swapdata["itemTypeList"] as List <string>;
                List <decimal> price_list           = frm_misc.swapdata["priceList"] as List <decimal>;
                List <decimal> nums_list            = frm_misc.swapdata["numsList"] as List <decimal>;
                List <string>  itemInvoiceType_list = frm_misc.swapdata["itemInvoiceTypeList"] as List <string>;
                int            re = 0;

                for (int i = 0; i < itemId_list.Count; i++)
                {
                    if (itemType_list[i] == "10" || itemType_list[i] == "11")
                    {
                        re = gridView1.LocateByValue("SA002", itemType_list[i]);
                        if (re > 0)
                        {
                            if (itemType_list[i] == "10")
                            {
                                if (MessageBox.Show("已经选择【骨灰盒】,是否要继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                                {
                                    continue;
                                }
                            }
                            else if (itemId_list[i] == "11")
                            {
                                if (MessageBox.Show("已经选择【纸棺】,是否要替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                                {
                                    continue;
                                }
                            }
                            gridView1.DeleteRow(re);
                        }
                    }

                    re = gridView1.LocateByValue("SA004", itemId_list[i]);
                    if (re >= 0)
                    {
                        if (MessageBox.Show("【" + gridView1.GetRowCellValue(re, "SA003").ToString() + "】已经存在,要替换吗?",
                                            "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                        {
                            continue;
                        }
                        gridView1.DeleteRow(re);
                    }

                    DataRow dr = business_ds.Sa01.Rows.Add();
                    dr["SA003"] = MiscAction.GetItemFullName(itemId_list[i]);
                    dr["SA002"] = itemType_list[i];
                    dr["SA004"] = itemId_list[i];
                    dr["PRICE"] = price_list[i];
                    dr["SA005"] = "1";
                    dr["NUMS"]  = nums_list[i];
                    dr["SA007"] = price_list[i] * nums_list[i];
                    dr["SA020"] = itemInvoiceType_list[i];
                    dr.EndEdit();
                }
                //RefreshSalesData();
            }
            frm_misc.Dispose();
            this.CalcSum();
        }