Example #1
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();
        }
Example #2
0
        /// <summary>
        /// 服务商品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem8_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (FireAction.FireIsSettled(AC001) == "1")
            {
                XtraMessageBox.Show("已经办理火化且结算完成,不能继续办理业务!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            Frm_businessMisc frm_misc = new Frm_businessMisc();

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

            if (frm_misc.ShowDialog() == 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>;
                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 (gridView1.GetRowCellValue(re, "SA008").ToString() == "1")
                            {
                                continue;
                            }
                            else
                            {
                                if (itemType_list[i] == "10")
                                {
                                    if (XtraMessageBox.Show("已经选择【骨灰盒】,是否要继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                                    {
                                        continue;
                                    }
                                }
                                else if (itemId_list[i] == "11")
                                {
                                    if (XtraMessageBox.Show("已经选择【纸棺】,是否要替换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                                    {
                                        continue;
                                    }
                                }
                            }
                        }
                    }

                    re = gridView1.LocateByValue("SA004", itemId_list[i]);
                    if (re >= 0)
                    {
                        if (XtraMessageBox.Show("【" + gridView1.GetRowCellValue(re, "SA003").ToString() + "】已经存在,要继续选择吗?",
                                                "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                        {
                            continue;
                        }
                    }
                    re = FireAction.FireSales_Misc(AC001,
                                                   itemId_list[i],
                                                   nums_list[i],
                                                   Envior.cur_userId
                                                   );
                    if (re < 0)
                    {
                        return;
                    }
                }
                RefreshSalesData();
            }
            frm_misc.Dispose();
        }