예제 #1
0
        //当日 sktt 分析//在住
        public void dr_yd_yl_zz_update_repeat(string yydh, string qymc, BLL.Common B_Common, string zyzt, string table_name, DataSet DS_fs, DataSet DS_rs, string fs, string rs)
        {
            int    j_0      = 0;
            string update_s = "";

            if (DS_fs != null && DS_fs.Tables[0].Rows.Count > 0)
            {
                for (j_0 = 0; j_0 < DS_fs.Tables[0].Rows.Count; j_0++)
                {
                    if (DS_fs.Tables[0].Rows[j_0]["fs"].ToString() != "")
                    {
                        if (DS_fs.Tables[0].Rows[j_0]["sktt"].ToString() == zyzt)
                        {
                            update_s = "update " + table_name + " set " + fs + "='" + DS_fs.Tables[0].Rows[j_0]["fs"].ToString() + "' where zyzt='" + zyzt + "'";
                            B_Common.ExecuteSql(update_s);
                        }
                    }
                }
            }
            if (DS_rs != null && DS_rs.Tables[0].Rows.Count > 0)
            {
                for (j_0 = 0; j_0 < DS_rs.Tables[0].Rows.Count; j_0++)
                {
                    if (DS_rs.Tables[0].Rows[j_0]["sktt"].ToString() == zyzt)
                    {
                        update_s = "update " + table_name + " set " + rs + "='" + DS_rs.Tables[0].Rows[j_0]["rs"].ToString() + "' where zyzt='" + zyzt + "'";
                        B_Common.ExecuteSql(update_s);
                    }
                }
            }
        }
예제 #2
0
        //第一种生成订单编号的方法
        public static string ddbh(string bs, string rq, string counter, int lsmcd)
        {
            int    a; int c; int id;
            string b = ""; string d = "";
            string ddbhyy    = "";
            string counteryy = "";
            string rqyy      = "";
            string qybh      = common_file.common_app.qybh;

            BLL.Common B_Common = new BLL.Common();
            DataSet    DS_temp  = B_Common.GetList("select * from Qcounter", "id>=0" + common_file.common_app.yydh_select);

            if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
            {
                counteryy = DS_temp.Tables[0].Rows[0][counter].ToString();
                rqyy      = DS_temp.Tables[0].Rows[0][rq].ToString();
            }

            if (counteryy == "")
            {
                B_Common.ExecuteSql("update Qcounter set " + rq + "='" + DateTime.Today.ToString() + "'," + counter + "=0 where id>=0" + common_file.common_app.yydh_select);
            }
            else
            {
                if (Convert.ToDateTime(rqyy) == DateTime.Today)
                {
                    c = Convert.ToInt32(counteryy);
                    c = c + 1;
                    B_Common.ExecuteSql("update Qcounter set " + counter + "=" + c.ToString() + " where id>=0" + common_file.common_app.yydh_select);
                }
                else
                {
                    B_Common.ExecuteSql("update Qcounter set " + rq + "='" + DateTime.Today.ToString() + "'," + counter + "=0 where id>=0" + common_file.common_app.yydh_select);
                }

                DS_temp = B_Common.GetList("select * from Qcounter", "id>=0" + common_file.common_app.yydh_select);
                if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
                {
                    counteryy = DS_temp.Tables[0].Rows[0][counter].ToString();
                    rqyy      = DS_temp.Tables[0].Rows[0][rq].ToString();
                }
                a = counteryy.ToString().Length;
                b = lsm(a, lsmcd);
                d = DateTime.Today.Year.ToString();
                if (DateTime.Today.Month.ToString().Length == 1)
                {
                    d = d + "0";
                }
                d = d + DateTime.Today.Month.ToString();
                if (DateTime.Today.Day.ToString().Length == 1)
                {
                    d = d + "0";
                }
                d      = d + DateTime.Today.Day.ToString();
                ddbhyy = qybh + bs + d + b + counteryy.ToString();
            }

            DS_temp.Dispose();
            return(ddbhyy);
        }
예제 #3
0
        public void update_jzzt_czzt(BLL.Common B_Common, string yydh, string qymc)
        {
            DataSet DS_temp = B_Common.GetList("select * from VIEW_S_jzzt_czzt_jzmx", "1=1");

            if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < DS_temp.Tables[0].Rows.Count; i++)
                {
                    string jzbh_zd = DS_temp.Tables[0].Rows[i]["jzbh"].ToString();
                    string jzzt_zd = DS_temp.Tables[0].Rows[i]["jzzt"].ToString();
                    string czzt_zd = DS_temp.Tables[0].Rows[i]["czzt"].ToString();
                    string czsj_zd = DS_temp.Tables[0].Rows[i]["czsj"].ToString();
                    B_Common.ExecuteSql(" update Sjzmx set jzzt='" + jzzt_zd + "',czzt='" + czzt_zd + "',czsj='" + czsj_zd + "' where jzbh='" + jzbh_zd + "' and yydh='" + yydh + "'");
                }
            }
            DS_temp = B_Common.GetList("select * from VIEW_S_czzt_zwmx", "1=1");
            if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < DS_temp.Tables[0].Rows.Count; i++)
                {
                    string jzbh_zd = DS_temp.Tables[0].Rows[i]["jzbh"].ToString();
                    string czzt_zd = DS_temp.Tables[0].Rows[i]["czzt"].ToString();
                    B_Common.ExecuteSql(" update Szwmx set czzt='" + czzt_zd + "' where jzbh='" + jzbh_zd + "' and yydh='" + yydh + "'");
                }
            }
            B_Common.ExecuteSql("delete from Sjzmx where jzbh not in(select jzbh from Sjzzd)");
            DS_temp.Clear();
            DS_temp.Dispose();
        }
예제 #4
0
        private string GetjzOrgjToZz_helper(string lsbh_old, string lsbh_new, string sk_tt, string Zz_Type, string yydh, string czy, string czy_bc, string czsj, string syzd, string xxzs)//对GetjzOrgjToZz方法的辅助方法
        {
            //对每个表(Sjzzd,Sjzmx,循环查找,删除Sjzzd,Sjzmx里面的记录,将记录加到
            //Sjzzd
            string  s       = common_file.common_app.get_failure;
            DataSet ds_temp = new DataSet();

            Model.Sjzzd M_Sjzzd = B_sjjzd.GetModelList("id>0 and yydh='" + yydh + "' and lsbh='" + lsbh_old + "'")[0];
            krxm_old = M_Sjzzd.krxm;
            fjbh_old = M_Sjzzd.fjbh;

            //转向散客(
            if (Zz_Type == common_zw.zwzz_gz_sk || Zz_Type == common_zw.zwzz_jz_sk)
            {
                ds_temp = B_Qskyd_fjrb.GetList("id>0 and yydh='" + yydh + "' and lsbh='" + lsbh_new + "'");
                if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                {
                    krxm_new      = ds_temp.Tables[0].Rows[0]["krxm"].ToString();
                    fjbh_new      = ds_temp.Tables[0].Rows[0]["fjbh"].ToString();
                    sk_tt_afterZZ = ds_temp.Tables[0].Rows[0]["sktt"].ToString();
                }
            }
            //转向团体(fjbh为空)
            if (Zz_Type == common_zw.zwzz_jz_tt || Zz_Type == common_zw.zwzz_gz_tt)
            {
                ds_temp = B_Qttyd_mainrecord.GetList("id>0 and yydh='" + yydh + "' and lsbh='" + lsbh_new + "'");
                if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                {
                    krxm_new      = ds_temp.Tables[0].Rows[0]["krxm"].ToString();
                    fjbh_new      = "";
                    sk_tt_afterZZ = ds_temp.Tables[0].Rows[0]["sktt"].ToString();
                }
            }
            if (GetjzOrgjToZz_helper_InsertToSzwzz_mx(lsbh_old, lsbh_new, krxm_old, krxm_new, fjbh_old, fjbh_new, "Syjcz", Zz_Type, czy, czsj, Zz_Type, yydh) == common_file.common_app.get_suc)
            {
                if (GetjzOrgjToZz_helper_InsertToSzwzz_mx(lsbh_old, lsbh_new, krxm_old, krxm_new, fjbh_old, fjbh_new, "Szwmx", Zz_Type, czy, czsj, Zz_Type, yydh) == common_file.common_app.get_suc)
                {
                    s = common_file.common_app.get_suc;
                }
            }

            StringBuilder strsql = new StringBuilder();

            strsql.Append("delete from  Sjzzd");
            strsql.Append("  where  lsbh='" + lsbh_old + "'  and yydh='" + yydh + "'");
            B_common.ExecuteSql(strsql.ToString());

            strsql = new StringBuilder();
            strsql.Append("delete from Sjzmx");
            strsql.Append(" where  lsbh='" + lsbh_old + "'  and yydh='" + yydh + "'");
            B_common.ExecuteSql(strsql.ToString());

            return(s);
        }
예제 #5
0
        private void b_delete_Click(object sender, EventArgs e)
        {
            if (common_file.common_roles.get_user_qx("B_jkzd_del", common_file.common_app.user_type) == false)
            {
                return;
            }
            int i = dg_jbzd.CurrentRow.Index;

            if (i < count_jbzd && TC_jb.SelectedIndex == 0)
            {
                DataGridViewDataErrorContexts ss = new DataGridViewDataErrorContexts();
                if (this.dg_jbzd.Rows[i].Cells[0].GetEditedFormattedValue(i, ss) != null && Convert.ToBoolean(this.dg_jbzd.Rows[i].Cells[0].GetEditedFormattedValue(i, ss)) == true)
                {
                    DataRowView dgr = dg_jbzd.SelectedRows[0].DataBoundItem as DataRowView;
                    if (dgr != null)
                    {
                        i = DS_jbzd.Tables[0].Rows.IndexOf(dgr.Row);
                        if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "是否确定要删除此记录") == true)
                        {
                            if (common_file.common_app.user_type == "administrator")
                            {
                                string sql_s = "delete from S_jbzd where lsbh='" + DS_jbzd.Tables[0].Rows[i]["lsbh"].ToString() + "'";
                                common_file.common_czjl.add_czjl(common_file.common_app.yydh, common_file.common_app.qymc, common_file.common_app.czy, "删除交班记录", DS_jbzd.Tables[0].Rows[i]["czy_jb"].ToString() + "||" + DS_jbzd.Tables[0].Rows[i]["czy_sb"].ToString(), "交班时间:" + DS_jbzd.Tables[0].Rows[i]["czsj"].ToString(), DateTime.Now);
                                B_Common.ExecuteSql(sql_s);
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "已经成功取消!");
                                b_refresh_Click(sender, e);
                            }
                            else
                            {
                                DataSet DS_temp_0 = B_Common.GetList("select max(id) as id from S_jbzd", "id>=0 and yydh='" + common_file.common_app.yydh + "' and syzd='" + common_file.common_app.syzd + "' and jb_jk_rx='" + common_zw.jb_jk_jk + "'  ");
                                {
                                    if (DS_temp_0 != null && DS_temp_0.Tables[0].Rows.Count > 0)
                                    {
                                        if (int.Parse(DS_temp_0.Tables[0].Rows[0]["id"].ToString()) != int.Parse(DS_jbzd.Tables[0].Rows[i]["id"].ToString()))
                                        {
                                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,当前用户只能删除最新的记录!");
                                            string sql_s = "delete from S_jbzd where lsbh='" + DS_jbzd.Tables[0].Rows[i]["lsbh"].ToString() + "'";
                                            common_file.common_czjl.add_czjl(common_file.common_app.yydh, common_file.common_app.qymc, common_file.common_app.czy, "删除交班记录", DS_jbzd.Tables[0].Rows[i]["czy_jb"].ToString() + "||" + DS_jbzd.Tables[0].Rows[i]["czy_sb"].ToString(), "交班时间:" + DS_jbzd.Tables[0].Rows[i]["czsj"].ToString(), DateTime.Now);
                                            B_Common.ExecuteSql(sql_s);
                                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "已经成功取消!");
                                            b_refresh_Click(sender, e);
                                        }
                                    }
                                }
                                DS_temp_0.Clear();
                                DS_temp_0.Dispose();
                            }
                        }
                    }
                }
            }
        }
예제 #6
0
        public void add_7day_ky(string yydh, string qymc, BLL.Common B_Common, string czy, string Table_name)
        {
            common_file.common_app.get_czsj();
            string insert_s = "delete from " + Table_name + " where czy='" + czy + "'";

            B_Common.ExecuteSql(insert_s);
            insert_s = "insert into " + Table_name + " (yydh,qymc,zyzt,frhj,czy) select '" + yydh + "','" + qymc + "',fjrb,count(id),'" + czy + "' from Ffjzt group by fjrb";
            B_Common.ExecuteSql(insert_s);
            insert_s = "insert into " + Table_name + " (yydh,qymc,zyzt,frhj,czy)  select '" + yydh + "','" + qymc + "','" + hj_value + "',count(id),'" + czy + "' from Ffjzt";
            B_Common.ExecuteSql(insert_s);
            insert_s = "update " + Table_name + " set fx_value_yl_1=0,fx_value_1=frhj,fx_value_yl_2=0,fx_value_2=frhj,fx_value_yl_3=0,fx_value_3=frhj,fx_value_yl_4=0,fx_value_4=frhj,fx_value_yl_5=0,fx_value_5=frhj,fx_value_yl_6=0,fx_value_6=frhj,fx_value_yl_7=0,fx_value_7=frhj";
            B_Common.ExecuteSql(insert_s);
            Cursor.Current = Cursors.Default;
        }
예제 #7
0
        public void Insert_SQL_bbfx(BLL.Common B_Common, string table_name, string yydh, string qymc, string sbzd, string xfrb, string sjxfje, string czy, string y_r, string y_z_w, DateTime bbrq)
        {
            string sql_s = "insert into " + table_name + " (yydh,qymc,sbzd,xfrb,sjxfje,czy_temp,y_r,y_z_w,bbrq)";

            sql_s = sql_s + " values ('" + yydh + "','" + qymc + "','" + sbzd + "','" + xfrb + "','" + sjxfje.ToString() + "','" + czy + "','" + y_r + "','" + y_z_w + "','" + bbrq.ToShortDateString() + "')";
            B_Common.ExecuteSql(sql_s);
        }
예제 #8
0
        public void insert_cy(BLL.Common B_Common, string yydh, string qymc, string czy, string krxm, string lsbh, string fjbh, string sjfjjg, string shqh, string xydw, string krly, string sktt, string shtt, string ddsj, string lksj, string lz, string lzbh, string fjdh, string dhfj, string fkje, string xfje, string yj_xfje, string ye)
        {
            string insert_s = "insert into BB_ysk_cy (yydh, qymc,czy, krxm, lsbh, fjbh, sjfjjg, shqh, xydw, krly, sktt, shtt, ddsj, lksj, lz, lzbh, fjdh, dhfj, fkje, xfje, yj_xfje,ye)";

            insert_s = insert_s + " values ('" + yydh + "', '" + qymc + "','" + czy + "', '" + krxm + "', '" + lsbh + "', '" + fjbh + "', '" + sjfjjg + "', '" + shqh + "', '" + xydw + "', '" + krly + "', '" + sktt + "', '" + shtt + "', '" + ddsj + "', '" + lksj + "', '" + lz + "', '" + lzbh + "', '" + fjdh + "', '" + dhfj + "', '" + fkje + "', '" + xfje + "', '" + yj_xfje + "', '" + ye + "')";
            B_Common.ExecuteSql(insert_s);
        }
예제 #9
0
        public void dr_fx_dd_lk_add(string yydh, string qymc, BLL.Common B_Common, string zyzt, float zyfs, float zyrs, string table_name, string czy)
        {
            common_file.common_app.get_czsj();
            string insert_s = "insert into " + table_name + "(yydh,qymc,zyzt,zyfs,zyrs,czy) values ('" + yydh + "','" + qymc + "','" + zyzt + "','" + zyfs + "','" + zyrs + "','" + czy + "')";

            B_Common.ExecuteSql(insert_s);
        }
예제 #10
0
        //来源年、月分析

        public void update_contain_y_n(string yydh, string qymc, DataSet DS_temp, int i_0, BLL.Common B_Common, DataSet DS_temp_0, string table_name, DateTime cssj, DateTime jssj, int fjrb_arg_sl, string[] fjrb_arg, float zfs, float zyye, DateTime cssj_yf, DateTime cssj_year, string fx_cond)
        {
            string update_s = "";

            update_s = "krly=krly";
            string sql_s = "";

            DS_temp_0 = B_Common.GetList("select fjrb,sum(sjxfje) as sjxfje,sum(xfsl) as xfsl from VS_syxfmx_cz", "yydh='" + yydh + "' and xfdr!='" + Szwgl.common_zw.dr_ds + "' and xfdr='" + Szwgl.common_zw.dr_ff + "'  " + fx_cond + " group by fjrb");
            if (DS_temp_0 != null && DS_temp_0.Tables[0].Rows.Count > 0)
            {
                float ljyyze = 0; float ljlzfs = 0;
                update_s = update_s + get_update_cond(fjrb_arg_sl, fjrb_arg, DS_temp_0, yydh, qymc, ref ljyyze, ref ljlzfs);
                if (update_s != "")
                {
                    string pjfj_0 = "0";
                    string pjczl  = "0%";
                    string pjbl   = "0%";
                    if (ljlzfs != 0)
                    {
                        pjfj_0 = Convert.ToString(Math.Floor(ljyyze / ljlzfs * 10) / 10);
                        pjczl  = Convert.ToString(Math.Floor(ljlzfs / zfs * 10000) / 100) + "%";
                        pjbl   = Convert.ToString(Math.Floor(ljyyze / zyye * 10000) / 100) + "%";
                    }
                    update_s = update_s + ",hj_r_fs='" + ljlzfs.ToString() + "',hj_r_fy='" + ljyyze.ToString() + "',pjfj='',pjczl='',pjbl='',hj_y_fy='',hj_y_fs='',hj_n_fy='',hj_n_fs='',jcb=''";
                }
            }


            sql_s = "update F_kfxsfx set " + update_s + " where id='" + DS_temp.Tables[0].Rows[i_0]["id"].ToString() + "'";
            B_Common.ExecuteSql(sql_s);


            //}
        }
예제 #11
0
        private void Qkrxh_Load(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();

            DataSet ds_temp_0 = B_Common.GetList("select * from Qkrxh_rx", "id>=0");

            if (ds_temp_0 != null && ds_temp_0.Tables[0].Rows.Count > 0)
            {
                for (int j = 0; j < ds_temp_0.Tables[0].Rows.Count; j++)
                {
                    cB_xhrx.Items.Add(ds_temp_0.Tables[0].Rows[j]["xhrx"].ToString());
                }
            }
            if (sk_hy == "hy")
            {
                if (zjhm != "")
                {
                    ds_temp_0 = B_Common.GetList("select * from Qkrxh", "zjhm='" + zjhm + "' and hykh=''");
                    if (ds_temp_0 != null && ds_temp_0.Tables[0].Rows.Count > 0)
                    {
                        B_Common.ExecuteSql("update Qkrxh set hykh='" + hykh + "'where zjhm='" + zjhm + "' and hykh=''");
                    }
                }
            }
            refresh_app();
            ds_temp_0.Dispose();
            Cursor.Current = Cursors.Default;
        }
예제 #12
0
        public void saveToGdTemp()
        {
            string zd_krxm = tB_krxm.Text.Replace("'", "-").Trim();
            string zd_fjbh = tb_fjbh.Text.Replace("'", "-").Trim();
            string zd_ddsj = DateTime.Parse(dT_ddsj_date.Text + " " + dT_ddsj_time.Text).ToString();
            string zd_lksj = DateTime.Parse(dT_lksj_date.Text + " " + dT_lksj_time.Text).ToString();
            string zd_jzsj = DateTime.Parse(dT_jzsj_date.Text + " " + dT_jzsj_Time.Text).ToString();

            sb = new StringBuilder();
            if (gd_Type == "jz")
            {
                sb.Append(" update Sjzmx_gd_temp set zd_krxm_lz='" + zd_krxm + "',zd_fjbh='" + zd_fjbh + "', zd_fjbh_lz='" + zd_fjbh + "',zd_ddsj='" + zd_ddsj + "',zd_tfsj='" + zd_lksj + "'  where jzbh='" + zd_jzbh + "' and czy_temp='" + common_file.common_app.czy_GUID + "'");
            }
            if (gd_Type == "zz")
            {
                sb.Append(" update Sjzmx_gd_temp set zd_krxm_lz='" + zd_krxm + "',zd_fjbh='" + zd_fjbh + "', zd_fjbh_lz='" + zd_fjbh + "',zd_ddsj='" + zd_ddsj + "',zd_tfsj='" + zd_lksj + "'  where   czy_temp='" + common_file.common_app.czy_GUID + "'");
            }
            B_common = new Hotel_app.BLL.Common();
            if (B_common.ExecuteSql(sb.ToString()) > 0)
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "主单修改成功");
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
예제 #13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="yydh"></param>
        /// <param name="qymc"></param>
        /// <param name="cssj"></param>
        /// <param name="jssj"></param>
        /// <param name="sel_cond"></param>
        /// <param name="type"></param>挂账gz或记账jz
        /// <param name="czy"></param>
        /// <param name="czsj"></param>
        /// <param name="xxzs"></param>
        /// <returns></returns>
        ///

        public void insert_s(BLL.Common B_Common, string yydh, string qymc, string jzzt, string type, float zfh, float ds, float qt, float zyye, float zzzz, float zgz_zjz, float zsz, float wj, string czy_temp, string cssj, string jssj)
        {
            string sql_s = "insert into BS_g_j_fx( yydh, qymc, jzzt, type, zfh, ds, qt, zyye, zzz, zgz_zjz, zsz, wj, czy_temp, cssj, jssj)";

            sql_s = sql_s + " values ('" + yydh + "', '" + qymc + "', '" + jzzt + "', '" + type + "', '" + zfh + "', '" + ds + "', '" + qt + "', '" + zyye + "', '" + zzzz + "', '" + zgz_zjz + "', '" + zsz + "', '" + wj + "', '" + czy_temp + "', '" + cssj + "', '" + jssj + "')";
            B_Common.ExecuteSql(sql_s);
        }
예제 #14
0
        public void insert_s(BLL.Common B_Common, string yydh, string qymc, string type, string fxdr, string fxrb, float zyye, float zfh, float czfs, string pjczl, string xd_pjczl, float pjfj, float jcb, string pjbl, string xd_pjbl, string czy, string cssj, string jssj)
        {
            string sql_s = "insert into BQ_syxffx(yydh,qymc,type,fxdr,fxrb,zyye,zfh,czfs,pjczl,xd_pjczl,pjfj,jcb,pjbl, xd_pjbl,czy_temp,cssj,jssj)";

            sql_s = sql_s + " values ('" + yydh + "','" + qymc + "','" + type + "','" + fxdr + "','" + fxrb + "','" + zyye + "','" + zfh + "','" + czfs + "','" + pjczl + "','" + xd_pjczl + "','" + pjfj + "','" + jcb + "','" + pjbl + "','" + xd_pjbl + "','" + czy + "','" + cssj + "','" + jssj + "')";
            B_Common.ExecuteSql(sql_s);
        }
예제 #15
0
        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            string strnewhykh = this.tB_newkh.Text.Trim();
            string stroldkh   = this.tB_hykh.Text.Trim();

            if (strnewhykh != "")
            {
                string strgetdate = DateTime.Now.ToShortDateString();
                int    judge_save = 3;//3保存,其余不保存
                judge_save = common_file.common_app.get_judge_repeat("Hhygl", "hykh_bz", "会员卡号已经存在了", strnewhykh, common_file.common_app.get_add, hyid_0);
                if (judge_save == 3)
                {
                    int isudok = B_Common.ExecuteSql("update Hhygl set hykh_bz='" + strnewhykh + "',shxg=1,xgsj=getdate()  where hykh='" + hykh + "' " + common_file.common_app.yydh_select);
                    if (isudok > 0)
                    {
                        common_file.common_czjl.add_czjl(common_file.common_app.yydh, common_file.common_app.qymc, common_file.common_app.czy, "会员换卡", "" + strnewhykh + "", "旧的卡号" + stroldkh + "新的卡号:" + strnewhykh + "", DateTime.Now);

                        if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "是否要写到卡里面,如果要请把会员卡放在读卡器上") == true)
                        {
                            H_hygl_k H_hygl_k_NEW = new H_hygl_k();
                            H_hygl_k_NEW.write_hykh(tB_newkh.Text.Trim());
                        }
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "换卡成功!");
                        common_file.common_hy.Hhygl_browse_new.refresh_app();
                        common_file.common_hy.Hhygl_browse_new.open_record();
                    }
                    else
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "换卡不成功!");
                    }
                }
            }
            Cursor.Current = Cursors.Default;
        }
예제 #16
0
        public void update_record(BLL.Common B_Common, string yydh, string qymc, string czy, string colu_name, string update_value, string colu_name_yd, string update_value_yd, string update_cond, string Table_name)
        {
            common_file.common_app.get_czsj();
            string update_s = "update " + Table_name + " set " + colu_name + "='" + update_value + "'," + colu_name_yd + "='" + update_value_yd + "' where czy='" + czy + "'" + update_cond;

            B_Common.ExecuteSql(update_s);
            Cursor.Current = Cursors.Default;
        }
예제 #17
0
        public void insert_app_gj(BLL.Common B_Common, string yydh, string qymc, string bbrq, string ddsj, string lksj, string czsj, string krxm, string jzzt, string xydw, string krly, string fjrb, string fjbh, string sktt, string czzt, string fx_zt, string zfh, string ds, string qt, string zyye, string czy)
        {
            string insert_s = "";

            insert_s = "insert into BB_sh_wj_gj(yydh, qymc, bbrq, ddsj, lksj,czsj, krxm,jzzt, xydw, krly, fjrb, fjbh, sktt,czzt,fx_zt, zfh, ds, qt, zyye,czy)";
            insert_s = insert_s + " values ('" + yydh + "','" + qymc + "','" + bbrq + "','" + ddsj + "','" + lksj + "','" + czsj + "','" + krxm + "','" + jzzt + "','" + xydw + "','" + krly + "','" + fjrb + "','" + fjbh + "','" + sktt + "','" + czzt + "','" + fx_zt + "','" + zfh + "','" + ds + "','" + qt + "','" + zyye + "','" + czy + "') ";
            B_Common.ExecuteSql(insert_s);
        }
예제 #18
0
        /// <summary>
        /// 进行当日的各种房型的房态分析
        /// </summary>
        /// <param name="yydh"></param>
        /// <param name="qymc"></param>
        /// <param name="tjrq"></param>
        /// <param name="czy"></param>
        /// <param name="czsj"></param>
        /// <param name="xxzs"></param>
        /// <returns></returns>
        public string dr_ft_tj_app(string yydh, string qymc, string czy, DateTime czsj, string xxzs)
        {
            common_file.common_app.get_czsj();
            string get_result = common_file.common_app.get_failure;

            BLL.Common B_Common = new BLL.Common();
            string     insert_s = "";

            //Model.F_ftfx_zft M_F_ftfx_zft = new Hotel_service.Model.F_ftfx_zft();
            // BLL.F_ftfx_zft B_F_ftfx_zft = new Hotel_service.BLL.F_ftfx_zft();
            B_Common.ExecuteSql("delete from " + "F_ftfx_zft where czy='" + czy + "'");
            DataSet DS_temp = B_Common.GetList("select count(*) as zyfs from Ffjzt", "id>=0");
            string  zyfs    = "0";

            if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
            {
                zyfs = DS_temp.Tables[0].Rows[0]["zyfs"].ToString();
            }
            insert_s = "insert into " + "F_ftfx_zft" + "(yydh,qymc,zyzt,zyfs,czy) values('" + yydh + "','" + qymc + "','" + "总房数" + "','" + zyfs + "','" + czy + "')";
            B_Common.ExecuteSql(insert_s);

            DS_temp = B_Common.GetList("select zyzt,count(*)as zyfs  from Ffjzt", "id>=0 group by zyzt");
            if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
            {
                add_dr_ft_tj(yydh, qymc, common_file.common_fjzt.gjf, DS_temp, B_Common, "F_ftfx_zft", czy);
                add_dr_ft_tj(yydh, qymc, common_file.common_fjzt.zf, DS_temp, B_Common, "F_ftfx_zft", czy);
                add_dr_ft_tj(yydh, qymc, common_file.common_fjzt.wxf, DS_temp, B_Common, "F_ftfx_zft", czy);
                add_dr_ft_tj(yydh, qymc, common_file.common_fjzt.qtf, DS_temp, B_Common, "F_ftfx_zft", czy);
                add_dr_ft_tj(yydh, qymc, common_file.common_fjzt.zzf, DS_temp, B_Common, "F_ftfx_zft", czy);
            }

            DS_temp = B_Common.GetList("select count(*) as zyfs from Ffjzt", "zyzt_second='" + common_file.common_fjzt.ydf + "'");
            if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
            {
                zyfs = DS_temp.Tables[0].Rows[0]["zyfs"].ToString();
            }
            insert_s = "insert into " + "F_ftfx_zft" + "(yydh,qymc,zyzt,zyfs,czy) values('" + yydh + "','" + qymc + "','" + "已排预订" + "','" + zyfs + "','" + czy + "')";
            B_Common.ExecuteSql(insert_s);

            DS_temp.Clear();
            DS_temp.Dispose();
            get_result = common_file.common_app.get_suc;
            return(get_result);

            Cursor.Current = Cursors.Default;
        }
예제 #19
0
        //当日 sktt 分析
        public string dr_yd_yl_sktt_app(string yydh, string qymc, string czy, DateTime czsj, string xxzs)
        {
            common_file.common_app.get_czsj();
            string get_result = common_file.common_app.get_failure;

            BLL.Common B_Common = new BLL.Common();
            B_Common.ExecuteSql("delete from " + "F_ftfx_sktt_ddlk" + " where czy=  '" + czy + "'");

            //预计到店
            string  sel_cond = "id>=0 and lzfs>=0  and yddj='" + common_file.common_yddj.yddj_yd + "'   and ddsj between '" + DateTime.Now.ToShortDateString() + "' and '" + DateTime.Now.ToShortDateString() + " 23:59:59" + "' group by sktt";
            DataSet DS_temp  = B_Common.GetList("select sktt,sum(lzfs) as lzfs from Qskyd_fjrb", sel_cond);

            //

            dr_yd_yl_sktt_yd_add(yydh, qymc, common_file.common_sktt.sktt_sk, B_Common, DS_temp, "F_ftfx_sktt_ddlk", czy);
            dr_yd_yl_sktt_yd_add(yydh, qymc, common_file.common_sktt.sktt_cz, B_Common, DS_temp, "F_ftfx_sktt_ddlk", czy);
            dr_yd_yl_sktt_yd_add(yydh, qymc, common_file.common_sktt.sktt_zd, B_Common, DS_temp, "F_ftfx_sktt_ddlk", czy);
            dr_yd_yl_sktt_yd_add(yydh, qymc, common_file.common_sktt.sktt_tt, B_Common, DS_temp, "F_ftfx_sktt_ddlk", czy);
            dr_yd_yl_sktt_yd_add(yydh, qymc, common_file.common_sktt.sktt_hy, B_Common, DS_temp, "F_ftfx_sktt_ddlk", czy);

            //在店
            dr_yd_yl_zz_update(yydh, qymc, B_Common, "F_ftfx_sktt_ddlk", "yddj='" + common_file.common_yddj.yddj_dj + "'  and lksj not between '" + DateTime.Now.ToShortDateString() + "' and '" + DateTime.Now.ToShortDateString() + " 23:59:59" + "'", "zdfs", "zdrs");


            //预离
            dr_yd_yl_zz_update(yydh, qymc, B_Common, "F_ftfx_sktt_ddlk", "yddj='" + common_file.common_yddj.yddj_dj + "' and lksj  between '" + DateTime.Now.ToShortDateString() + "' and '" + DateTime.Now.ToShortDateString() + " 23:59:59" + "'", "ylfs", "ylrs");


            //合计
            B_Common.ExecuteSql("insert into " + "F_ftfx_sktt_ddlk" + "(yydh,qymc,zyzt,ydfs,ydrs,zdfs,zdrs,ylfs,ylrs,czy) select '" + yydh + "','" + qymc + "','" + "合计" + "',sum(ydfs),sum(ydrs),sum(zdfs),sum(zdrs),sum(ylfs),sum(ylrs),'" + czy + "' from " + "F_ftfx_sktt_ddlk where czy='" + czy + "'");


            DS_temp.Clear();
            DS_temp.Dispose();
            get_result = common_file.common_app.get_suc;
            return(get_result);

            Cursor.Current = Cursors.Default;
        }
예제 #20
0
        private void b_delete_Click(object sender, EventArgs e)
        {
            if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "是否确认要删除所选择的历史客人!") == true)
            {
                for (int j = 0; j < dg_count; j++)
                {
                    common_file.common_app.get_czsj();
                    DataGridViewDataErrorContexts ss = new DataGridViewDataErrorContexts();
                    if (this.dg_lskr.Rows[j].Cells[0].GetEditedFormattedValue(j, ss) != null && Convert.ToBoolean(this.dg_lskr.Rows[j].Cells[0].GetEditedFormattedValue(j, ss)) == true)
                    {
                        if (this.dg_lskr.Rows[j].Cells["id"].Value != null)
                        {
                            DataRowView dgr = dg_lskr.Rows[j].DataBoundItem as DataRowView;
                            j = DS_lskr.Tables[0].Rows.IndexOf(dgr.Row);


                            B_Common.ExecuteSql("delete from Qskyd_mainrecord_lskr where lsbh='" + DS_lskr.Tables[0].Rows[j]["lsbh"].ToString() + "'");
                            B_Common.ExecuteSql("delete from Qskyd_fjrb_lskr where lsbh='" + DS_lskr.Tables[0].Rows[j]["lsbh"].ToString() + "'");
                        }
                    }
                }
            }
        }
예제 #21
0
        //当日 sktt 分析//预计到店
        public void dr_yd_yl_sktt_yd_add(string yydh, string qymc, string zyzt, BLL.Common B_Common, DataSet DS_temp, string table_name, string czy)
        {
            string  insert_s = "";
            decimal ydfs     = 0;
            decimal ydrs     = 0;

            insert_s = "insert into " + table_name + "(yydh,qymc,zyzt,ydfs,ydrs,zdfs,zdrs,ylfs,ylrs,czy)";
            ydfs     = 0; ydrs = 0;
            dr_yd_yl_sktt_yd_add_repeat(B_Common, DS_temp, zyzt, ref ydfs, ref ydrs);
            insert_s = insert_s + "values ('" + yydh + "','" + qymc + "','" + zyzt + "','" + ydfs.ToString() + "','" + ydrs.ToString() + "','0','0','0','0','" + czy + "') ";
            B_Common.ExecuteSql(insert_s);
            DS_temp.Clear();
            DS_temp.Dispose();
        }
예제 #22
0
        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (tB_gzdw_new.Text.Trim().Equals(tB_gzdw_old.Text.Trim()))//没有修改任何内容
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "你没有更改挂账单位!!!");
                return;
            }
            if (tB_gzdw_new.Text.Trim() == "")
            {
                common_file.common_app.get_czsj();
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "请选择挂账单位");
                return;
            }
            if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "你确定要调整当前帐务的挂账单位嘛?") == true)
            {
                common_file.common_app.get_czsj();
                decimal xf = 0; string info = "";
                DataSet ds_0 = B_common.GetList(" select sum(sjxfje)  as   xfje  from  VIEW_S_gz_ye ", " yydh='" + common_file.common_app.yydh + "'   and  xfdr!='" + common_file.common_app.fkdr + "'   and  jzbh='" + this.jzbh + "'");
                if (ds_0 != null && ds_0.Tables[0].Rows.Count > 0)
                {
                    if (ds_0.Tables[0].Rows[0]["xfje"] != null && ds_0.Tables[0].Rows[0]["xfje"].ToString() != "")
                    {
                        xf = decimal.Parse(ds_0.Tables[0].Rows[0]["xfje"].ToString());
                    }
                }
                if (common_zw.Check_gzed(common_zw.GetXyhByXxydw(tB_gzdw_new.Text.Trim()), tB_gzdw_new.Text.Trim(), xf, out info))
                {
                    if (tB_gzdw_new.Text.Trim() != "")
                    {
                        xyh = common_zw.GetxyhByxydw(tB_gzdw_new.Text.Trim(), common_file.common_app.yydh, common_zw.xydw_gz);

                        StringBuilder sb = new StringBuilder();
                        sb.Append(" update Sjzzd set  jzzt='" + tB_gzdw_new.Text.Trim() + "', xyh='" + xyh + "',czsj='" + DateTime.Now.ToString() + "',czy='" + common_file.common_app.czy + "'   where  yydh='" + common_file.common_app.yydh + "' and jzbh='" + jzbh + "' ");
                        if (B_common.ExecuteSql(sb.ToString()) > 0)
                        {
                            common_file.common_czjl.add_czjl(common_file.common_app.yydh, common_file.common_app.qymc, common_file.common_app.czy, "修改挂账单位", "原来的挂账单位为:" + tB_gzdw_old.Text.Trim(), "账务新的挂账单位为:" + tB_gzdw_new.Text.Trim(), DateTime.Now);
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "修改账务的挂账单位成功!");
                            this.DialogResult = DialogResult.OK;
                        }
                    }
                }
                else
                {
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, info);
                    return;
                }
            }
            Cursor.Current = Cursors.Default;
        }
예제 #23
0
        public void add_dr_ft_tj(string yydh, string qymc, string zyzt_db, DataSet DS_temp, BLL.Common B_Common, string table_name, string czy)
        {
            string zyfs     = "0";
            string insert_s = "";

            for (int j_0 = 0; j_0 < DS_temp.Tables[0].Rows.Count; j_0++)
            {
                if (DS_temp.Tables[0].Rows[j_0]["zyzt"].ToString() == zyzt_db)
                {
                    zyfs = DS_temp.Tables[0].Rows[j_0]["zyfs"].ToString();
                    //M_F_ftfx_zft.zyfs = decimal.Parse(DS_temp.Tables[0].Rows[j_0]["zyfs"].ToString());
                }
            }
            insert_s = "insert into " + table_name + "(yydh,qymc,zyzt,zyfs,czy) values('" + yydh + "','" + qymc + "','" + zyzt_db + "','" + zyfs + "','" + czy + "')";
            B_Common.ExecuteSql(insert_s);
        }
예제 #24
0
        public void insert_s(BLL.Common B_Common, string yydh, string qymc, string type, string fxdr, string fxrb, float zyye, float zfh, float czfs, string pjczl, string xd_pjczl, float pjfj, float jcb, string pjbl, string xd_pjbl, string czy, string cssj, string jssj)
        {
            string sql_s = "";

            try
            {
                sql_s = "insert into BQ_syxffx(yydh,qymc,type,fxdr,fxrb,zyye,zfh,czfs,pjczl,xd_pjczl,pjfj,jcb,pjbl, xd_pjbl,czy_temp,cssj,jssj)";
                sql_s = sql_s + " values ('" + yydh + "','" + qymc + "','" + type + "','" + fxdr + "','" + fxrb + "','" + zyye + "','" + zfh + "','" + czfs + "','" + pjczl + "','" + xd_pjczl + "','" + pjfj + "','" + jcb + "','" + pjbl + "','" + xd_pjbl + "','" + czy + "','" + cssj + "','" + jssj + "')";
                B_Common.ExecuteSql(sql_s);
                string logPsssath = ConfigurationManager.AppSettings["ErrorLogPath"];
            }
            catch
            {
                common_file.common_czjl.add_errorlog(sql_s, "", DateTime.Now.ToString());
            }
        }
예제 #25
0
 private void saveInfo()
 {
     if (tB_xfxm_new.Text.Trim() == "")
     {
         common_file.common_app.Message_box_show(common_file.common_app.message_title, "请正确填写消费项目!."); return;
     }
     else
     {
         string xfsj_new = dT_xfsj_Date.Text + " " + dT_xfsj_Time.Text.Trim();
         sb = new StringBuilder();
         sb.Append(" update Sjzmx_gd_temp  set xfxm='" + tB_xfxm_new.Text.Trim().Replace("'", "-") + "',xfbz='" + tB_xfbz_new.Text.Trim().Replace("'", "-") + "',xfzy='" + tB_xfzy_new.Text.Trim().Replace("'", "-") + "',xfsj='" + xfsj_new + "',sjxfje='" + tB_xfje_new.Text.Trim() + "' where id>=0 and yydh='" + common_file.common_app.yydh + "' and  id_app='" + id_app + "'");
         if (B_common.ExecuteSql(sb.ToString()) > 0)
         {
             common_file.common_app.Message_box_show(common_file.common_app.message_title, "改单成功!.");
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
     }
 }
예제 #26
0
        private string GetjzOrgzOrZaiZToZz_helper(string lsbh_old, string jzbh_old, string lsbh_new, string sk_tt, string Zz_Type, string yydh, string czy, string czy_bc, string czsj, string syzd, string xxzs, string czy_GUID)//对GetjzOrgjToZz方法的辅助方法
        {
            //对每个表(Sjzzd,Sjzmx,循环查找,删除Sjzzd,Sjzmx里面的记录,将记录加到
            //Sjzzd
            string  s       = common_file.common_app.get_failure;
            DataSet ds_temp = new DataSet();

            zz_lsbh = common_file.common_ddbh.ddbh("zwzz", "jzdate", "jzcounter", 6);
            #region 获取转入的团体或者散客的信息(krxm_new,fjbh_new)
            //转向散客
            if (Zz_Type == common_zw.zwzz_gz_sk || Zz_Type == common_zw.zwzz_jz_sk || Zz_Type == common_zw.zwzz_sk_sk || Zz_Type == common_zw.zwzz_tt_sk)
            {
                ds_temp = B_Qskyd_fjrb.GetList("id>0 and yydh='" + yydh + "' and lsbh='" + lsbh_new + "'");
                if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                {
                    krxm_new = ds_temp.Tables[0].Rows[0]["krxm"].ToString();
                    fjbh_new = ds_temp.Tables[0].Rows[0]["fjbh"].ToString();
                    fjrb_new = ds_temp.Tables[0].Rows[0]["fjrb"].ToString();
                    sktt_new = ds_temp.Tables[0].Rows[0]["sktt"].ToString();
                }
            }
            //转向团体(fjbh为空)
            if (Zz_Type == common_zw.zwzz_jz_tt || Zz_Type == common_zw.zwzz_gz_tt || Zz_Type == common_zw.zwzz_sk_tt || Zz_Type == common_zw.zwzz_tt_tt)
            {
                ds_temp = B_Qttyd_mainrecord.GetList("id>0 and yydh='" + yydh + "' and lsbh='" + lsbh_new + "'");
                if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                {
                    krxm_new = ds_temp.Tables[0].Rows[0]["krxm"].ToString();
                    fjbh_new = "";
                    fjrb_new = "";//团体没有房间类别
                    sktt_new = ds_temp.Tables[0].Rows[0]["sktt"].ToString();
                }
            }
            #endregion

            #region 转帐时旧获取旧的信息(krxm_old,fjbh_old)
            //挂或者记帐转帐旧的信息的获取
            if (Zz_Type == common_zw.zwzz_jz_sk || Zz_Type == common_zw.zwzz_jz_tt || Zz_Type == common_zw.zwzz_gz_sk || Zz_Type == common_zw.zwzz_gz_tt)
            {
                Model.Sjzzd M_Sjzzd = B_sjjzd.GetModelList("id>0 and yydh='" + yydh + "' and lsbh='" + lsbh_old + "'  and jzbh='" + jzbh_old + "'")[0];
                krxm_old = M_Sjzzd.krxm;
                fjbh_old = M_Sjzzd.fjbh;
                sktt_old = M_Sjzzd.sktt;
            }
            //在住类型的转帐旧的信息的获取
            if (Zz_Type == common_zw.zwzz_sk_sk || Zz_Type == common_zw.zwzz_sk_tt || Zz_Type == common_zw.zwzz_tt_sk || Zz_Type == common_zw.zwzz_tt_tt)
            {
                //散客类型转
                if (Zz_Type == common_zw.zwzz_sk_sk || Zz_Type == common_zw.zwzz_sk_tt)
                {
                    ds_temp = new DataSet();
                    ds_temp = B_common.GetList("select krxm,fjbh from View_Qskzd", "  lsbh='" + lsbh_old + "' and  yydh='" + yydh + "'");
                    if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                    {
                        krxm_old = ds_temp.Tables[0].Rows[0]["krxm"].ToString();
                        fjbh_old = ds_temp.Tables[0].Rows[0]["fjbh"].ToString();
                    }
                }
                //团体类型转
                if (Zz_Type == common_zw.zwzz_tt_sk || Zz_Type == common_zw.zwzz_tt_tt)
                {
                    ds_temp = new DataSet();
                    ds_temp = B_common.GetList("select krxm from View_Qttzd", "  lsbh='" + lsbh_old + "' and  yydh='" + yydh + "'");
                    if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                    {
                        krxm_old = ds_temp.Tables[0].Rows[0]["krxm"].ToString();
                        fjbh_old = "";//团体房号为空
                    }
                }
            }
            #endregion

            #region              //挂记帐类型执行的操作
            if (Zz_Type == common_zw.zwzz_jz_sk || Zz_Type == common_zw.zwzz_jz_tt || Zz_Type == common_zw.zwzz_gz_sk || Zz_Type == common_zw.zwzz_gz_tt)
            {
                if (GetjzOrgjToZz_helper_InsertToSzwzz_mx(lsbh_old, jzbh_old, lsbh_new, krxm_old, krxm_new, fjbh_old, fjbh_new, "Syjcz", Zz_Type, czy, czsj, Zz_Type, yydh, zz_lsbh, czy_GUID) == common_file.common_app.get_suc)
                {
                    if (GetjzOrgjToZz_helper_InsertToSzwzz_mx(lsbh_old, jzbh_old, lsbh_new, krxm_old, krxm_new, fjbh_old, fjbh_new, "Szwmx", Zz_Type, czy, czsj, Zz_Type, yydh, zz_lsbh, czy_GUID) == common_file.common_app.get_suc)
                    {
                        //jzzd到bak,备份jzmx到bak ,备份押金操作到bak
                        //删除jzmx及jzzd里面的数据
                        //更新Ssyxfmx及Ssyxfmx里面的lsbh
                        //更新转入的Szwzd里面的xfje和fkje

                        //获取转帐的金额
                        if (Zz_Type == common_zw.zwzz_jz_sk || Zz_Type == common_zw.zwzz_jz_tt || Zz_Type == common_zw.zwzz_gz_sk || Zz_Type == common_zw.zwzz_gz_tt)
                        {
                            ds_temp = B_common.GetList("select *  from Sjzzd ", " id>0 and yydh='" + yydh + "'    and jzbh='" + jzbh_old + "'");
                            if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                            {
                                xfje_zz = decimal.Parse(ds_temp.Tables[0].Rows[0]["xfje"].ToString());
                                fkje_zz = decimal.Parse(ds_temp.Tables[0].Rows[0]["fkje"].ToString());
                            }
                        }
                        string Zz_Type_temp = "";//备份时主单及明细的状态
                        if (Zz_Type == common_zw.zwzz_jz_sk || Zz_Type == common_zw.zwzz_jz_tt)
                        {
                            Zz_Type_temp = common_file.common_jzzt.czzt_jzzzz;
                        }
                        if (Zz_Type == common_zw.zwzz_gz_sk || Zz_Type == common_zw.zwzz_gz_tt)
                        {
                            Zz_Type_temp = common_file.common_jzzt.czzt_gzzzz;
                        }
                        strsql = new StringBuilder();//备份jzzd--jzzd_bak
                        strsql.Append("insert into  sjzzd_bak(yydh,qymc,jzbh,jzbh_new,lsbh,is_top,is_select,krxm,sktt,fjbh,xydw,krly,tfsj,czsj,czy,czzt,xyh,jzzt,sdcz,syzd,bz,fp_print,is_visible,fkje,xfje,ddsj,krxm_lz,fjbh_lz)");
                        strsql.Append("select yydh,qymc,jzbh,'',lsbh,is_top,is_select,krxm,sktt,fjbh,xydw,krly,tfsj,czsj,czy,'" + Zz_Type_temp + "',xyh,jzzt,sdcz,syzd,'" + "帐务由lsbh:" + lsbh_old + "通过:" + Zz_Type + "方式转到lsbh:" + lsbh_new + "',fp_print,is_visible,fkje,xfje,ddsj,krxm_lz,fjbh_lz  from  sjzzd");
                        strsql.Append(" where  lsbh='" + lsbh_old + "' and  jzbh='" + jzbh_old + "'  and yydh='" + yydh + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        strsql = new StringBuilder();//备份jzmx--jzmx_bak
                        strsql.Append("insert into sjzmx_bak(yydh,qymc,is_top,is_select,id_app,jzbh,jzbh_new,lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,jjje,xfje,yh,sjxfje,xfsl,shsc,czy_bc,czzt,czsj,syzd,is_visible,xyh,jzzt,fkfs,mxbh,tfsj)");
                        strsql.Append("select yydh,qymc,is_top,is_select,id_app,jzbh,'',lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,jjje,xfje,yh,sjxfje,xfsl,shsc,czy_bc,'" + Zz_Type_temp + "','" + czsj + "',syzd,is_visible,xyh,jzzt,fkfs,mxbh,tfsj  from sjzmx");
                        strsql.Append(" where   yydh='" + yydh + "'  and jzbh='" + jzbh_old + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        //更新收银消费明细里面的临时编号到new
                        strsql = new StringBuilder();
                        strsql.Append("update  Ssyxfmx set  lsbh='" + lsbh_new + "',jzbh=''   where  id>=0   and jzbh='" + jzbh_old + "'  and yydh='" + yydh + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        //更新转入的LSBH对应Szwzd的消费和付款金额
                        strsql = new StringBuilder();
                        strsql.Append("update Szwzd set  xfje=xfje+" + xfje_zz + ",fkje=fkje+" + fkje_zz + "  where id>=0 and lsbh='" + lsbh_new + "' and yydh='" + yydh + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        strsql = new StringBuilder();
                        strsql.Append("delete from  Sjzzd");
                        strsql.Append("  where  lsbh='" + lsbh_old + "' and jzbh='" + jzbh_old + "'  and yydh='" + yydh + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        strsql = new StringBuilder();
                        strsql.Append("delete from Sjzmx");
                        strsql.Append(" where   jzbh='" + jzbh_old + "'  and yydh='" + yydh + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        s = common_file.common_app.get_suc;
                    }
                }
            }


            #endregion


            #region //在住类型执行的操作
            if (Zz_Type == common_zw.zwzz_sk_sk || Zz_Type == common_zw.zwzz_sk_tt || Zz_Type == common_zw.zwzz_tt_sk || Zz_Type == common_zw.zwzz_tt_tt)
            {
                if (GetjzOrgjToZz_helper_InsertToSzwzz_mx(lsbh_old, jzbh_old, lsbh_new, krxm_old, krxm_new, fjbh_old, fjbh_new, "Szwmx", Zz_Type, czy, czsj, Zz_Type, yydh, zz_lsbh, czy_GUID) == common_file.common_app.get_suc)
                {
                    //在住的转帐(更新两边的Szwzd的消费金额)
                    //更新转入的LSBH对应Szwzd的消费和付款金额
                    strsql = new StringBuilder();
                    strsql.Append("update Szwzd set  xfje=xfje+" + xfje_zz + ",fkje=fkje+" + fkje_zz + "  where id>=0 and lsbh='" + lsbh_new + "' and yydh='" + yydh + "'");
                    B_common.ExecuteSql(strsql.ToString());

                    strsql = new StringBuilder();
                    strsql.Append("update Szwzd set  xfje=xfje-(" + xfje_zz + "),fkje=fkje-(" + fkje_zz + ")   where id>=0 and lsbh='" + lsbh_old + "' and yydh='" + yydh + "'");
                    B_common.ExecuteSql(strsql.ToString());


                    //更新收银消费明细里面的临时编号到new(注意,只能更新在Szw_zz_fj_temp里面的记录)
                    strsql = new StringBuilder();
                    strsql.Append("update  Ssyxfmx set  lsbh='" + lsbh_new + "',jzbh=''  where  id>=0  and  id_app  in (select id_app from Szw_zz_fj_temp where  lsbh='" + lsbh_old + "'  and  yydh='" + yydh + "')");
                    B_common.ExecuteSql(strsql.ToString());

                    //最后,删除Szw_zz_fj_temp,以及Szw_temp里面的临时数据
                    strsql = new StringBuilder();
                    strsql.Append("  delete from  Szw_zz_fj_temp   where  lsbh='" + lsbh_old + "'  and  yydh='" + yydh + "'");
                    B_common.ExecuteSql(strsql.ToString());

                    strsql = new StringBuilder();
                    strsql.Append(" delete from Szw_temp where lsbh='" + lsbh_old + "'  and yydh='" + yydh + "'");
                    B_common.ExecuteSql(strsql.ToString());

                    s = common_file.common_app.get_suc;
                }
            }
            #endregion

            if (s == common_file.common_app.get_suc)
            {
                DataSet ds_0 = B_common.GetList(" select * from Szwzz_mx ", " id>=0  and  yydh='" + yydh + "' and xfzy='" + zz_lsbh + "'");
                if (ds_0 != null && ds_0.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < ds_0.Tables[0].Rows.Count; i++)
                    {
                        B_common.ExecuteSql(" delete from Szw_union  where id>=0 and yydh='" + yydh + "'  and  union_bh in (select union_bh from Szw_union where id_app='" + ds_0.Tables[0].Rows[i]["id_app"].ToString() + "')");
                    }
                }
            }

            return(s);
        }
예제 #27
0
 public void update_s(BLL.Common B_Common, string update_nr, string yydh, string jzzt, string czy, string cssj, string jssj)
 {
     //B_Common.ExecuteSql("update BS_g_j_fx set zyye=zyye+'" + zyye.ToString() + "' where jzzt='" + jzzt + "' and yydh='" + yydh + "' and czy_temp='" + czy + "' and cssj='" + cssj + "' and jssj='" + jssj + "'");
     B_Common.ExecuteSql("update BS_g_j_fx " + update_nr + " where jzzt='" + jzzt + "' and yydh='" + yydh + "' and czy_temp='" + czy + "' and cssj='" + cssj + "' and jssj='" + jssj + "'");
 }
예제 #28
0
        //string lsbh, string jjType, string sk_tt, string czy, string czsj, string syzd, string czy_bc, string fkje, string xfje, string xxzs,string yydh)
        public string GetjzOrgzOrszToFjResult(string lsbh, string czzt, string sk_tt, string czy, string czsj, string syzd, string czy_bc, string fkje, string xfje, string xxzs, string yydh, string jzbh_old, string czy_GUID)
        {
            string s = common_app.get_failure;

            if (!czzt.Equals(common_app.pljz_flage))
            {
                if (czzt == common_file.common_jzzt.czzt_gz || czzt == common_file.common_jzzt.czzt_jzzgz)
                {
                    jzbh = common_file.common_ddbh.ddbh("gzfj", "jzdate", "jzcounter", 6);
                }
                if (czzt == common_file.common_jzzt.czzt_jz || czzt == common_file.common_jzzt.czzt_gzzjz)
                {
                    jzbh = common_file.common_ddbh.ddbh("jzfj", "jzdate", "jzcounter", 6);
                }
                if (czzt == common_file.common_jzzt.czzt_bfsz)
                {
                    jzbh = common_file.common_ddbh.ddbh("bfsz", "jzdate", "jzcounter", 6);
                }
                if (jzbh.Trim() != "")
                {
                    ds_temp = B_szw_temp.GetList("id>0  " + common_file.common_app.yydh_select + " and  lsbh='" + lsbh + "'  and czy_temp='" + czy_GUID + "'");
                    if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) //有消费记录
                    {
                        //更新Szw_temp里面的对应记录的jzbh
                        StringBuilder sb = new StringBuilder();
                        sb.Append("update Szw_temp  set  jzbh='" + jzbh + "'  where id>=0  " + common_file.common_app.yydh_select + "    and czy_temp='" + czy_GUID + "'");
                        if (B_common.ExecuteSql(sb.ToString()) > 0)//修改成功
                        {
                            ds_temp = B_szw_temp.GetList("id>0  " + common_file.common_app.yydh_select + "   and czy_temp='" + czy_GUID + "'");
                            //common_file.common_sswl.Round_sswl(double.Parse(DS_temp.Tables[0].Rows[0]["fjjg"].ToString()), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString();
                            //计算出xfje和fkje
                            if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                            {
                                for (int i = 0; i < ds_temp.Tables[0].Rows.Count; i++)
                                {
                                    if (ds_temp.Tables[0].Rows[i]["xfxm"].ToString() == common_app.dj_ysk || ds_temp.Tables[0].Rows[i]["xfxm"].ToString() == common_app.dj_pzsk)
                                    {
                                        fkje_temp += decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(ds_temp.Tables[0].Rows[i]["sjxfje"].ToString()), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                                    }
                                    else
                                    {
                                        xfje_temp += decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(ds_temp.Tables[0].Rows[i]["sjxfje"].ToString()), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                                    }
                                }
                            }
                            //fkje
                            fkje = Math.Abs(fkje_temp).ToString();//最终的付款金额(用绝对值存储)

                            //xfje
                            xfje = xfje_temp.ToString();
                            //GetInfo_xydw(lsbh, yydh, sk_tt, czzt, ref xydw, ref krly);

                            //帐务操作处理
                            if (Pladd(lsbh, jzbh_old, sk_tt, jzbh, yydh, czsj, syzd, czy, czy_bc, czzt, fkje, xfje, xxzs, ds_temp, czy_GUID) == common_app.get_suc)
                            {
                                s = common_file.common_app.get_suc;
                            }
                        }
                    }
                }
            }
            if (czzt.Equals(common_app.pljz_flage))
            {
                if (Pladd(lsbh, jzbh_old, sk_tt, jzbh, yydh, czsj, syzd, czy, czy_bc, czzt, fkje, xfje, xxzs, ds_temp, czy_GUID) == common_app.get_suc)
                {
                    s = common_file.common_app.get_suc;
                }
            }
            common_file.common_czjl.add_czjl(yydh, "", czy, lsbh + "下的帐务当前分结掉金额为:" + xfje_temp, "当前的分结状态为:" + czzt, "分结的结果为:" + s, DateTime.Now);
            return(s);
        }
예제 #29
0
        public void dr_fx_dd_lk_add(string yydh, string qymc, BLL.Common B_Common, string zyzt, Decimal zyfs, Decimal zyrs, string table_name, string czy)
        {
            string insert_s = "insert into " + table_name + "(yydh,qymc,zyzt,zyfs,zyrs,czy) values ('" + yydh + "','" + qymc + "','" + zyzt + "','" + zyfs + "','" + zyrs + "','" + czy + "')";

            B_Common.ExecuteSql(insert_s);
        }
예제 #30
0
        private void sfz_zl_fj(string id)
        {
            common_file.common_app.get_czsj();
            if (dg_sk.CurrentRow != null)
            {
                int         j_0000 = 0;
                DataRowView dgr    = dg_sk.CurrentRow.DataBoundItem as DataRowView;
                j_0000 = DS_Qsk.Tables[0].Rows.IndexOf(dgr.Row);

                DataSet DS_temp = B_Common.GetList("select * from Q_sfz_temp", "id='" + id + "' and shcl=0");
                if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0 && dg_sk.CurrentRow != null && dg_count_sk > 0 && dg_sk.CurrentRow.Index < dg_count_sk && DS_Qsk != null && DS_Qsk.Tables[0].Rows[j_0000]["id"].ToString() != "")
                {
                    if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "确定是否要把客人 " + DS_temp.Tables[0].Rows[0]["krxm"].ToString() + " 转入房间 " + DS_Qsk.Tables[0].Rows[dg_sk.CurrentRow.Index]["fjbh"].ToString() + "?") == true)
                    {
                        common_file.common_app.get_czsj();
                        string add_edit = "";
                        string main_sec = "";

                        if (DS_Qsk.Tables[0].Rows[j_0000]["zjhm"].ToString() == "")
                        {
                            add_edit = common_file.common_app.get_edit;
                            main_sec = common_file.common_app.main_sec_main;
                        }
                        else
                        {
                            //string s_0=" fjbh='" + DS_Qsk.Tables[0].Rows[dg_sk.CurrentRow.Index]["fjbh"].ToString() + "' and zjhm='" + DS_temp.Tables[0].Rows[0]["zjhm"].ToString() + "'";
                            DataSet DS_temp_2 = B_Common.GetList("select * from Qskyd_mainrecord", "zjhm='" + DS_temp.Tables[0].Rows[0]["zjhm"].ToString() + "' and (lsbh =(select lsbh from Qskyd_fjrb where fjbh='" + DS_Qsk.Tables[0].Rows[j_0000]["fjbh"].ToString() + "' and lsbh ='" + DS_Qsk.Tables[0].Rows[j_0000]["lsbh"].ToString() + "'))");
                            if (DS_temp_2 != null && DS_temp_2.Tables[0].Rows.Count > 0)
                            {
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "房间 " + DS_Qsk.Tables[0].Rows[dg_sk.CurrentRow.Index]["fjbh"].ToString() + " 已经存在同证件号码的客人了!");
                            }
                            else
                            {
                                add_edit = common_file.common_app.get_add;
                                main_sec = common_file.common_app.main_sec_sec;
                            }
                        }
                        if (add_edit != "")
                        {
                            string url = common_file.common_app.service_url + "Qyddj/Qyddj_app.asmx";
                            common_file.common_app.get_czsj();
                            string[] args = new string[56];
                            args[0]  = DS_Qsk.Tables[0].Rows[j_0000]["id"].ToString();
                            args[1]  = common_file.common_app.yydh;
                            args[2]  = common_file.common_app.qymc;
                            args[3]  = DS_Qsk.Tables[0].Rows[j_0000]["lsbh"].ToString();
                            args[4]  = DS_Qsk.Tables[0].Rows[j_0000]["ddbh"].ToString();
                            args[5]  = "";
                            args[6]  = "";
                            args[7]  = DS_temp.Tables[0].Rows[0]["krxm"].ToString();
                            args[8]  = DS_temp.Tables[0].Rows[0]["krxm"].ToString();
                            args[9]  = common_file.common_app.krgj_zg;
                            args[10] = DS_temp.Tables[0].Rows[0]["krmz"].ToString();
                            args[11] = common_file.common_app.yxzj_sfz;
                            args[12] = DS_temp.Tables[0].Rows[0]["zjhm"].ToString();
                            args[13] = DS_temp.Tables[0].Rows[0]["krxb"].ToString();
                            args[14] = DS_temp.Tables[0].Rows[0]["krsr"].ToString();
                            args[15] = DS_Qsk.Tables[0].Rows[j_0000]["krdh"].ToString();
                            args[16] = DS_Qsk.Tables[0].Rows[j_0000]["krsj"].ToString();
                            args[17] = DS_Qsk.Tables[0].Rows[j_0000]["krEmail"].ToString();
                            args[18] = DS_temp.Tables[0].Rows[0]["krdz"].ToString();
                            args[19] = ""; //籍贯
                            args[20] = DS_Qsk.Tables[0].Rows[j_0000]["krdw"].ToString();
                            args[21] = ""; //职业
                            args[22] = DS_Qsk.Tables[0].Rows[j_0000]["cxmd"].ToString();
                            args[23] = ""; //签证类型
                            args[24] = ""; //签证号码
                            args[25] = common_file.common_app.cssj;
                            args[26] = common_file.common_app.cssj;
                            args[27] = common_file.common_app.cssj;
                            args[28] = DS_Qsk.Tables[0].Rows[j_0000]["lzka"].ToString();
                            args[29] = DS_Qsk.Tables[0].Rows[j_0000]["krly"].ToString();
                            args[30] = DS_Qsk.Tables[0].Rows[j_0000]["xyh"].ToString();
                            args[31] = DS_Qsk.Tables[0].Rows[j_0000]["xydw"].ToString();
                            args[32] = DS_Qsk.Tables[0].Rows[j_0000]["xsy"].ToString();
                            args[33] = DS_Qsk.Tables[0].Rows[j_0000]["ddrx"].ToString();
                            args[34] = DS_Qsk.Tables[0].Rows[j_0000]["ddwz"].ToString();
                            args[35] = DS_Qsk.Tables[0].Rows[j_0000]["zyzt"].ToString();
                            args[36] = DS_Qsk.Tables[0].Rows[j_0000]["krrx"].ToString();
                            args[37] = DS_Qsk.Tables[0].Rows[j_0000]["kr_children"].ToString();
                            args[38] = DS_Qsk.Tables[0].Rows[j_0000]["ddsj"].ToString();
                            args[39] = DS_Qsk.Tables[0].Rows[j_0000]["lzts"].ToString();
                            args[40] = DS_Qsk.Tables[0].Rows[j_0000]["lksj"].ToString();
                            args[41] = DS_Qsk.Tables[0].Rows[j_0000]["qtyq"].ToString();
                            args[42] = common_file.common_app.czy;
                            args[43] = DateTime.Now.ToString();
                            args[44] = common_file.common_app.chinese_add;
                            args[45] = DS_Qsk.Tables[0].Rows[j_0000]["sktt"].ToString();
                            args[46] = DS_Qsk.Tables[0].Rows[j_0000]["yddj"].ToString();
                            args[47] = main_sec;
                            args[48] = "";
                            args[49] = common_file.common_app.syzd;
                            args[50] = DS_Qsk.Tables[0].Rows[j_0000]["vip_type"].ToString();
                            args[51] = DS_Qsk.Tables[0].Rows[j_0000]["tsyq"].ToString();
                            args[52] = add_edit;
                            args[53] = common_file.common_app.xxzs;
                            args[54] = DS_Qsk.Tables[0].Rows[j_0000]["ddly"].ToString();
                            args[55] = "";//会员卡号

                            Hotel_app.Server.Qyddj.Qyddj_add_edit_delete Qyddj_add_edit_delete_services = new Hotel_app.Server.Qyddj.Qyddj_add_edit_delete();
                            string result = Qyddj_add_edit_delete_services.Qskdj_add_edit_delete(args[0].ToString(),
                                                                                                 args[1].ToString(),
                                                                                                 args[2].ToString(),
                                                                                                 args[3].ToString(),
                                                                                                 args[4].ToString(),
                                                                                                 args[5].ToString(),
                                                                                                 args[6].ToString(),
                                                                                                 args[7].ToString(),
                                                                                                 args[8].ToString(),
                                                                                                 args[9].ToString(),
                                                                                                 args[10].ToString(),
                                                                                                 args[11].ToString(),
                                                                                                 args[12].ToString(),
                                                                                                 args[13].ToString(),
                                                                                                 args[14].ToString(),
                                                                                                 args[15].ToString(),
                                                                                                 args[16].ToString(),
                                                                                                 args[17].ToString(),
                                                                                                 args[18].ToString(),
                                                                                                 args[19].ToString(),
                                                                                                 args[20].ToString(),
                                                                                                 args[21].ToString(),
                                                                                                 args[22].ToString(),
                                                                                                 args[23].ToString(),
                                                                                                 args[24].ToString(),
                                                                                                 args[25].ToString(),
                                                                                                 args[26].ToString(),
                                                                                                 args[27].ToString(),
                                                                                                 args[28].ToString(),
                                                                                                 args[29].ToString(),
                                                                                                 args[30].ToString(),
                                                                                                 args[31].ToString(),
                                                                                                 args[32].ToString(),
                                                                                                 args[33].ToString(),
                                                                                                 args[34].ToString(),
                                                                                                 args[35].ToString(),
                                                                                                 args[36].ToString(),
                                                                                                 args[37].ToString(),
                                                                                                 args[38].ToString(),
                                                                                                 args[39].ToString(),
                                                                                                 args[40].ToString(),
                                                                                                 args[41].ToString(),
                                                                                                 args[42].ToString(),
                                                                                                 args[43].ToString(),
                                                                                                 args[44].ToString(),
                                                                                                 args[45].ToString(),
                                                                                                 args[46].ToString(),
                                                                                                 args[47].ToString(),
                                                                                                 args[48].ToString(),
                                                                                                 args[49].ToString(),
                                                                                                 args[50].ToString(),
                                                                                                 args[51].ToString(),
                                                                                                 args[52].ToString(),
                                                                                                 args[53].ToString(),
                                                                                                 args[54].ToString(),
                                                                                                 args[55].ToString()
                                                                                                 );


                            //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Qskdj_add_edit_delete", args);
                            common_file.common_app.get_czsj();
                            if (result != null && result == common_file.common_app.get_suc)
                            {
                                B_Common.ExecuteSql("update Q_sfz_temp set shcl=1,fjbh='" + DS_Qsk.Tables[0].Rows[j_0000]["fjbh"].ToString() + "' where id='" + id + "'");
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "转入成功");
                                Close();
                            }
                            else
                            {
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "转入失败");
                            }
                        }
                    }
                }
                DS_temp.Dispose();
            }
        }