コード例 #1
0
ファイル: Frm_BaseService.cs プロジェクト: radtek/Lime
        /// <summary>
        /// 应用套餐
        /// </summary>
        /// <param name="serviceType"></param>
        private void ApplyCombo(string serviceType)
        {
            DataTable         dt_cb02     = new DataTable();
            OracleDataAdapter cb02Adapter = new OracleDataAdapter("select * from cb02 where cb001=(select cb001 from cb01 where cb002 = '0' and cb005 = :service)", SqlHelper.conn);

            OracleParameter op_service = new OracleParameter("service", OracleDbType.Varchar2, 3);

            op_service.Direction = ParameterDirection.Input;
            cb02Adapter.SelectCommand.Parameters.Add(op_service);
            op_service.Value = serviceType;
            cb02Adapter.Fill(dt_cb02);

            /////循环处理套餐明细
            foreach (DataRow dr in dt_cb02.Rows)
            {               ///如果套餐明细项目不存在!
                if (!FireAction.ItemIsExisted(ac01.AC001, dr["CB022"].ToString(), dr["CB021"].ToString()))
                {
                    SA01 sa01 = new SA01(unitOfWork1);
                    sa01.SA001  = MiscAction.GetEntityPK("SA01");
                    sa01.AC001  = ac01.AC001;
                    sa01.SA002  = dr["CB022"].ToString();                      //类型
                    sa01.SA003  = FireAction.GetItemName(dr["CB021"].ToString());
                    sa01.SA004  = dr["CB021"].ToString();
                    sa01.SA005  = "0";
                    sa01.PRICE  = FireAction.GetItemPrice(dr["CB021"].ToString());
                    sa01.NUMS   = Convert.ToInt32(dr["CB030"]);
                    sa01.SA007  = sa01.PRICE * sa01.NUMS;
                    sa01.SA006  = sa01.PRICE;
                    sa01.SA008  = "0";
                    sa01.SA100  = Envior.cur_user.UC001;
                    sa01.SA200  = MiscAction.GetServerTime();
                    sa01.STATUS = "1";
                }
            }
        }
コード例 #2
0
        private void Frm_RegOut_Load(object sender, EventArgs e)
        {
            s_rc001 = this.swapdata["rc001"].ToString();
            RC01 rc01 = unitOfWork1.GetObjectByKey <RC01>(s_rc001);

            if (rc01 != null)
            {
                txtEdit_rc001.Text      = rc01.RC001;
                txtEdit_rc109.Text      = rc01.RC109;                        //寄存证号
                be_position.Text        = RegAction.GetRegPosition(s_rc001); //寄存位置
                txtEdit_rc003.Text      = rc01.RC003;
                txtEdit_rc303.EditValue = rc01.RC303;
                rg_rc002.EditValue      = rc01.RC002;
                rg_rc202.EditValue      = rc01.RC202;
                txtEdit_rc004.EditValue = rc01.RC004;
                txtEdit_rc404.EditValue = rc01.RC404;
                //寄存号位单价
                price = RegAction.GetRegPrice(s_rc001);
                txtEdit_price.EditValue = price;
                txtEdit_rc150.EditValue = rc01.RC150;                      //寄存到期时间

                int diff    = RegAction.CalcOutDiffDays(s_rc001);
                int compare = string.Compare(rc01.RC150.ToString("yyyyMMdd"), MiscAction.GetServerTime().ToString("yyyyMMdd"));
                if (compare == 0)
                {
                    checkEdit1.Enabled   = false;
                    txtEdit_nums.Enabled = false;
                }
                else if (compare > 0)                  //退费
                {
                    lc_1.Text = "剩余天数";
                    lc_2.Text = "应退费月数";
                    lc_3.Text = "退费金额";
                    isrefund  = true;

                    //txtEdit_nums.EditValue = Math.Round((diff * 1.0f) / 30, 0);
                    //txtEdit_fee.EditValue = Convert.ToDecimal(Math.Round((diff * 1.0f) / 30, 0)) * price;
                    txtEdit_nums.EditValue = 0;
                    txtEdit_fee.EditValue  = 0;
                }
                else
                {
                    lc_1.Text = "过期天数";
                    lc_2.Text = "应补费月数";
                    lc_3.Text = "补费金额";

                    txtEdit_nums.EditValue = Math.Round((diff * 1.0f) / 30, 0);
                    txtEdit_fee.EditValue  = Convert.ToDecimal(Math.Round((diff * 1.0f) / 30, 0)) * price;
                }
                txtEdit_diff.EditValue = diff;
            }
            else
            {
                sb_ok.Enabled = false;
                XtraMessageBox.Show("数据未找到!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
ファイル: Frm_BaseService.cs プロジェクト: radtek/Lime
 /// <summary>
 /// 选择告别厅
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void glookup_gbt_EditValueChanged(object sender, EventArgs e)
 {
     if (glookup_gbt.EditValue != null)
     {
         de_gbsj.EditValue = MiscAction.GetServerTime();
     }
     else
     {
         de_gbsj.EditValue = null;
     }
 }
コード例 #4
0
ファイル: Frm_FireCheckin.cs プロジェクト: radtek/Lime
 /// <summary>
 /// 到达日期编辑校验
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dateEdit_ac020_Validating(object sender, CancelEventArgs e)
 {
     if (dateEdit_ac020.EditValue == null)
     {
         return;
     }
     if (DateTime.Compare((DateTime)dateEdit_ac020.EditValue, MiscAction.GetServerTime()) > 0)
     {
         dateEdit_ac020.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
         dateEdit_ac020.ErrorText = "到达时间不能大于系统当前时间!";
         e.Cancel = true;
     }
 }
コード例 #5
0
 private void Frm_Duration_Load(object sender, EventArgs e)
 {
     s_mode = this.swapdata["MODE"].ToString();
     if (string.IsNullOrEmpty(s_mode) || s_mode == "1")
     {
         dateEdit2.EditValue = MiscAction.GetServerTime();
         dateEdit1.EditValue = dateEdit2.EditValue;
     }
     else
     {
         dateEdit2.EditValue = MiscAction.GetServerTime();
         dateEdit1.EditValue = MiscAction.GetServerTime().AddMonths(-1);
     }
 }
コード例 #6
0
        private void Frm_Checkout_Load(object sender, EventArgs e)
        {
            dateEdit2.EditValue = MiscAction.GetServerTime();
            dateEdit1.EditValue = MiscAction.GetServerTime().AddMonths(-1);

            ac007Adapter.Fill(dt_ac007_source);
            DataRow newrow = dt_ac007_source.NewRow();

            newrow["ST001"] = "%";
            newrow["ST003"] = "全部";
            dt_ac007_source.Rows.Add(newrow);

            lookUp_ac007.Properties.DataSource    = dt_ac007_source;
            lookUp_ac007.Properties.DisplayMember = "ST003";
            lookUp_ac007.Properties.ValueMember   = "ST001";
            lookUp_ac007.EditValue = "%";
        }
コード例 #7
0
ファイル: Frm_MiscItem.cs プロジェクト: radtek/Lime
        private void sb_ok_Click(object sender, EventArgs e)
        {
            if (!gridView1.PostEditor())
            {
                return;
            }
            if (!gridView1.UpdateCurrentRow())
            {
                return;
            }
            if (!gridView4.PostEditor())
            {
                return;
            }
            if (!gridView4.UpdateCurrentRow())
            {
                return;
            }

            int[] service_sel = gridView1.GetSelectedRows();
            int[] gl_sel      = gridView2.GetSelectedRows();
            int[] zl_sel      = gridView3.GetSelectedRows();
            int[] jp_sel      = gridView4.GetSelectedRows();
            if (service_sel.Length + gl_sel.Length + zl_sel.Length + jp_sel.Length <= 0)
            {
                XtraMessageBox.Show("请先选择项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            //延申服务处理
            foreach (int i in service_sel)
            {
                if (FireAction.ItemIsExisted(s_ac001, "05", gridView1.GetRowCellValue(i, "ITEM_ID").ToString()))
                {
                    if (XtraMessageBox.Show("【" + gridView1.GetRowCellValue(i, "ITEM_TEXT").ToString() + "】已经存在,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.SA001  = MiscAction.GetEntityPK("SA01");
                sa01.AC001  = s_ac001;
                sa01.SA002  = "05";                 //殡仪服务
                sa01.SA003  = gridView1.GetRowCellValue(i, "ITEM_TEXT").ToString();
                sa01.SA004  = gridView1.GetRowCellValue(i, "ITEM_ID").ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(gridView1.GetRowCellValue(i, "PRICE"));
                sa01.NUMS   = Convert.ToInt32(gridView1.GetRowCellValue(i, "NUMS"));
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
            }

            //谷类处理
            foreach (int i in gl_sel)
            {
                if (FireAction.ItemIsExisted(s_ac001, "10", gridView2.GetRowCellValue(i, "ITEM_ID").ToString()))
                {
                    if (XtraMessageBox.Show("【" + gridView2.GetRowCellValue(i, "ITEM_TEXT").ToString() + "】已经存在,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.SA001  = MiscAction.GetEntityPK("SA01");
                sa01.AC001  = s_ac001;
                sa01.SA002  = "10";                 //谷类
                sa01.SA003  = gridView2.GetRowCellValue(i, "ITEM_TEXT").ToString();
                sa01.SA004  = gridView2.GetRowCellValue(i, "ITEM_ID").ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(gridView2.GetRowCellValue(i, "PRICE"));
                sa01.NUMS   = Convert.ToInt32(gridView2.GetRowCellValue(i, "NUMS"));
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
            }

            //纸类处理
            foreach (int i in zl_sel)
            {
                if (FireAction.ItemIsExisted(s_ac001, "10", gridView3.GetRowCellValue(i, "ITEM_ID").ToString()))
                {
                    if (XtraMessageBox.Show("【" + gridView3.GetRowCellValue(i, "ITEM_TEXT").ToString() + "】已经存在,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.SA001  = MiscAction.GetEntityPK("SA01");
                sa01.AC001  = s_ac001;
                sa01.SA002  = "11";                 //纸类
                sa01.SA003  = gridView3.GetRowCellValue(i, "ITEM_TEXT").ToString();
                sa01.SA004  = gridView3.GetRowCellValue(i, "ITEM_ID").ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(gridView3.GetRowCellValue(i, "PRICE"));
                sa01.NUMS   = Convert.ToInt32(gridView3.GetRowCellValue(i, "NUMS"));
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
            }

            //祭品处理
            foreach (int i in jp_sel)
            {
                if (FireAction.ItemIsExisted(s_ac001, "12", gridView4.GetRowCellValue(i, "ITEM_ID").ToString()))
                {
                    if (XtraMessageBox.Show("【" + gridView4.GetRowCellValue(i, "ITEM_TEXT").ToString() + "】已经存在,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.SA001  = MiscAction.GetEntityPK("SA01");
                sa01.AC001  = s_ac001;
                sa01.SA002  = "12";                 //祭品
                sa01.SA003  = gridView4.GetRowCellValue(i, "ITEM_TEXT").ToString();
                sa01.SA004  = gridView4.GetRowCellValue(i, "ITEM_ID").ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(gridView4.GetRowCellValue(i, "PRICE"));
                sa01.NUMS   = Convert.ToInt32(gridView4.GetRowCellValue(i, "NUMS"));
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
            }

            try
            {
                unitOfWork1.CommitChanges();
                XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ee)
            {
                unitOfWork1.RollbackTransaction();
                LogUtils.Error(ee.Message);
                XtraMessageBox.Show(ee.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #8
0
 private void Frm_ReportOut_Load(object sender, EventArgs e)
 {
     dateEdit2.EditValue = MiscAction.GetServerTime();
     dateEdit1.EditValue = MiscAction.GetServerTime().AddMonths(-1);
 }
コード例 #9
0
ファイル: TempSales.cs プロジェクト: radtek/Lime
        /// <summary>
        /// 结算
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.RowCount <= 0)
            {
                XtraMessageBox.Show("请先选择项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrEmpty(be_cuname.Text))
            {
                be_cuname.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                be_cuname.ErrorText = "交款人或单位必须输入!";
                return;
            }
            //if (string.IsNullOrEmpty(te_billno.Text))
            //{
            //	XtraMessageBox.Show("尚未输入单据号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            //	return;
            //}


            //1.检查是否有单价为0的项目
            for (int i = 0; i < gridView1.RowCount; i++)
            {
                if (gridView1.GetRowCellValue(i, "PRICE") != null && Convert.ToDecimal(gridView1.GetRowCellValue(i, "PRICE")) <= 0)
                {
                    gridView1.FocusedRowHandle = i;
                    XtraMessageBox.Show("项目单价尚未设置!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
            SA01    sa01     = null;
            string  s_fa001  = MiscAction.GetEntityPK("FA01");
            string  s_cuname = be_cuname.Text;
            string  s_billno = te_billno.Text;
            decimal dec_sum  = decimal.Zero;

            for (int i = 0; i < gridView1.RowCount; i++)
            {
                sa01       = xpCollection1[gridView1.GetDataSourceRowIndex(i)] as SA01;
                sa01.SA010 = s_fa001;
                sa01.SA008 = "1";
                dec_sum   += sa01.SA007;
            }

            FA01 fa01 = new FA01(unitOfWork1);

            fa01.FA001  = s_fa001;
            fa01.FA002  = "1";                  //交费类型 1-临时性销售
            fa01.FA003  = s_cuname;             //交款人
            fa01.FA004  = dec_sum;
            fa01.FA100  = Envior.cur_user.UC001;
            fa01.FA200  = MiscAction.GetServerTime();
            fa01.WS001  = Envior.workstationId;
            fa01.FA099  = s_billno;
            fa01.STATUS = "1";
            try
            {
                unitOfWork1.CommitChanges();
                XtraMessageBox.Show("办理成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (XtraMessageBox.Show("现在打印【收据】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    PrintAction.Print_Skpz0(s_fa001);
                }

                be_cuname.Text = "";
                te_billno.Text = "";

                CriteriaOperator criteria = CriteriaOperator.Parse("1<0");
                xpCollection1.Criteria = criteria;
                xpCollection1.Criteria = null;

                be_cuname.Focus();
            }
            catch (Exception ee)
            {
                unitOfWork1.RollbackTransaction();
                LogUtils.Error(ee.Message);
                XtraMessageBox.Show(ee.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #10
0
ファイル: Frm_FireCheckin.cs プロジェクト: radtek/Lime
        private void Frm_FireCheckin_Load(object sender, EventArgs e)
        {
            //检索数据字典
            st01_adapter.Fill(dt_st01);
            //创建数据视图
            dv_reason           = new DataView(dt_st01);
            dv_reason.RowFilter = "ST002 = 'DIEREASON'";

            ///死因
            lookUp_ac005.Properties.DataSource    = dv_reason;
            lookUp_ac005.Properties.ValueMember   = "ST003";
            lookUp_ac005.Properties.DisplayMember = "ST003";
            dv_reason.Sort = "SORTID ASC";

            dv_ash_handle           = new DataView(dt_st01);
            dv_ash_handle.RowFilter = "ST002 = 'ASHHANDLE' ";

            //骨灰处理方式
            lookUp_ac006.Properties.DataSource    = dv_ash_handle;
            lookUp_ac006.Properties.ValueMember   = "ST001";
            lookUp_ac006.Properties.DisplayMember = "ST003";

            //乡镇区县
            dv_district           = new DataView(dt_st01);
            dv_district.RowFilter = "ST002='DISTRICT' ";

            lookUp_ac007.Properties.DataSource    = dv_district;
            lookUp_ac007.Properties.ValueMember   = "ST001";
            lookUp_ac007.Properties.DisplayMember = "ST003";

            //与逝者关系
            dv_relation           = new DataView(dt_st01);
            dv_relation.RowFilter = "ST002='RELATION' ";

            lookUp_ac052.Properties.DataSource    = dv_relation;
            lookUp_ac052.Properties.ValueMember   = "ST003";
            lookUp_ac052.Properties.DisplayMember = "ST003";

            /////////////////// 检索 是否有对象传入 ///////////////////////
            if (this.swapdata.ContainsKey("ac001"))               //编辑模式
            {
                s_ac001 = this.swapdata["ac001"].ToString();
                ac01    = unitOfWork1.GetObjectByKey <AC01>(s_ac001);
                txtEdit_ac003.EditValue  = ac01.AC003;
                rg_ac002.EditValue       = ac01.AC002;
                txtEdit_ac004.EditValue  = ac01.AC004;
                txtedit_ac014.EditValue  = ac01.AC014;
                txtEdit_ac009.EditValue  = ac01.AC009;                          //接灵地点
                dateEdit_ac010.EditValue = ac01.AC010;                          //死亡时间
                lookUp_ac005.EditValue   = ac01.AC005;                          //死因
                lookUp_ac006.EditValue   = ac01.AC006;                          //骨灰处理方式
                lookUp_ac007.EditValue   = ac01.AC007;                          //乡镇区县
                lookUp_ac052.EditValue   = ac01.AC052;                          //与逝者关系
                txtEdit_ac050.EditValue  = ac01.AC050;                          //联系人
                txtEdit_ac051.EditValue  = ac01.AC051;                          //联系电话
                txtEdit_ac055.EditValue  = ac01.AC055;                          //联系地址
                dateEdit_ac020.EditValue = ac01.AC020;                          //到达时间
                mem_ac099.EditValue      = ac01.AC099;                          //备注

                sb_clear.Enabled = false;
                b_new            = false;
            }
            else                                                 //新建模式
            {
                ac01                     = new AC01(unitOfWork1);
                s_ac001                  = ac01.AC001 = MiscAction.GetEntityPK("AC01");
                ac01.STATUS              = "1";
                rg_ac002.EditValue       = "0";                                   //性别 默认 男
                ac01.AC020               = MiscAction.GetServerTime();            //到达时间
                ac01.AC200               = ac01.AC020;                            //经办日期
                ac01.AC100               = Envior.cur_user.UC001;                 //经办人
                ac01.AC110               = ac01.AC100;                            //最后经办人
                ac01.AC220               = ac01.AC200;
                ac01.AC020               = MiscAction.GetServerTime();            //到达时间
                dateEdit_ac020.EditValue = ac01.AC020;
            }
        }
コード例 #11
0
ファイル: Frm_Register.cs プロジェクト: radtek/Lime
        private void sb_ok_Click(object sender, EventArgs e)
        {
            if (!gridView1.PostEditor())
            {
                return;
            }
            if (!gridView1.UpdateCurrentRow())
            {
                return;
            }
            if (!SaveCheck())
            {
                return;                            //数据合法性校验!!!
            }
            string s_billno = string.Empty;

            //0.再次判断寄存号位 是否占用
            if (RegAction.GetBitStatus(regionId, i_bi005, bitDesc) != "9")
            {
                XtraMessageBox.Show("当前号位无效或已被占用!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            //1.生成寄存记录
            int i_months = Convert.ToInt32(comboBox1.Text);

            rc01 = new RC01(unitOfWork1);
            if (s_source == "1" /*外来寄存*/)
            {
                rc01.RC001 = MiscAction.GetEntityPK("RC01");
            }
            else if (s_source == "0" || s_source == "8")
            {
                rc01.RC001 = txtEdit_rc001.Text;
            }

            rc01.RC002 = rg_rc002.EditValue.ToString();              //逝者性别
            rc01.RC202 = rg_rc202.EditValue.ToString();              //逝者性别2
            rc01.RC003 = txtEdit_rc003.Text;                         //逝者姓名
            rc01.RC303 = txtEdit_rc303.Text;                         //逝者姓名2
            rc01.RC004 = Convert.ToInt32(txtEdit_rc004.EditValue);   //逝者年龄
            rc01.RC404 = txtEdit_rc404.EditValue == null ? 0 : Convert.ToInt32(txtEdit_rc404.EditValue);
            rc01.RC014 = txtedit_rc014.Text;                         //身份证号
            rc01.RC050 = txtEdit_rc050.Text;                         //联系人
            rc01.RC051 = txtEdit_rc051.Text;                         //联系电话
            rc01.RC052 = lookUp_rc052.EditValue.ToString();          //与逝者关系
            rc01.RC055 = txtEdit_ac055.Text;                         //联系地址
            rc01.RC099 = mem_rc099.Text;                             //备注
            rc01.RC109 = RegAction.GenRegisterNo(s_source == "2" ? "1" : "0");

            if (s_source == "0" || s_source == "8")
            {
                rc01.SOURCE = "0";                                       //本馆火化
            }
            else if (s_source == "1")
            {
                rc01.SOURCE = "1";
            }

            //状态
            if (s_source == "8")
            {
                rc01.STATUS = "8";
            }
            else
            {
                rc01.STATUS = "1";
            }

            rc01.RC110 = RegAction.GetRoomIdByBitId(bitId);               //寄存室编号
            rc01.RC120 = regionId;                                        //寄存架号
            rc01.RC130 = bitId;                                           //寄存号位
            rc01.RC140 = MiscAction.GetServerTime();                      //寄存日期
            rc01.RC150 = rc01.RC140.AddMonths(i_months);                  //寄存到期日期
            rc01.RC100 = Envior.cur_user.UC001;                           //经办人
            rc01.RC200 = MiscAction.GetServerTime();


            ///2.寄存费缴费记录表
            string s_fa001 = MiscAction.GetEntityPK("FA01");

            if (s_source == "0" || s_source == "1")              //本馆火化 或外来寄存
            {
                RC04 rc04 = new RC04(unitOfWork1);
                rc04.RC001  = rc01.RC001;
                rc04.RC010  = s_fa001;                                      //结算流水号
                rc04.RC020  = MiscAction.GetServerTime();                   //缴费开始时间
                rc04.RC022  = rc01.RC150;                                   //缴费截至时间
                rc04.PRICE  = bitPrice;                                     //单价
                rc04.NUMS   = Convert.ToInt32(comboBox1.Text);              //缴费期限
                rc04.RC030  = rc04.PRICE * rc04.NUMS;                       //寄存费金额
                rc04.RC031  = "1";                                          //0-原始登记 1-正常交费
                rc04.RC100  = Envior.cur_user.UC001;                        //经办人
                rc04.RC200  = MiscAction.GetServerTime();
                rc04.STATUS = "1";
            }

            ///3.插入销售表
            SA01 sa01 = new SA01(unitOfWork1);

            sa01.SA001  = MiscAction.GetEntityPK("SA01");
            sa01.SA002  = "08";                    //项目类别 08-寄存费
            sa01.AC001  = rc01.RC001;              //逝者编号
            sa01.SA003  = "寄存费";
            sa01.SA004  = bitId;
            sa01.SA005  = "2";                     //销售业务类型 2-骨灰寄存
            sa01.PRICE  = bitPrice;
            sa01.NUMS   = Convert.ToInt32(comboBox1.Text);
            sa01.SA007  = sa01.PRICE * sa01.NUMS;
            sa01.SA006  = bitPrice;
            sa01.SA008  = s_source == "8" ? "0" : "1";
            sa01.SA010  = s_source == "8" ? "" : s_fa001;
            sa01.SA100  = Envior.cur_user.UC001;                    //经办人
            sa01.SA200  = MiscAction.GetServerTime();
            sa01.STATUS = "1";

            ///4.处理附件销售.
            foreach (SA01 s in xpCollection_sa01)
            {
                s.SA001  = MiscAction.GetEntityPK("SA01");
                s.SA002  = "13";
                s.AC001  = rc01.RC001;
                s.SA003  = FireAction.Mapper_Item(s.SA004);
                s.SA005  = "2";                                              // 销售类别 0 - 火化业务 1 - 临时性销售 2骨灰寄存
                s.SA008  = s_source == "8" ? "0" : "1";
                s.SA010  = s_source == "8" ? "" : s_fa001;
                s.SA100  = Envior.cur_user.UC001;                        //经办人
                s.SA200  = MiscAction.GetServerTime();
                s.STATUS = "1";
            }

            ////5. 处理财务结算表
            if (s_source == "0" || s_source == "1")
            {
                FA01 fa01 = new FA01(unitOfWork1);
                fa01.FA001  = s_fa001;
                fa01.FA002  = "2";                            //收费业务类型 2-寄存
                fa01.FA003  = rc01.RC003;
                fa01.FA004  = regfee + fpfee;
                fa01.FA100  = Envior.cur_user.UC001;
                fa01.FA200  = MiscAction.GetServerTime();
                fa01.FA099  = s_billno;
                fa01.WS001  = Envior.workstationId;
                fa01.AC001  = rc01.RC001;
                fa01.STATUS = "1";
            }
            ////6. 处理号位表
            BI01 bi01 = unitOfWork1.GetObjectByKey <BI01>(bitId);

            bi01.BI010 = rc01.RC001;
            if (s_source == "0" || s_source == "1")
            {
                bi01.STATUS = "1";
            }
            else if (s_source == "8")
            {
                bi01.STATUS = "8";
            }

            try
            {
                unitOfWork1.CommitChanges();
                string s_tip = string.Empty;
                if (s_source == "0" || s_source == "1")
                {
                    s_tip = "办理成功,现在打印【收据】";
                }
                else
                {
                    s_tip = "办理成功!";
                }

                XtraMessageBox.Show(s_tip, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ////打印收据
                if (s_source == "0" || s_source == "1")
                {
                    //Frm_InputBill frm_bill = new Frm_InputBill();
                    //if (frm_bill.ShowDialog() == DialogResult.OK)
                    //{
                    //	s_billno = frm_bill.swapdata["billno"].ToString();
                    //}
                    //frm_bill.Dispose();
                    //if (!string.IsNullOrEmpty(s_billno))
                    //{
                    PrintAction.Print_Skpz1(s_fa001);
                    //MiscAction.SetFinanceBill(s_fa001, s_billno);
                    //}
                }

                ////todo 2.打印寄存证
                if (s_source == "0" || s_source == "1" || s_source == "2")
                {
                    XtraMessageBox.Show("现在准备打印【寄存证】!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    PrintAction.Print_RegCardBase(rc01.RC001);
                }
                if (XtraMessageBox.Show("现在打印【骨灰安放卡】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    PrintAction.Print_RegSettle(rc01.RC001);
                }

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ee)
            {
                unitOfWork1.RollbackTransaction();
                LogUtils.Error(ee.Message);
                XtraMessageBox.Show(ee.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #12
0
        private void sb_ok_Click(object sender, EventArgs e)
        {
            string  s_sa001 = string.Empty;
            SA01    sa01    = null;
            FA01    fa01    = null;
            string  s_fa099 = string.Empty;
            decimal dec_sum = decimal.Zero;

            //if (string.IsNullOrEmpty(te_fa099.Text))
            //{
            //	te_fa099.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
            //	te_fa099.ErrorText = "请输入收费单据号!";
            //	te_fa099.Focus();
            //	return;
            //}

            try
            {
                string s_fa001 = MiscAction.GetEntityPK("FA01");
                for (int i = 0; i < gridView1.RowCount; i++)
                {
                    sa01 = xpCollection1[gridView1.GetDataSourceRowIndex(i)] as SA01;
                    if (FireAction.SalesItemIsSettled(sa01.SA001))
                    {
                        throw new Exception("第" + (i + 1).ToString() + "行数据已经结算,请重新选择结算数据!");
                    }
                    sa01.SA008 = "1";                           //结算标志
                    sa01.SA010 = s_fa001;                       //结算流水号

                    dec_sum += sa01.SA007;
                }

                fa01        = new FA01(session);
                fa01.FA001  = s_fa001;                      //结算流水号
                fa01.FA002  = "0";                          //收费类型 0-火化业务
                fa01.FA003  = ac01.AC003;                   //交款人
                fa01.AC001  = ac01.AC001;                   //逝者编号
                fa01.FA004  = dec_sum;                      //交费金额
                fa01.FA099  = te_fa099.Text;                //单据流水号
                fa01.FA100  = Envior.cur_user.UC001;        //经办人
                fa01.FA200  = MiscAction.GetServerTime();   //经办日期
                fa01.WS001  = Envior.workstationId;         //工作站ID
                fa01.STATUS = "1";

                ///检查是否有寄存办理
                int i_find = gridView1.LocateByValue("SA002", "08");
                if (i_find >= 0)
                {
                    string s_bi001 = gridView1.GetRowCellValue(i_find, "SA004").ToString();
                    BI01   bi01    = session.GetObjectByKey <BI01>(s_bi001);
                    if (bi01 == null)
                    {
                        throw new Exception("找不到寄存号位!");
                    }

                    bi01.STATUS = "1";

                    RC01 rc01 = session.GetObjectByKey <RC01>(gridView1.GetRowCellValue(i_find, "AC001").ToString());
                    if (rc01 == null)
                    {
                        throw new Exception("找不到寄存登记记录!");
                    }

                    rc01.STATUS = "1";

                    ////增加寄存费缴纳记录
                    RC04 rc04 = new RC04(session);
                    rc04.RC001  = rc01.RC001;
                    rc04.RC010  = s_fa001;
                    rc04.RC020  = rc01.RC140;                      //寄存日期
                    rc04.RC022  = rc01.RC150;                      //寄存截至日期
                    rc04.PRICE  = Convert.ToDecimal(gridView1.GetRowCellValue(i_find, "PRICE"));
                    rc04.NUMS   = Convert.ToInt32(gridView1.GetRowCellValue(i_find, "NUMS"));
                    rc04.RC030  = Convert.ToDecimal(gridView1.GetRowCellValue(i_find, "SA007"));
                    rc04.RC031  = "1";                             //寄存费缴纳类型 1-正常缴费
                    rc04.RC100  = Envior.cur_user.UC001;
                    rc04.RC200  = MiscAction.GetServerTime();
                    rc04.STATUS = "1";
                }

                session.CommitChanges();
                XtraMessageBox.Show("结算办理成功!现在开始打印单据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);


                PrintAction.Print_Skpz0(s_fa001);
                if (gridView1.LocateByValue("SA002", "06") >= 0)
                {
                    if (XtraMessageBox.Show("现在打印【火化证明】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        PrintAction.Print_HHZM(ac01.AC001);
                    }
                }
                if (gridView1.LocateByValue("SA002", "08") >= 0)
                {
                    if (XtraMessageBox.Show("现在打印【寄存证】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        PrintAction.Print_RegCardBase(ac01.AC001);
                    }
                    if (XtraMessageBox.Show("现在打印【骨灰安放卡】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        PrintAction.Print_RegSettle(ac01.AC001);
                    }
                }

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ee)
            {
                session.RollbackTransaction();
                LogUtils.Error(ee.Message);
                XtraMessageBox.Show(ee.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #13
0
ファイル: Frm_BaseService.cs プロジェクト: radtek/Lime
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void sb_ok_Click(object sender, EventArgs e)
        {
            bool b_done = false;

            if (FireAction.FireIsSettled(ac01.AC001))
            {
                XtraMessageBox.Show("该逝者已经办理火化并且结算,不能再办理业务!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            ///判断 守灵 冷藏 是否同时选择
            if (!string.IsNullOrEmpty(glookup_slt.EditValue.ToString()) && Convert.ToDecimal(te_slt_nums.Text) > 0 && !string.IsNullOrEmpty(glookup_lcg.EditValue.ToString()) && Convert.ToDecimal(sp_lcg_nums.Text) > 0)
            {
                if (XtraMessageBox.Show("确认要同时选择【守灵】和【冷藏】业务吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }
            }

            if (!string.IsNullOrEmpty(glookup_slt.EditValue.ToString()) && Convert.ToDecimal(te_slt_nums.Text) > 0)
            {
                if (FireAction.ItemIsExisted(ac01.AC001, "01", ""))
                {
                    if (XtraMessageBox.Show("【守灵】已经办理,是否继续?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
            }
            if (!string.IsNullOrEmpty(glookup_lcg.EditValue.ToString()) && Convert.ToDecimal(sp_lcg_nums.Text) > 0)
            {
                if (FireAction.ItemIsExisted(ac01.AC001, "02", ""))
                {
                    if (XtraMessageBox.Show("【冷藏】已经办理,是否继续?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
            }

            if (!string.IsNullOrEmpty(glookup_gbt.EditValue.ToString()) && de_gbsj.EditValue != null)
            {
                if (FireAction.ItemIsExisted(ac01.AC001, "04", ""))
                {
                    XtraMessageBox.Show("【告别】已经办理!", "确认", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
            }

            if (!string.IsNullOrEmpty(glookup_lc.EditValue.ToString()))
            {
                if (FireAction.ItemIsExisted(ac01.AC001, "07", ""))
                {
                    XtraMessageBox.Show("【灵车】已经办理!", "确认", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
            }
            ////////////////////////  业务办理 ///////////////////////
            /// 01 如果守灵厅
            if (!string.IsNullOrEmpty(glookup_slt.EditValue.ToString()) && Convert.ToDecimal(te_slt_nums.Text) > 0)
            {
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.SA001 = MiscAction.GetEntityPK("SA01");
                sa01.AC001 = ac01.AC001;
                sa01.SA002 = "01";                  //守灵厅
                GridView view = glookup_slt.Properties.View;
                sa01.SA003  = "守灵厅" + "【" + view.GetRowCellValue(view.FocusedRowHandle, "SI003") + "】";
                sa01.SA004  = glookup_slt.EditValue.ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(view.GetRowCellValue(view.FocusedRowHandle, "PRICE"));
                sa01.NUMS   = Convert.ToDecimal(te_slt_nums.Text);
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                ApplyCombo("01");
                b_done = true;
                //sa01.Save();
            }
            /// 02 如果冷藏柜
            if (!string.IsNullOrEmpty(glookup_lcg.EditValue.ToString()) && Convert.ToDecimal(sp_lcg_nums.Text) > 0)
            {
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.SA001 = MiscAction.GetEntityPK("SA01");
                sa01.AC001 = ac01.AC001;
                sa01.SA002 = "02";                  //冷藏柜
                GridView view = glookup_lcg.Properties.View;
                sa01.SA003  = "冷藏" + "【" + view.GetRowCellValue(view.FocusedRowHandle, "SI003") + "】";
                sa01.SA004  = glookup_lcg.EditValue.ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(view.GetRowCellValue(view.FocusedRowHandle, "PRICE"));
                sa01.NUMS   = Convert.ToDecimal(te_slt_nums.Text);
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                ApplyCombo("02");
                b_done = true;
                //sa01.Save();
            }
            ///03 休息室
            foreach (int i in gridView2.GetSelectedRows())
            {
                if (FireAction.ItemIsExisted(ac01.AC001, "03", gridView2.GetRowCellValue(i, "SI001").ToString()))
                {
                    throw new Exception("【" + gridView2.GetRowCellValue(i, "SI003").ToString() + "】" + "已经存在!");
                }
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.AC001  = ac01.AC001;
                sa01.SA001  = MiscAction.GetEntityPK("SA01");
                sa01.SA002  = "03";                 //休息室
                sa01.SA003  = "休息室" + "【" + gridView2.GetRowCellValue(i, "SI003") + "】";
                sa01.SA004  = gridView2.GetRowCellValue(i, "SI001").ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(gridView2.GetRowCellValue(i, "PRICE"));
                sa01.NUMS   = 1;
                sa01.SA007  = sa01.PRICE;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                ApplyCombo("03");
                b_done = true;
                //sa01.Save();
            }

            ///04 告别厅
            if (!string.IsNullOrEmpty(glookup_gbt.EditValue.ToString()) && de_gbsj.EditValue != null)
            {
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.SA001 = MiscAction.GetEntityPK("SA01");
                sa01.AC001 = ac01.AC001;
                sa01.SA002 = "04";                  //告别厅
                GridView view = glookup_gbt.Properties.View;
                sa01.SA003  = "告别厅" + "【" + view.GetRowCellValue(view.FocusedRowHandle, "SI003") + "】";
                sa01.SA004  = glookup_gbt.EditValue.ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(view.GetRowCellValue(view.FocusedRowHandle, "PRICE"));
                sa01.NUMS   = 1;
                sa01.SA007  = sa01.PRICE;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                ApplyCombo("04");
                ac01.AC018 = Convert.ToDateTime(de_gbsj.EditValue);                  //告别时间
                b_done     = true;
            }

            ///07 灵车
            if (!string.IsNullOrEmpty(glookup_lc.EditValue.ToString()))
            {
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.SA001 = MiscAction.GetEntityPK("SA01");
                sa01.AC001 = ac01.AC001;
                sa01.SA002 = "07";                  //灵车
                GridView view = glookup_lc.Properties.View;
                sa01.SA003  = "灵车" + "【" + view.GetRowCellDisplayText(view.FocusedRowHandle, "SI003") + "】";
                sa01.SA004  = glookup_lc.EditValue.ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(view.GetRowCellValue(view.FocusedRowHandle, "PRICE"));
                sa01.NUMS   = 1;
                sa01.SA007  = sa01.PRICE;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                ApplyCombo("07");
                b_done = true;
                //sa01.Save();
            }

            ///06 火化
            if (!string.IsNullOrEmpty(glookup_hh.EditValue.ToString()) && de_hhsj.EditValue != null)
            {
                SA01 sa01 = new SA01(unitOfWork1);
                sa01.SA001 = MiscAction.GetEntityPK("SA01");
                sa01.AC001 = ac01.AC001;
                sa01.SA002 = "06";                  //火化
                GridView view = glookup_hh.Properties.View;
                sa01.SA003  = "火化" + "【" + view.GetRowCellValue(view.FocusedRowHandle, "SI003") + "】";
                sa01.SA004  = glookup_hh.EditValue.ToString();
                sa01.SA005  = "0";
                sa01.PRICE  = Convert.ToDecimal(view.GetRowCellValue(view.FocusedRowHandle, "PRICE"));
                sa01.NUMS   = 1;
                sa01.SA007  = sa01.PRICE;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                ApplyCombo("06");

                ac01.AC015 = Convert.ToDateTime(de_hhsj.EditValue);                   //火化时间
                b_done     = true;
            }

            if (!b_done)
            {
                XtraMessageBox.Show("还未选择项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }


            try
            {
                unitOfWork1.CommitChanges();
                XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ee)
            {
                unitOfWork1.RollbackTransaction();
                LogUtils.Error(ee.Message);
                XtraMessageBox.Show(ee.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #14
0
        private void sb_ok_Click(object sender, EventArgs e)
        {
            if (!gridView1.PostEditor())
            {
                return;
            }
            if (!gridView1.UpdateCurrentRow())
            {
                return;
            }
            if (!gridView4.PostEditor())
            {
                return;
            }
            if (!gridView4.UpdateCurrentRow())
            {
                return;
            }

            int[] service_sel = gridView1.GetSelectedRows();
            int[] gl_sel      = gridView2.GetSelectedRows();
            int[] zl_sel      = gridView3.GetSelectedRows();
            int[] jp_sel      = gridView4.GetSelectedRows();

            if (service_sel.Length + gl_sel.Length + zl_sel.Length + jp_sel.Length <= 0)
            {
                XtraMessageBox.Show("请先选择项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            //延申服务处理
            foreach (int i in service_sel)
            {
                if (ElementExisted(gridView1.GetRowCellValue(i, "ITEM_ID").ToString()))
                {
                    if (XtraMessageBox.Show("【" + gridView1.GetRowCellValue(i, "ITEM_TEXT").ToString() + "】已经存在,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
                SA01 sa01 = new SA01(collection.Session);
                sa01.SA001  = MiscAction.GetEntityPK("SA01");
                sa01.SA002  = "05";                 //殡仪服务
                sa01.SA003  = gridView1.GetRowCellValue(i, "ITEM_TEXT").ToString();
                sa01.SA004  = gridView1.GetRowCellValue(i, "ITEM_ID").ToString();
                sa01.SA005  = "1";                  //销售类型 - 临时性销售
                sa01.PRICE  = Convert.ToDecimal(gridView1.GetRowCellValue(i, "PRICE"));
                sa01.NUMS   = Convert.ToInt32(gridView1.GetRowCellValue(i, "NUMS"));
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                collection.Add(sa01);
            }

            //谷类处理
            foreach (int i in gl_sel)
            {
                if (ElementExisted(gridView2.GetRowCellValue(i, "ITEM_ID").ToString()))
                {
                    if (XtraMessageBox.Show("【" + gridView2.GetRowCellValue(i, "ITEM_TEXT").ToString() + "】已经存在,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
                SA01 sa01 = new SA01(collection.Session);
                sa01.SA001  = MiscAction.GetEntityPK("SA01");
                sa01.SA002  = "10";                 //谷类
                sa01.SA003  = gridView2.GetRowCellValue(i, "ITEM_TEXT").ToString();
                sa01.SA004  = gridView2.GetRowCellValue(i, "ITEM_ID").ToString();
                sa01.SA005  = "1";                  //销售类型 - 临时性销售
                sa01.PRICE  = Convert.ToDecimal(gridView2.GetRowCellValue(i, "PRICE"));
                sa01.NUMS   = Convert.ToInt32(gridView2.GetRowCellValue(i, "NUMS"));
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                collection.Add(sa01);
            }

            //纸类处理
            foreach (int i in zl_sel)
            {
                if (ElementExisted(gridView3.GetRowCellValue(i, "ITEM_ID").ToString()))
                {
                    if (XtraMessageBox.Show("【" + gridView3.GetRowCellValue(i, "ITEM_TEXT").ToString() + "】已经存在,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
                SA01 sa01 = new SA01(collection.Session);
                sa01.SA001  = MiscAction.GetEntityPK("SA01");
                sa01.SA002  = "11";                 //纸类
                sa01.SA003  = gridView3.GetRowCellValue(i, "ITEM_TEXT").ToString();
                sa01.SA004  = gridView3.GetRowCellValue(i, "ITEM_ID").ToString();
                sa01.SA005  = "1";
                sa01.PRICE  = Convert.ToDecimal(gridView3.GetRowCellValue(i, "PRICE"));
                sa01.NUMS   = Convert.ToInt32(gridView3.GetRowCellValue(i, "NUMS"));
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                collection.Add(sa01);
            }
            //祭品处理
            foreach (int i in jp_sel)
            {
                if (ElementExisted(gridView4.GetRowCellValue(i, "ITEM_ID").ToString()))
                {
                    if (XtraMessageBox.Show("【" + gridView4.GetRowCellValue(i, "ITEM_TEXT").ToString() + "】已经存在,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
                SA01 sa01 = new SA01(collection.Session);
                sa01.SA001  = MiscAction.GetEntityPK("SA01");
                sa01.SA002  = gridView4.GetRowCellValue(i, "ITEM_TYPE").ToString();
                sa01.SA003  = gridView4.GetRowCellValue(i, "ITEM_TEXT").ToString();
                sa01.SA004  = gridView4.GetRowCellValue(i, "ITEM_ID").ToString();
                sa01.SA005  = "1";
                sa01.PRICE  = Convert.ToDecimal(gridView4.GetRowCellValue(i, "PRICE"));
                sa01.NUMS   = Convert.ToInt32(gridView4.GetRowCellValue(i, "NUMS"));
                sa01.SA007  = sa01.PRICE * sa01.NUMS;
                sa01.SA006  = sa01.PRICE;
                sa01.SA008  = "0";
                sa01.SA100  = Envior.cur_user.UC001;
                sa01.SA200  = MiscAction.GetServerTime();
                sa01.STATUS = "1";
                collection.Add(sa01);
            }

            this.Close();
        }