Ejemplo n.º 1
0
        private void b_new_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (common_file.common_roles.get_user_qx("B_ftcx_xz", common_file.common_app.user_type) == false)
            {
                return;
            }

            Ffjzt.Ffjzt_add_edit Ffjzt_add_edit_new = new Ffjzt_add_edit(this);
            Ffjzt_add_edit_new.Left           = common_file.common_app.x();
            Ffjzt_add_edit_new.Top            = common_file.common_app.y();
            Ffjzt_add_edit_new.judge_add_edit = common_file.common_app.get_add;
            Ffjzt_add_edit_new.ShowDialog();
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 2
0
        private void b_amend_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (common_file.common_roles.get_user_qx("B_ftcx_xg", common_file.common_app.user_type) == false)
            {
                return;
            }
            if (dataGridViewSummary1.CurrentRow != null)
            {
                int         i   = dataGridViewSummary1.CurrentRow.Index;
                DataRowView dgr = dataGridViewSummary1.CurrentRow.DataBoundItem as DataRowView;
                i = DS_Ffjzt.Tables[0].Rows.IndexOf(dgr.Row);



                if (DS_Ffjzt.Tables[0].Rows[i]["id"].ToString() != "")
                {
                    Ffjzt.Ffjzt_add_edit Ffjzt_add_edit_new = new Ffjzt_add_edit(this);
                    Ffjzt_add_edit_new.Left              = common_file.common_app.x();
                    Ffjzt_add_edit_new.Top               = common_file.common_app.y();
                    Ffjzt_add_edit_new.judge_add_edit    = common_file.common_app.get_edit;
                    Ffjzt_add_edit_new.Ffjzt_id          = DS_Ffjzt.Tables[0].Rows[i]["ID"].ToString();
                    Ffjzt_add_edit_new.get_fjrb_code     = DS_Ffjzt.Tables[0].Rows[i]["fjrb_code"].ToString();
                    Ffjzt_add_edit_new.tB_bz.Text        = DS_Ffjzt.Tables[0].Rows[i]["bz"].ToString();
                    Ffjzt_add_edit_new.tB_dhfj.Text      = DS_Ffjzt.Tables[0].Rows[i]["dhfj"].ToString();
                    Ffjzt_add_edit_new.tB_fjbh.Text      = DS_Ffjzt.Tables[0].Rows[i]["fjbh"].ToString();
                    Ffjzt_add_edit_new.tB_fjdh.Text      = DS_Ffjzt.Tables[0].Rows[i]["fjdh"].ToString();
                    Ffjzt_add_edit_new.tB_fjrb.Text      = DS_Ffjzt.Tables[0].Rows[i]["fjrb"].ToString();
                    Ffjzt_add_edit_new.tB_jdcs.Text      = DS_Ffjzt.Tables[0].Rows[i]["jdcs"].ToString();
                    Ffjzt_add_edit_new.tB_jdcs_name.Text = DS_Ffjzt.Tables[0].Rows[i]["jdcs_name"].ToString();
                    Ffjzt_add_edit_new.tB_jdlh.Text      = DS_Ffjzt.Tables[0].Rows[i]["jdlh"].ToString();
                    Ffjzt_add_edit_new.tB_jdlh_name.Text = DS_Ffjzt.Tables[0].Rows[i]["jdlh_name"].ToString();
                    Ffjzt_add_edit_new.ShowDialog();
                }
            }
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 结帐时的批量帐务处理
        ///
        /// </summary>
        /// 先写入Sjzzd,同时写sjzmx,Ffkfssz
        /// 写入成功后,将zwmx里面的对应的记录写入到zwmx_bak,并删除当前lsbh对应下的zwmx记录
        public static string Pladd(string lsbh, string jzbh, string xydw, string krly, string czsj, string syzd, string czy, string czy_bc, string jzzt, string cznr, string bz, string fkje, string xfje, string xxzs)
        {
            //修改房态时用到的变量
            string id = "";//主单的ID

            //
            Ffjzt.Ffjzt_add_edit             Ffjzt_add_edit_new = new Hotel_app.Ffjzt.Ffjzt_add_edit(); //用于修改房态
            BLL.Ffjzt                        B_Ffjzt            = new Hotel_app.BLL.Ffjzt();            //修改房态
            Hotel_app.BLL.Qskyd_fjrb         B_Qskyd_fjrb       = new Hotel_app.BLL.Qskyd_fjrb();
            Hotel_app.Model.Qskyd_mainrecord M_Qskyd_mainrecord;
            Hotel_app.BLL.Qskyd_mainrecord   B_Qskyd_mainrecord = new Hotel_app.BLL.Qskyd_mainrecord();

            Hotel_app.Server.Qyddj.Qyddj_add_edit_delete Qyddj_add_edit_delete_new = new Hotel_app.Server.Qyddj.Qyddj_add_edit_delete();//房态及删除主单操作


            string        s      = common_app.get_failure;
            StringBuilder strSql = new StringBuilder();//注意jzzd只写入一次(公共信息查一次就好)

            strSql.Append("insert into Sjzzd(yydh,qymc,lsbh,jzbh,krxm,sktt,fjbh,xydw,krly,tfsj,czsj,czy,czzt,jzzt,syzd,bz,fkje,xfje)");
            strSql.Append(" select top 1 yydh,qymc,'" + lsbh + "',jzbh,krxm,sktt,fjbh,'" + xydw + "','" + krly + "','" + DateTime.Now + "','" + czsj + "','" + czy + "','" + common_file.common_jzzt.czzt_sz + "','" + common_file.common_jzzt.czzt_sz + "','" + syzd + "','" + bz + "','" + fkje + "','" + xfje + "'  from Szw_temp");
            strSql.Append(" where lsbh='" + lsbh + "' and  czy_temp='" + czy + "'");
            BLL.Common B_common = new Hotel_app.BLL.Common();
            if (B_common.ExecuteSql(strSql.ToString()) > 0)//写入主单成功后,写入jzmx
            {
                strSql = new StringBuilder();
                strSql.Append("insert into Sjzmx(yydh,qymc,id_app,jzbh,lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,jjje,xfje,yh,sjxfje,xfsl,shsc,czy_bc,czzt,czsj,syzd,jzzt,fkfs ) ");
                strSql.Append(" select yydh,qymc,id_app,jzbh,'" + lsbh + "',krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,jjje,xfje,yh,sjxfje,xfsl,shsc,'" + czy_bc + "','" + jzzt + "','" + czsj + "','" + syzd + "','" + jzzt + "',fkfs  from Szw_temp");
                strSql.Append(" where lsbh='" + lsbh + "' and  czy_temp='" + czy + "'");
                if (B_common.ExecuteSql(strSql.ToString()) > 0)//写入jzmx成功后,
                {
                    //提取fkdr为付款的项目写入Ffkfssz
                    strSql = new StringBuilder();
                    strSql.Append("insert into Sfkfssz(yydh,qymc,jzbh,jzzt,lsbh,fjbh,krxm,fkfs,xfdr,xfrb,xfxm,xfje,sjxfje,fkrq,fksj,xfrq,xfsj,czy,czy_bc,syzd)");
                    strSql.Append(" select yydh,qymc,jzhb,'" + jzzt + "',lsbh,fjbh,krxm,fkfs,xfdr,xfxm,xfje,sjxfje,fkrq,fksj,xfrq,xfsj,czy,czy_bc,syzd from Szw_temp");
                    strSql.Append(" where lsbh='" + lsbh + "'  and czy_temp='" + czy + "'  and  xfdr='" + common_app.fkdr + "'");

                    //删除zwmx里面此lsbh对应的帐务(同时通过zwmx上面的触发器来写入到zwmx_bak里面)
                    strSql = new StringBuilder();
                    strSql.Append("update  Szwmx  set  jzbh='" + jzbh + "'  where id>0  " + common_file.common_app.yydh_select + "  and  lsbh='" + lsbh + "'");
                    if (B_common.ExecuteSql(strSql.ToString()) > 0)//更新成功
                    {
                        strSql = new StringBuilder();
                        strSql.Append("delete from Szwmx  where id>0  " + common_file.common_app.yydh_select + "  and  lsbh='" + lsbh + "'");
                        //删除的时候根据删除的触发器写入到对应的bak表中

                        if (B_common.ExecuteSql(strSql.ToString()) > 0)
                        {
                            //先更新押金操作表里面的jzbh,再删除yjcz表里面对应的记录,并写入其bak,写入Ffkfssz
                            strSql = new StringBuilder();
                            strSql.Append("update Syjcz  set jzbh='" + jzbh + "'  where id>0 " + common_app.yydh_select + "  and  lsbh='" + lsbh + "'");
                            if (B_common.ExecuteSql(strSql.ToString()) > 0)  //押金更新成功
                            {
                                if (jzzt == common_file.common_jzzt.czzt_sz) //算帐
                                {
                                    strSql = new StringBuilder();
                                    strSql.Append("delete from Syjcz where id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'");
                                    if (B_common.ExecuteSql(strSql.ToString()) > 0)
                                    {
                                        //清除Szw_temp
                                        strSql = new StringBuilder();
                                        strSql.Append("delete from Szw_temp  where  id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'");
                                        if (B_common.ExecuteSql(strSql.ToString()) > 0) //清除Szw_temp里面的数据了
                                        {
                                            //调用修改房态的方法(第五步)
                                            M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'")[0];
                                            id = M_Qskyd_mainrecord.id.ToString();

                                            //删除主单并记录(这里有包含主单记录删除时的备份)
                                            if (Qyddj_add_edit_delete_new.delete_sz_xgft(id, "jz", common_file.common_jzzt.czzt_sz, "", jzbh, czy, czsj, xxzs) == common_app.get_suc)
                                            {
                                                s = common_app.get_suc;
                                            }
                                        }
                                    }
                                }
                                else if (jzzt == common_file.common_jzzt.czzt_gz || jzzt == common_file.common_jzzt.czzt_jz)//挂帐或者记帐
                                {
                                    strSql = new StringBuilder();
                                    strSql.Append("delete from Szw_temp  where  id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'");
                                    if (B_common.ExecuteSql(strSql.ToString()) > 0) //清除Szw_temp里面的数据了
                                    {
                                        //调用修改房态的方法(第五步)
                                        M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'")[0];
                                        id = M_Qskyd_mainrecord.id.ToString();

                                        //删除主单并记录(这里有包含主单记录删除时的备份)
                                        if (Qyddj_add_edit_delete_new.delete_sz_xgft(id, "jz", jzzt, "", jzbh, czy, czsj, xxzs) == common_app.get_suc)
                                        {
                                            s = common_app.get_suc;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(s);
        }