Beispiel #1
0
        private void btn_save(object sender, EventArgs e)
        {
            DevExpress.XtraEditors.SimpleButton simpbtn = (DevExpress.XtraEditors.SimpleButton)sender;
            if (simpbtn.Tag.Equals("Simbtn_save_basic"))
            {
                if (!txt_jdmc.Text.Equals(common_file.common_app.qymc) || !txt_yydh.Text.Equals(common_file.common_app.yydh) || !txt_SoftName.Text.Equals(common_file.common_app.SoftName))
                {
                    common_file.common_app.get_czsj();
                    Model.Xqyxx        qyxx = new Hotel_app.Model.Xqyxx();
                    BLL.Xqyxx          bll  = new Hotel_app.BLL.Xqyxx();
                    List <Model.Xqyxx> list = bll.GetModelList(" id>=0  and  yydh='" + common_file.common_app.yydh + "'");
                    if (list != null && list.Count > 0)
                    {
                        qyxx = list[0];
                        int id = qyxx.id;
                        qyxx.qymc     = txt_jdmc.Text;
                        qyxx.yydh     = txt_yydh.Text;
                        qyxx.Softname = txt_SoftName.Text;
                        qyxx.id       = id;
                        if (bll.Update(qyxx))
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "更新酒店基本信息成功");
                        }
                    }
                }
            }
            if (simpbtn.Tag.Equals("Simbtn_save_zdInfo"))
            {
                if (!cb_jzd.SelectedItem.Equals(jzd_now) || !cb_yjd.SelectedItem.Equals(yjd_now) || !cb_djb.SelectedItem.Equals(djb_now) || !txt_yqsts.Value.Equals(tqts))
                {
                    jzd_now = cb_jzd.Text.Equals("A4") ? "11" : "21";
                    yjd_now = cb_yjd.Text.Equals("A4") ? "11" : "21";
                    djb_now = cb_djb.Text.Equals("A4") ? "11" : "21";

                    BLL.Qcounter          bll     = new Hotel_app.BLL.Qcounter();
                    Model.Qcounter        counter = new Hotel_app.Model.Qcounter();
                    List <Model.Qcounter> list    = bll.GetModelList(" id>=0  and  yydh='" + common_file.common_app.yydh + "'");
                    if (list != null && list.Count > 0)
                    {
                        counter = list[0];
                        int id = counter.ID;
                        counter.printzdpd = int.Parse(jzd_now + yjd_now + djb_now);
                        counter.ID        = id;
                        if (bll.Update(counter))
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "更新成功,你现在可以直接连接打印机打印您设置的账单");
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public static bool hygl_shqr_add(string yydh)
        {
            bool flage_hyrq_add = false;

            BLL.Qcounter          B_qcounter_new = new Hotel_app.BLL.Qcounter();
            List <Model.Qcounter> list           = new List <Hotel_app.Model.Qcounter>();

            list = B_qcounter_new.GetModelList(" id>=0  and  yydh='" + yydh + "'");
            Model.Qcounter M_qcounter = null;
            if (list != null && list.Count >= 1)
            {
                flage_hyrq_add = bool.Parse(list[0].Hhygl_qyqr.ToString());
            }

            return(flage_hyrq_add);
        }
Beispiel #3
0
        public void inital()
        {
            if (this.lsbh.Trim() != "")
            {
                BLL.Qcounter B_Qcounter = new Hotel_app.BLL.Qcounter();
                DataSet      ds_tmp_0   = B_Qcounter.GetList("  id>=0  and yydh='" + common_file.common_app.yydh + "'");
                if (ds_tmp_0 != null && ds_tmp_0.Tables[0].Rows.Count > 0)
                {
                    //2012-11-09  更新后,这个值以经分成三部分
                    //

                    int print_Type_values = int.Parse(ds_tmp_0.Tables[0].Rows[0]["printzdpd"].ToString());
                    if (print_Type_values == 1)
                    {
                        print_Type = "A4";
                    }
                    if (print_Type_values == 2)
                    {
                        print_Type = "A5";
                    }
                    if (print_Type_values == 3)//3设置后,jzd用的是:cr_jzd_a4_yx_withNohead.rpt,yjd用的是:
                    {
                        print_Type = "A4_With_nohead";
                    }
                    if (print_Type_values == 4)
                    {
                        print_Type = "A4_With_head";
                    }
                }
                common_file.common_app.GetPrintInfo(ref qymc, ref qymc_english, ref Address_chinese, ref Address_english, ref qydh, ref qycz, ref qyyb, ref website);

                //打印结账单
                if (zd_type == "jzd")
                {
                    if (jzbh != "")
                    {
                        ds_Temp = B_common.GetList("  select * from Sjzzd  ", "id>=0 and yydh='" + common_file.common_app.yydh + "'  and  jzbh='" + jzbh + "'");
                        if (ds_Temp != null && ds_Temp.Tables[0].Rows.Count > 0)
                        {
                            if (!ds_Temp.Tables[0].Rows[0]["czzt"].ToString().Contains("结账"))
                            {
                                ddsj = ds_Temp.Tables[0].Rows[0]["ddsj"].ToString();
                                lksj = ds_Temp.Tables[0].Rows[0]["tfsj"].ToString();
                                jzsj = ds_Temp.Tables[0].Rows[0]["tfsj"].ToString();
                            }
                            if (ds_Temp.Tables[0].Rows[0]["czzt"].ToString().Contains("结账"))
                            {
                                ddsj   = ds_Temp.Tables[0].Rows[0]["ddsj"].ToString();
                                lksj   = ds_Temp.Tables[0].Rows[0]["tfsj"].ToString();
                                jzsj   = ds_Temp.Tables[0].Rows[0]["czsj"].ToString();
                                czy_dy = ds_Temp.Tables[0].Rows[0]["czy"].ToString();
                            }
                            krxm_lz = ds_Temp.Tables[0].Rows[0]["krxm_lz"].ToString();
                            fjbh_lz = ds_Temp.Tables[0].Rows[0]["fjbh_lz"].ToString();
                        }
                        ds_printData = B_common.GetList(" select  *  from Sjzmx  ", " id>=0  and yydh='" + common_file.common_app.yydh + "'  and  jzbh='" + jzbh + "'  order by xfsj desc ");
                    }
                    //结账前打印
                    if (jzbh.Trim() == "")
                    {
                        GetPrintinfo(ref krxm_lz, ref fjbh_lz, ref ddsj, ref lksj, this.lsbh, common_file.common_app.yydh, sk_tt);
                        //jzsj = "";
                        lksj = DateTime.Now.ToString();
                        jzsj = DateTime.Now.ToString();

                        DataSet ds_0 = B_common.GetList(" select distinct lsbh  from Szw_temp ", "  id>=0 and  czy_temp='" + common_file.common_app.czy + "' ");
                        if (ds_0 != null && ds_0.Tables[0].Rows.Count > 1)
                        {
                            ds_printData = B_common.GetList(" select  * from Szw_temp  ", " id>=0  and  lsbh  in  (select lsbh from  Flfsz  where lfbh in (select lfbh from Flfsz where lsbh='" + lsbh + "'  and  yydh='" + common_file.common_app.yydh + "'   and  shlz=1 ) )  and czy_temp='" + common_file.common_app.czy + "'  order by xfsj  desc ");
                        }
                        else
                        {
                            ds_printData = B_common.GetList(" select * from Szw_temp ", " id>=0  and lsbh='" + lsbh + "'  and czy_temp='" + common_file.common_app.czy + "'  order by xfsj desc ");
                        }
                    }
                    //ds = B_common.GetList("select * from " + TableName, " id>=0  and   yydh='" + common_file.common_app.yydh + "'  and  lsbh  in (select  lsbh from Flfsz  where lfbh  in (select lfbh from Flfsz where lsbh='"+lsbh+"'  and shlz='1' ) )  and  czy='" + common_file.common_app.czy + "'");
                    if (ds_printData != null && ds_printData.Tables[0].Rows.Count > 0)
                    {
                        if (zd_type == "jzd")
                        {
                            if (print_Type == "A4")
                            {
                                cr_jzd_a4 myreport = new cr_jzd_a4();
                                myreport.SetDataSource(ds_printData.Tables[0]);
                                crystalReportViewer1.ReportSource = myreport;
                                myreport.SetParameterValue("qymc", qymc);
                                myreport.SetParameterValue("czy", czy_dy);

                                myreport.SetParameterValue("fkje_total", fk);
                                myreport.SetParameterValue("xfje_total", xf);
                                myreport.SetParameterValue("qymcyw", qymc_english);
                                myreport.SetParameterValue("qydh", qydh);
                                myreport.SetParameterValue("qycz", qycz);
                                myreport.SetParameterValue("qyyb", qyyb);
                                myreport.SetParameterValue("website", website);
                                myreport.SetParameterValue("qydz", Address_chinese);
                                myreport.SetParameterValue("qydzyw", Address_english);
                                myreport.SetParameterValue("krxm_lz", krxm_lz);
                                myreport.SetParameterValue("fjbh_lz", fjbh_lz);
                                myreport.SetParameterValue("ddsj", ddsj);
                                myreport.SetParameterValue("lksj", lksj);
                                myreport.SetParameterValue("jzsj", jzsj);
                                myreport.PrintToPrinter(1, true, 0, 0);
                            }
                            if (print_Type == "A5")
                            {
                                cr_jzd_a5 myreport = new cr_jzd_a5();
                                myreport.SetDataSource(ds_printData.Tables[0]);
                                crystalReportViewer1.ReportSource = myreport;
                                myreport.SetParameterValue("qymc", qymc);
                                myreport.SetParameterValue("czy", czy_dy);

                                myreport.SetParameterValue("fkje_total", fk);
                                myreport.SetParameterValue("xfje_total", xf);
                                myreport.SetParameterValue("qymcyw", qymc_english);
                                myreport.SetParameterValue("qydh", qydh);
                                myreport.SetParameterValue("qycz", qycz);
                                myreport.SetParameterValue("qyyb", qyyb);
                                myreport.SetParameterValue("website", website);
                                myreport.SetParameterValue("qydz", Address_chinese);
                                myreport.SetParameterValue("qydzyw", Address_english);
                                myreport.SetParameterValue("krxm_lz", krxm_lz);
                                myreport.SetParameterValue("fjbh_lz", fjbh_lz);
                                myreport.SetParameterValue("ddsj", ddsj);
                                myreport.SetParameterValue("lksj", lksj);
                                myreport.SetParameterValue("jzsj", jzsj);

                                myreport.PrintToPrinter(1, true, 0, 0);
                            }
                            if (print_Type == "A4_With_head")
                            {
                                //读取表头的图片
                                cr_jzd_a4_yx myreport = new cr_jzd_a4_yx();

                                myreport.SetDataSource(ds_printData.Tables[0]);
                                crystalReportViewer1.ReportSource = myreport;
                                //myreport.SetParameterValue("qymc", qymc);
                                myreport.SetParameterValue("czy", czy_dy);

                                myreport.SetParameterValue("fkje_total", fk);
                                myreport.SetParameterValue("xfje_total", xf);
                                // myreport.SetParameterValue("qymcyw", qymc_english);
                                myreport.SetParameterValue("qydh", qydh);
                                myreport.SetParameterValue("qycz", qycz);
                                myreport.SetParameterValue("qyyb", qyyb);
                                myreport.SetParameterValue("website", website);
                                myreport.SetParameterValue("qydz", Address_chinese);
                                myreport.SetParameterValue("qydzyw", Address_english);
                                myreport.SetParameterValue("krxm_lz", krxm_lz);
                                myreport.SetParameterValue("fjbh_lz", fjbh_lz);
                                myreport.SetParameterValue("ddsj", ddsj);
                                myreport.SetParameterValue("lksj", lksj);
                                myreport.SetParameterValue("jzsj", jzsj);

                                myreport.PrintToPrinter(1, true, 0, 0);
                            }
                            if (print_Type == "A4_With_nohead")
                            {
                                cr_jzd_a4_yx_withNohead myreport = new cr_jzd_a4_yx_withNohead();
                                myreport.SetDataSource(ds_printData.Tables[0]);
                                crystalReportViewer1.ReportSource = myreport;
                                //myreport.SetParameterValue("qymc", qymc);
                                myreport.SetParameterValue("czy", czy_dy);

                                myreport.SetParameterValue("fkje_total", fk);
                                myreport.SetParameterValue("xfje_total", xf);
                                // myreport.SetParameterValue("qymcyw", qymc_english);
                                // myreport.SetParameterValue("qydh", qydh);
                                // myreport.SetParameterValue("qycz", qycz);
                                //myreport.SetParameterValue("qyyb", qyyb);
                                //myreport.SetParameterValue("website", website);
                                //myreport.SetParameterValue("qydz", Address_chinese);
                                //myreport.SetParameterValue("qydzyw", Address_english);
                                myreport.SetParameterValue("krxm_lz", krxm_lz);
                                myreport.SetParameterValue("fjbh_lz", fjbh_lz);
                                myreport.SetParameterValue("ddsj", ddsj);
                                myreport.SetParameterValue("lksj", lksj);
                                myreport.SetParameterValue("jzsj", jzsj);

                                myreport.PrintToPrinter(1, true, 0, 0);
                            }
                        }
                    }
                }
                if (zd_type == "yjd")
                {
                    ds_printData = B_common.GetList(" select * from Syjcz ", " id>=0  and lsbh='" + lsbh + "'  and  yydh='" + common_file.common_app.yydh + "'");
                    if (ds_printData != null && ds_printData.Tables[0].Rows.Count > 0)
                    {
                        if (print_Type == "A4")
                        {
                            cr_yjd_a4_dh myreport = new cr_yjd_a4_dh();
                            myreport.SetDataSource(ds_printData.Tables[0]);
                            //定义水晶报表的数据库连接信息
                            crystalReportViewer1.ReportSource = myreport;
                            myreport.SetParameterValue("qymc", qymc);
                            myreport.SetParameterValue("czy", czy_dy);
                            myreport.SetParameterValue("qymcyw", qymc_english);
                            myreport.SetParameterValue("qydh", qydh);
                            myreport.SetParameterValue("qycz", qycz);
                            myreport.SetParameterValue("qyyb", qyyb);
                            myreport.SetParameterValue("website", website);
                            myreport.SetParameterValue("qydz", Address_chinese);
                            myreport.SetParameterValue("qydzyw", Address_english);
                            //myreport.PrintOptions.PrinterName = System.Configuration.ConfigurationManager.AppSettings["printer"].ToString();
                            myreport.PrintToPrinter(1, true, 0, 0);
                        }
                        if (print_Type == "A4_With_nohead")
                        {
                            //cr_yjd_a4 myreport = new cr_yjd_a4();
                            cr_yjd_a4_withNoHead myreport = new cr_yjd_a4_withNoHead();
                            myreport.SetDataSource(ds_printData.Tables[0]);
                            //定义水晶报表的数据库连接信息
                            crystalReportViewer1.ReportSource = myreport;
                            //myreport.SetParameterValue("qymc", qymc);
                            myreport.SetParameterValue("czy", common_file.common_app.czy);
                            //myreport.SetParameterValue("qymcyw", qymc_english);
                            // myreport.SetParameterValue("qydh", qydh);
                            // myreport.SetParameterValue("qycz", qycz);
                            // myreport.SetParameterValue("qyyb", qyyb);
                            //myreport.SetParameterValue("website", website);
                            //myreport.SetParameterValue("qydz", Address_chinese);
                            // myreport.SetParameterValue("qydzyw", Address_english);
                            //myreport.PrintOptions.PrinterName = System.Configuration.ConfigurationManager.AppSettings["printer"].ToString();
                            try
                            {
                                myreport.PrintToPrinter(1, true, 0, 0);
                            }
                            catch (Exception ee)
                            {
                                MessageBox.Show(ee.ToString());
                            }
                        }


                        if (print_Type == "A5")
                        {
                            cr_yjd_a5 myreport = new cr_yjd_a5();
                            myreport.SetDataSource(ds_printData.Tables[0]);
                            //定义水晶报表的数据库连接信息
                            crystalReportViewer1.ReportSource = myreport;
                            myreport.SetParameterValue("qymc", qymc);
                            myreport.SetParameterValue("czy", czy_dy);
                            myreport.SetParameterValue("qymcyw", qymc_english);
                            myreport.SetParameterValue("qydh", qydh);
                            myreport.SetParameterValue("qycz", qycz);
                            myreport.SetParameterValue("qyyb", qyyb);
                            myreport.SetParameterValue("website", website);
                            myreport.SetParameterValue("qydz", Address_chinese);
                            myreport.SetParameterValue("qydzyw", Address_english);
                            myreport.PrintOptions.PrinterName = System.Configuration.ConfigurationManager.AppSettings["printer"].ToString();
                            myreport.PrintToPrinter(1, true, 0, 0);
                        }
                    }
                }
                if (zd_type == "jzd_gd")//改单后的打印
                {
                    if (jzbh != "")
                    {
                        ds_Temp = B_common.GetList("  select * from Sjzmx_gd_temp  ", "id>=0 and yydh='" + common_file.common_app.yydh + "'  and  jzbh='" + jzbh + "' ");
                        if (ds_Temp != null && ds_Temp.Tables[0].Rows.Count > 0)
                        {
                            ddsj    = ds_Temp.Tables[0].Rows[0]["zd_ddsj"].ToString();
                            lksj    = ds_Temp.Tables[0].Rows[0]["zd_tfsj"].ToString();
                            jzsj    = ds_Temp.Tables[0].Rows[0]["zd_tfsj"].ToString();
                            krxm_lz = ds_Temp.Tables[0].Rows[0]["zd_krxm_lz"].ToString();
                            if (sk_tt == "tt")
                            {
                                fjbh_lz = "";
                            }
                            else
                            {
                                fjbh_lz = ds_Temp.Tables[0].Rows[0]["zd_fjbh_lz"].ToString();
                            }
                        }
                        ds_printData = B_common.GetList(" select  *  from Sjzmx_gd_temp  ", " id>=0  and yydh='" + common_file.common_app.yydh + "'  and  jzbh='" + jzbh + "' and  czy_temp='" + common_file.common_app.czy + "'   order by id desc    ");
                    }

                    if (jzbh == "")//在住改单的打印
                    {
                        ds_Temp = B_common.GetList("  select * from Sjzmx_gd_temp  ", "id>=0 and yydh='" + common_file.common_app.yydh + "'  and  czy_temp='" + common_file.common_app.czy + "'  and jzbh=''  ");
                        if (ds_Temp != null && ds_Temp.Tables[0].Rows.Count > 0)
                        {
                            ddsj = ds_Temp.Tables[0].Rows[0]["zd_ddsj"].ToString();
                            lksj = ds_Temp.Tables[0].Rows[0]["zd_tfsj"].ToString();
                            jzsj = ds_Temp.Tables[0].Rows[0]["zd_tfsj"].ToString();

                            krxm_lz = ds_Temp.Tables[0].Rows[0]["zd_krxm_lz"].ToString();
                            if (sk_tt == "tt")
                            {
                                fjbh_lz = "";
                            }
                            else
                            {
                                fjbh_lz = ds_Temp.Tables[0].Rows[0]["zd_fjbh_lz"].ToString();
                            }
                        }
                        ds_printData = B_common.GetList(" select  *  from Sjzmx_gd_temp  ", " id>=0  and yydh='" + common_file.common_app.yydh + "'  and  czy_temp='" + common_file.common_app.czy + "' order by id desc ");
                    }

                    if (print_Type == "A4")
                    {
                        cr_jzd_a4 myreport = new cr_jzd_a4();
                        myreport.SetDataSource(ds_printData.Tables[0]);
                        crystalReportViewer1.ReportSource = myreport;
                        myreport.SetParameterValue("qymc", qymc);
                        myreport.SetParameterValue("czy", czy_dy);

                        myreport.SetParameterValue("fkje_total", fk);
                        myreport.SetParameterValue("xfje_total", xf);
                        myreport.SetParameterValue("qymcyw", qymc_english);
                        myreport.SetParameterValue("qydh", qydh);
                        myreport.SetParameterValue("qycz", qycz);
                        myreport.SetParameterValue("qyyb", qyyb);
                        myreport.SetParameterValue("website", website);
                        myreport.SetParameterValue("qydz", Address_chinese);
                        myreport.SetParameterValue("qydzyw", Address_english);
                        myreport.SetParameterValue("krxm_lz", krxm_lz);
                        myreport.SetParameterValue("fjbh_lz", fjbh_lz);
                        myreport.SetParameterValue("ddsj", ddsj);
                        myreport.SetParameterValue("lksj", lksj);
                        myreport.SetParameterValue("jzsj", jzsj);
                        myreport.PrintToPrinter(1, true, 0, 0);
                    }
                    if (print_Type == "A5")
                    {
                        cr_jzd_a5 myreport = new cr_jzd_a5();
                        myreport.SetDataSource(ds_printData.Tables[0]);
                        crystalReportViewer1.ReportSource = myreport;
                        myreport.SetParameterValue("qymc", qymc);
                        myreport.SetParameterValue("czy", czy_dy);

                        myreport.SetParameterValue("fkje_total", fk);
                        myreport.SetParameterValue("xfje_total", xf);
                        myreport.SetParameterValue("qymcyw", qymc_english);
                        myreport.SetParameterValue("qydh", qydh);
                        myreport.SetParameterValue("qycz", qycz);
                        myreport.SetParameterValue("qyyb", qyyb);
                        myreport.SetParameterValue("website", website);
                        myreport.SetParameterValue("qydz", Address_chinese);
                        myreport.SetParameterValue("qydzyw", Address_english);
                        myreport.SetParameterValue("krxm_lz", krxm_lz);
                        myreport.SetParameterValue("fjbh_lz", fjbh_lz);
                        myreport.SetParameterValue("ddsj", ddsj);
                        myreport.SetParameterValue("lksj", lksj);
                        myreport.SetParameterValue("jzsj", jzsj);

                        myreport.PrintToPrinter(1, true, 0, 0);
                    }
                    if (print_Type == "A4_With_head")
                    {
                        //读取表头的图片
                        cr_jzd_a4_yx myreport = new cr_jzd_a4_yx();

                        myreport.SetDataSource(ds_printData.Tables[0]);
                        crystalReportViewer1.ReportSource = myreport;
                        //myreport.SetParameterValue("qymc", qymc);
                        myreport.SetParameterValue("czy", czy_dy);

                        myreport.SetParameterValue("fkje_total", fk);
                        myreport.SetParameterValue("xfje_total", xf);
                        // myreport.SetParameterValue("qymcyw", qymc_english);
                        myreport.SetParameterValue("qydh", qydh);
                        myreport.SetParameterValue("qycz", qycz);
                        myreport.SetParameterValue("qyyb", qyyb);
                        myreport.SetParameterValue("website", website);
                        myreport.SetParameterValue("qydz", Address_chinese);
                        myreport.SetParameterValue("qydzyw", Address_english);
                        myreport.SetParameterValue("krxm_lz", krxm_lz);
                        myreport.SetParameterValue("fjbh_lz", fjbh_lz);
                        myreport.SetParameterValue("ddsj", ddsj);
                        myreport.SetParameterValue("lksj", lksj);
                        myreport.SetParameterValue("jzsj", jzsj);

                        myreport.PrintToPrinter(1, true, 0, 0);
                    }
                    if (print_Type == "A4_With_nohead")
                    {
                        cr_jzd_a4_yx_withNohead myreport = new cr_jzd_a4_yx_withNohead();
                        myreport.SetDataSource(ds_printData.Tables[0]);
                        crystalReportViewer1.ReportSource = myreport;
                        //myreport.SetParameterValue("qymc", qymc);
                        myreport.SetParameterValue("czy", czy_dy);

                        myreport.SetParameterValue("fkje_total", fk);
                        myreport.SetParameterValue("xfje_total", xf);
                        // myreport.SetParameterValue("qymcyw", qymc_english);
                        // myreport.SetParameterValue("qydh", qydh);
                        // myreport.SetParameterValue("qycz", qycz);
                        //myreport.SetParameterValue("qyyb", qyyb);
                        //myreport.SetParameterValue("website", website);
                        //myreport.SetParameterValue("qydz", Address_chinese);
                        //myreport.SetParameterValue("qydzyw", Address_english);
                        myreport.SetParameterValue("krxm_lz", krxm_lz);
                        myreport.SetParameterValue("fjbh_lz", fjbh_lz);
                        myreport.SetParameterValue("ddsj", ddsj);
                        myreport.SetParameterValue("lksj", lksj);
                        myreport.SetParameterValue("jzsj", jzsj);
                        try
                        {
                            myreport.PrintToPrinter(1, true, 0, 0);
                        }
                        catch
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "打印出错,请重启酒店管理系统重试!");
                        }
                    }
                }
            }
        }
Beispiel #4
0
        void LoadInfo(int pageIndex)
        {
            if (pageIndex == 0)
            {
                txt_jdmc.Text        = common_file.common_app.qymc;
                txt_SoftName.Text    = common_file.common_app.SoftName;
                txt_yydh.Text        = common_file.common_app.yydh;
                txt_Softversion.Text = common_file.common_app.softVerSion;
            }
            if (pageIndex == 2)
            {
                List <Model.Qcounter> list = new List <Hotel_app.Model.Qcounter>();
                BLL.Qcounter          bll  = new Hotel_app.BLL.Qcounter();
                list = bll.GetModelList(" id>=0  and  yydh='" + common_file.common_app.yydh + "'");
                if (list != null && list.Count > 0)
                {
                    string printzdtype = list[0].printzdpd.ToString();

                    string jzd_type = printzdtype.Substring(0, 2);
                    string yjd_type = printzdtype.Substring(2, 2);
                    string djb_type = printzdtype.Substring(4, 2);

                    if (jzd_type.Equals("11"))
                    {
                        jzd_now = cb_jzd.Text = "A4";
                    }
                    else
                    {
                        jzd_now = cb_jzd.Text = "A5";
                    }

                    if (yjd_type.Equals("11"))
                    {
                        yjd_now = cb_yjd.Text = "A4";
                    }
                    else
                    {
                        yjd_now = cb_yjd.Text = "A5";
                    }

                    if (djb_type.Equals("11"))
                    {
                        djb_now = cb_djb.Text = "A4";
                    }
                    else
                    {
                        djb_now = cb_djb.Text = "A5";
                    }


                    tqts = txt_yqsts.Value = list[0].ybtqts;


                    //11----A4有表头结账单
                    //21----A5有表头-结账单

                    //11---A4有表头押金单
                    //21----A5有表头押金单
                }
            }
        }
Beispiel #5
0
        //检查记账总数是否超过临时限额
        public static bool Check_jzed(string _jz_je, out string info)
        {
            bool Result = false; decimal jz_je = 0; info = "";

            BLL.Common            B_common = new Hotel_app.BLL.Common();
            BLL.Qcounter          B_Qcounter = new Hotel_app.BLL.Qcounter();
            List <Model.Qcounter> list_temp = new List <Hotel_app.Model.Qcounter>();

            list_temp = B_Qcounter.GetModelList("  yydh='" + common_file.common_app.yydh + "'");
            try
            {
                jz_je = decimal.Parse(_jz_je);
            }
            catch
            {
                info += "系统错误,请联系系统管理员!";
                return(Result);
            }
            if (list_temp != null && list_temp.Count > 0)
            {
                //计算统计的初始时间
                int     tj_sj       = -(list_temp[0].jz_ts);
                decimal jz_total    = list_temp[0].jz_ls_total;
                decimal jz_total_yj = 0;
                //string  cssj=DateTime.Parse(DateTime.Now.AddDays(tj_sj).ToShortDateString();
                //统计当前时间段的计账总额

                DataSet ds_0 = B_common.GetList(" select sum(sjxfje)  as   jz_total from  VIEW_S_jz_ye  ", "  xfdr!='" + common_app.fkdr + "' and  yydh='" + common_app.yydh + "'  and  xfsj>='" + DateTime.Now.AddDays(tj_sj).ToShortDateString() + "'  and xfsj<'" + DateTime.Now.ToString() + "'");
                if (ds_0 != null && ds_0.Tables[0].Rows.Count > 0)
                {
                    if (ds_0.Tables[0].Rows[0]["jz_total"] != null && ds_0.Tables[0].Rows[0]["jz_total"].ToString() != "")
                    {
                        jz_total_yj = decimal.Parse(ds_0.Tables[0].Rows[0]["jz_total"].ToString());
                        if (jz_total_yj + jz_je - jz_total > 0)
                        {
                            info += "对不起,当前以经记账为:" + jz_total_yj.ToString() + ",系统设置的记账总额为:" + jz_total.ToString() + ",此次记账:" + jz_je.ToString() + "以经超过了记账的剩余额度:" + (jz_total - jz_total_yj).ToString() + ",请联系系统管理员或者相应值班经理提升记账总额,系统当前无法记账这笔金额";
                            return(Result = false);
                        }
                        else
                        {
                            return(Result = true);
                        }
                    }
                    else
                    {
                        jz_total_yj = 0;
                        if (jz_total_yj + jz_je - jz_total > 0)
                        {
                            info += "对不起,当前以经记账为:" + jz_total_yj.ToString() + ",系统设置的记账总额为:" + jz_total.ToString() + ",此次记账:" + jz_je.ToString() + "以经超过了记账的剩余额度:" + (jz_total - jz_total_yj).ToString() + ",请联系系统管理员或者相应值班经理提升记账总额,系统当前无法记账这笔金额";
                            return(Result = false);
                        }
                        else
                        {
                            return(Result = true);
                        }
                    }
                }
            }
            else
            {
                info += "请联系系统管理员进行数据库的初始配置";
            }
            return(Result);
        }