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