示例#1
0
        //注:分结时被调定的金额用sjxfje传过来
        public string Syjcz_add_edit(string id, string yydh, string qymc, string id_app, string jzbh, string lsbh, string krxm, string fjrb, string fjbh, string sktt, string xfrq, string xfsj,
                                     string czy, string xfdr, string xfrb, string xfxm, string xfbz, string xfzy, string fkfs, string xfje, string sjxfje, string czy_bc, string syzd, string add_edit_delete, string xxzs, string czsj)
        {
            string  s          = common_file.common_app.get_failure;
            decimal sjxfje_old = 0;//押金修改前的值

            BLL.Syjcz     B_Syjcz  = new Hotel_app.BLL.Syjcz();
            Model.Syjcz   M_Syjcz  = new Hotel_app.Model.Syjcz();
            BLL.Common    B_common = new Hotel_app.BLL.Common();
            StringBuilder strsql;

            if (xxzs == common_file.common_app.xxzs_xxvalue)
            {
            }
            if (xxzs == common_file.common_app.xxzs_zsvalue)
            {
            }
            if (add_edit_delete == common_file.common_app.get_add)
            {
                M_Syjcz.yydh   = yydh;
                M_Syjcz.qymc   = qymc;
                M_Syjcz.id_app = id_app;
                M_Syjcz.jzbh   = jzbh;
                M_Syjcz.lsbh   = lsbh;
                M_Syjcz.krxm   = krxm;
                M_Syjcz.fjrb   = fjrb;
                M_Syjcz.fjbh   = fjbh;
                M_Syjcz.sktt   = sktt;
                M_Syjcz.xfrq   = Convert.ToDateTime(xfrq);
                M_Syjcz.xfsj   = Convert.ToDateTime(xfsj);
                M_Syjcz.czy    = czy;
                M_Syjcz.xfdr   = xfdr;
                M_Syjcz.xfrb   = xfrb;
                M_Syjcz.xfxm   = xfxm;
                M_Syjcz.xfbz   = xfbz;
                M_Syjcz.xfzy   = xfzy;
                M_Syjcz.fkfs   = fkfs;
                M_Syjcz.xfje   = Convert.ToDecimal(xfje);
                M_Syjcz.sjxfje = Convert.ToDecimal(sjxfje);
                M_Syjcz.czy_bc = czy_bc;
                M_Syjcz.syzd   = syzd;

                if (B_Syjcz.Add(M_Syjcz) > 0)
                {
                    s = common_file.common_app.get_suc;

                    //2012-03-06 更新(Szwzd)
                    if (jzbh.Trim() == "")
                    {
                        strsql = new StringBuilder();
                        strsql.Append("update   Szwzd  set   fkje=fkje+" + M_Syjcz.xfje + "  where lsbh='" + lsbh + "'");
                        B_common.ExecuteSql(strsql.ToString());
                    }
                    if (jzbh.Trim() != "")
                    {
                        DataSet ds_temp_0 = B_common.GetList(" select * from Sjzzd ", " jzbh='" + jzbh + "'  and  yydh='" + yydh + "'");
                        if (ds_temp_0 != null)
                        {
                            string czzt_temp = ds_temp_0.Tables[0].Rows[0]["czzt"].ToString();
                            string xyh_0     = ds_temp_0.Tables[0].Rows[0]["xyh"].ToString();
                            string jzzt_0    = ds_temp_0.Tables[0].Rows[0]["jzzt"].ToString();
                            string tfsj_0    = ds_temp_0.Tables[0].Rows[0]["tfsj"].ToString();

                            B_common.ExecuteSql("  update  Syjcz  set  czzt='" + czzt_temp + "'   where   jzbh='" + jzbh + "'  and   id_app='" + id_app + "'  and  yydh='" + yydh + "'");

                            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,xyh,jzzt,fkfs,mxbh,tfsj) ");
                            strsql.Append(" values('" + yydh + "','" + qymc + "','" + id_app + "','" + jzbh + "','" + lsbh + "','" + krxm + "','" + fjrb + "','" + fjbh + "','" + sktt + "','" + xfrq + "','" + xfsj + "','" + czy + "','" + xfdr + "','" + xfrb + "','" + xfxm + "','" + xfbz + "','" + xfzy + "',0,'-" + xfje + "','','-" + sjxfje + "',1,0,'" + czy_bc + "','" + czzt_temp + "','" + xfsj + "','" + syzd + "','" + xyh_0 + "','" + jzzt_0 + "','" + fkfs + "','','" + tfsj_0 + "')");
                            B_common.ExecuteSql(strsql.ToString());

                            //strsql = new StringBuilder();
                            //strsql.Append("  insert  into  Sfkfssz(yydh,qymc,is_top,is_select,jzbh,jzzt,lsbh,fjbh,krxm,fkfs,xfdr,xfrb,xfxm,xfje,sjxfje,fkrq,fksj,xfrq,xfsj,czy,czy_bc,syzd,id_app)");
                            //strsql.Append("  values('" + yydh + "','" + qymc + "',0,0,'" + jzbh + "','" + krxm + "','" + lsbh + "','" + fjbh + "','" + krxm + "','" + fkfs + "','" + xfdr + "','" + xfrb + "','" + xfxm + "','" + xfje + "','" + sjxfje + "','" + xfrq + "','" + xfsj + "','" + xfrq + "','" + xfsj + "','" + czy + "','" + czy_bc + "','" + syzd + "','" + id_app + "')");
                            //B_common.ExecuteSql(strsql.ToString());

                            B_common.ExecuteSql("  update  Szwzd_bak set fkje=fkje+" + M_Syjcz.xfje + " where lsbh='" + lsbh + "'  and  jzbh='" + jzbh + "'");
                            B_common.ExecuteSql("  update  Sjzzd  set fkje=fkje+" + M_Syjcz.xfje + "  where lsbh='" + lsbh + "'  and jzbh='" + jzbh + "'");
                        }
                    }

                    common_file.common_czjl.add_czjl(yydh, qymc, czy, lsbh + "增加" + common_file.common_app.dj_ysk + ",金额为:" + sjxfje, common_file.common_app.dj_ysk, "收取押金的结果为:" + s, DateTime.Now);
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_edit)
            {
                M_Syjcz        = B_Syjcz.GetModel(Convert.ToInt32(id));
                sjxfje_old     = M_Syjcz.sjxfje;//缓存一下押金修改前的值
                M_Syjcz.yydh   = yydh;
                M_Syjcz.qymc   = qymc;
                M_Syjcz.id_app = id_app;
                M_Syjcz.jzbh   = jzbh;
                M_Syjcz.lsbh   = lsbh;
                M_Syjcz.krxm   = krxm;
                M_Syjcz.fjrb   = fjrb;
                M_Syjcz.fjbh   = fjbh;
                M_Syjcz.sktt   = sktt;
                M_Syjcz.xfrq   = Convert.ToDateTime(xfrq);
                M_Syjcz.xfsj   = Convert.ToDateTime(xfsj);
                M_Syjcz.czy    = czy;
                M_Syjcz.xfdr   = xfdr;
                M_Syjcz.xfrb   = xfrb;
                M_Syjcz.xfxm   = xfxm;
                M_Syjcz.xfbz   = xfbz;
                M_Syjcz.xfzy   = xfzy;
                M_Syjcz.fkfs   = fkfs;
                M_Syjcz.xfje   = Convert.ToDecimal(xfje);
                M_Syjcz.sjxfje = Convert.ToDecimal(sjxfje);
                M_Syjcz.czy_bc = czy_bc;
                M_Syjcz.syzd   = syzd;
                M_Syjcz.id     = int.Parse(id);
                //M_Syjcz.czzt = "";
                if (B_Syjcz.Update(M_Syjcz))
                {
                    s = common_file.common_app.get_suc;
                    //这个功能当前保留(暂时在前台屏敝掉了)
                    common_file.common_czjl.add_czjl(yydh, qymc, czy, "押金由" + sjxfje_old.ToString() + "分结时调定出" + sjxfje, "调定", "分结押金调定", DateTime.Now);
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_delete)
            {
                if (id != "")
                {
                    //退订押金或者预授权的时候要更新Szwzd
                    M_Syjcz = B_Syjcz.GetModel(Convert.ToInt32(id));
                    if (M_Syjcz.jzbh.Trim() == "")        //算帐,记帐,挂帐及在住的退订(退还没有生成jzbh时的押金的退订)
                    {
                        strsql = new StringBuilder();
                        strsql.Append("  update   Szwzd  set   fkje=fkje-'" + M_Syjcz.xfje + "'   where lsbh='" + M_Syjcz.lsbh + "'");
                        B_common.ExecuteSql(strsql.ToString());
                    }
                    //记帐,挂帐后的退订(记挂转结的时候)
                    if (M_Syjcz.jzbh.Trim() != "")
                    {
                        strsql = new StringBuilder();
                        strsql.Append(" update   Szwzd_bak  set   fkje=fkje-(" + M_Syjcz.sjxfje + ")  where    jzbh='" + M_Syjcz.jzbh + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        strsql = new StringBuilder();
                        strsql.Append("  insert into  Sjzzd_bak(yydh,qymc,jzbh,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,shsc)");
                        strsql.Append("  select  yydh,qymc,jzbh,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,shsc  from Sjzzd where  lsbh='" + M_Syjcz.lsbh + "'  and jzbh='" + M_Syjcz.jzbh + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        strsql = new StringBuilder();
                        strsql.Append(" update  Sjzzd Set  fkje=fkje-'" + M_Syjcz.xfje + "'  ,shsc=0  where   jzbh='" + M_Syjcz.jzbh + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        strsql = new StringBuilder();
                        strsql.Append("  insert  into   Sjzmx_bak(yydh,qymc,id_app,jzbh,lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,jjje,xfje,yh,sjxfje,xfsl,czy_bc,czzt,czsj,syzd,xyh,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,czy_bc,czzt,czsj,syzd,xyh,jzzt,fkfs from Sjzmx where id_app='" + M_Syjcz.id_app + "'  and  yydh='" + M_Syjcz.yydh + "'");
                        B_common.ExecuteSql(strsql.ToString());

                        strsql = new StringBuilder();
                        strsql.Append("  delete from Sjzmx where  id_app='" + M_Syjcz.id_app + "'  and yydh='" + M_Syjcz.yydh + "'");
                        B_common.ExecuteSql(strsql.ToString());
                    }
                    //退订时备份到Syjcz_temp中
                    strsql = new StringBuilder();
                    strsql.Append(" insert into Syjcz_temp(yydh,qymc,is_top,is_select,id_app,jzbh,lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,fkfs,xfje,sjxfje,czy_bc,shsc,syzd,czzt,czsj)");
                    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,fkfs,xfje,sjxfje,czy_bc,shsc,syzd,'" + common_file.common_app.get_delete + "','" + czsj + "'  from Syjcz ");
                    strsql.Append(" where  id='" + id + "'  and  yydh='" + yydh + "'");
                    B_common.ExecuteSql(strsql.ToString());


                    B_Syjcz.Delete(Convert.ToInt32(id));           //DEL时,由触发器来备份到bak中
                    s = common_file.common_app.get_suc;
                    common_file.common_czjl.add_czjl(yydh, qymc, czy, "押金退订", "押金退定", "押金退定,操作执行的结果为:" + s, DateTime.Now);
                }
            }
            return(s);
        }
示例#2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Hotel_app.Model.Syjcz model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Syjcz(");
            strSql.Append("yydh,qymc,is_top,is_select,id_app,jzbh,lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,fkfs,xfje,sjxfje,czy_bc,shsc,syzd,czzt)");
            strSql.Append(" values (");
            strSql.Append("@yydh,@qymc,@is_top,@is_select,@id_app,@jzbh,@lsbh,@krxm,@fjrb,@fjbh,@sktt,@xfrq,@xfsj,@czy,@xfdr,@xfrb,@xfxm,@xfbz,@xfzy,@fkfs,@xfje,@sjxfje,@czy_bc,@shsc,@syzd,@czzt)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@yydh",      SqlDbType.VarChar,    50),
                new SqlParameter("@qymc",      SqlDbType.VarChar,    50),
                new SqlParameter("@is_top",    SqlDbType.Bit,         1),
                new SqlParameter("@is_select", SqlDbType.Bit,         1),
                new SqlParameter("@id_app",    SqlDbType.VarChar,    50),
                new SqlParameter("@jzbh",      SqlDbType.VarChar,    50),
                new SqlParameter("@lsbh",      SqlDbType.VarChar,    50),
                new SqlParameter("@krxm",      SqlDbType.VarChar,    50),
                new SqlParameter("@fjrb",      SqlDbType.VarChar,    50),
                new SqlParameter("@fjbh",      SqlDbType.VarChar,    50),
                new SqlParameter("@sktt",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfrq",      SqlDbType.DateTime),
                new SqlParameter("@xfsj",      SqlDbType.DateTime),
                new SqlParameter("@czy",       SqlDbType.VarChar,    50),
                new SqlParameter("@xfdr",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfrb",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfxm",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfbz",      SqlDbType.VarChar,   200),
                new SqlParameter("@xfzy",      SqlDbType.VarChar,   200),
                new SqlParameter("@fkfs",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfje",      SqlDbType.Decimal,     9),
                new SqlParameter("@sjxfje",    SqlDbType.Decimal,     9),
                new SqlParameter("@czy_bc",    SqlDbType.VarChar,    50),
                new SqlParameter("@shsc",      SqlDbType.Bit,         1),
                new SqlParameter("@syzd",      SqlDbType.VarChar,    50),
                new SqlParameter("@czzt",      SqlDbType.VarChar, 50)
            };
            parameters[0].Value  = model.yydh;
            parameters[1].Value  = model.qymc;
            parameters[2].Value  = model.is_top;
            parameters[3].Value  = model.is_select;
            parameters[4].Value  = model.id_app;
            parameters[5].Value  = model.jzbh;
            parameters[6].Value  = model.lsbh;
            parameters[7].Value  = model.krxm;
            parameters[8].Value  = model.fjrb;
            parameters[9].Value  = model.fjbh;
            parameters[10].Value = model.sktt;
            parameters[11].Value = model.xfrq;
            parameters[12].Value = model.xfsj;
            parameters[13].Value = model.czy;
            parameters[14].Value = model.xfdr;
            parameters[15].Value = model.xfrb;
            parameters[16].Value = model.xfxm;
            parameters[17].Value = model.xfbz;
            parameters[18].Value = model.xfzy;
            parameters[19].Value = model.fkfs;
            parameters[20].Value = model.xfje;
            parameters[21].Value = model.sjxfje;
            parameters[22].Value = model.czy_bc;
            parameters[23].Value = model.shsc;
            parameters[24].Value = model.syzd;
            parameters[25].Value = model.czzt;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Hotel_app.Model.Syjcz model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Syjcz set ");
            strSql.Append("yydh=@yydh,");
            strSql.Append("qymc=@qymc,");
            strSql.Append("is_top=@is_top,");
            strSql.Append("is_select=@is_select,");
            strSql.Append("id_app=@id_app,");
            strSql.Append("jzbh=@jzbh,");
            strSql.Append("lsbh=@lsbh,");
            strSql.Append("krxm=@krxm,");
            strSql.Append("fjrb=@fjrb,");
            strSql.Append("fjbh=@fjbh,");
            strSql.Append("sktt=@sktt,");
            strSql.Append("xfrq=@xfrq,");
            strSql.Append("xfsj=@xfsj,");
            strSql.Append("czy=@czy,");
            strSql.Append("xfdr=@xfdr,");
            strSql.Append("xfrb=@xfrb,");
            strSql.Append("xfxm=@xfxm,");
            strSql.Append("xfbz=@xfbz,");
            strSql.Append("xfzy=@xfzy,");
            strSql.Append("fkfs=@fkfs,");
            strSql.Append("xfje=@xfje,");
            strSql.Append("sjxfje=@sjxfje,");
            strSql.Append("czy_bc=@czy_bc,");
            strSql.Append("shsc=@shsc,");
            strSql.Append("syzd=@syzd,");
            strSql.Append("czzt=@czzt");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@yydh",      SqlDbType.VarChar,    50),
                new SqlParameter("@qymc",      SqlDbType.VarChar,    50),
                new SqlParameter("@is_top",    SqlDbType.Bit,         1),
                new SqlParameter("@is_select", SqlDbType.Bit,         1),
                new SqlParameter("@id_app",    SqlDbType.VarChar,    50),
                new SqlParameter("@jzbh",      SqlDbType.VarChar,    50),
                new SqlParameter("@lsbh",      SqlDbType.VarChar,    50),
                new SqlParameter("@krxm",      SqlDbType.VarChar,    50),
                new SqlParameter("@fjrb",      SqlDbType.VarChar,    50),
                new SqlParameter("@fjbh",      SqlDbType.VarChar,    50),
                new SqlParameter("@sktt",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfrq",      SqlDbType.DateTime),
                new SqlParameter("@xfsj",      SqlDbType.DateTime),
                new SqlParameter("@czy",       SqlDbType.VarChar,    50),
                new SqlParameter("@xfdr",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfrb",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfxm",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfbz",      SqlDbType.VarChar,   200),
                new SqlParameter("@xfzy",      SqlDbType.VarChar,   200),
                new SqlParameter("@fkfs",      SqlDbType.VarChar,    50),
                new SqlParameter("@xfje",      SqlDbType.Decimal,     9),
                new SqlParameter("@sjxfje",    SqlDbType.Decimal,     9),
                new SqlParameter("@czy_bc",    SqlDbType.VarChar,    50),
                new SqlParameter("@shsc",      SqlDbType.Bit,         1),
                new SqlParameter("@syzd",      SqlDbType.VarChar,    50),
                new SqlParameter("@czzt",      SqlDbType.VarChar,    50),
                new SqlParameter("@id",        SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.yydh;
            parameters[1].Value  = model.qymc;
            parameters[2].Value  = model.is_top;
            parameters[3].Value  = model.is_select;
            parameters[4].Value  = model.id_app;
            parameters[5].Value  = model.jzbh;
            parameters[6].Value  = model.lsbh;
            parameters[7].Value  = model.krxm;
            parameters[8].Value  = model.fjrb;
            parameters[9].Value  = model.fjbh;
            parameters[10].Value = model.sktt;
            parameters[11].Value = model.xfrq;
            parameters[12].Value = model.xfsj;
            parameters[13].Value = model.czy;
            parameters[14].Value = model.xfdr;
            parameters[15].Value = model.xfrb;
            parameters[16].Value = model.xfxm;
            parameters[17].Value = model.xfbz;
            parameters[18].Value = model.xfzy;
            parameters[19].Value = model.fkfs;
            parameters[20].Value = model.xfje;
            parameters[21].Value = model.sjxfje;
            parameters[22].Value = model.czy_bc;
            parameters[23].Value = model.shsc;
            parameters[24].Value = model.syzd;
            parameters[25].Value = model.czzt;
            parameters[26].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Hotel_app.Model.Syjcz GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 id,yydh,qymc,is_top,is_select,id_app,jzbh,lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,fkfs,xfje,sjxfje,czy_bc,shsc,syzd,czzt from Syjcz ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;

            Hotel_app.Model.Syjcz model = new Hotel_app.Model.Syjcz();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"] != null && ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["yydh"] != null && ds.Tables[0].Rows[0]["yydh"].ToString() != "")
                {
                    model.yydh = ds.Tables[0].Rows[0]["yydh"].ToString();
                }
                if (ds.Tables[0].Rows[0]["qymc"] != null && ds.Tables[0].Rows[0]["qymc"].ToString() != "")
                {
                    model.qymc = ds.Tables[0].Rows[0]["qymc"].ToString();
                }
                if (ds.Tables[0].Rows[0]["is_top"] != null && ds.Tables[0].Rows[0]["is_top"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["is_top"].ToString() == "1") || (ds.Tables[0].Rows[0]["is_top"].ToString().ToLower() == "true"))
                    {
                        model.is_top = true;
                    }
                    else
                    {
                        model.is_top = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["is_select"] != null && ds.Tables[0].Rows[0]["is_select"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["is_select"].ToString() == "1") || (ds.Tables[0].Rows[0]["is_select"].ToString().ToLower() == "true"))
                    {
                        model.is_select = true;
                    }
                    else
                    {
                        model.is_select = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["id_app"] != null && ds.Tables[0].Rows[0]["id_app"].ToString() != "")
                {
                    model.id_app = ds.Tables[0].Rows[0]["id_app"].ToString();
                }
                if (ds.Tables[0].Rows[0]["jzbh"] != null && ds.Tables[0].Rows[0]["jzbh"].ToString() != "")
                {
                    model.jzbh = ds.Tables[0].Rows[0]["jzbh"].ToString();
                }
                if (ds.Tables[0].Rows[0]["lsbh"] != null && ds.Tables[0].Rows[0]["lsbh"].ToString() != "")
                {
                    model.lsbh = ds.Tables[0].Rows[0]["lsbh"].ToString();
                }
                if (ds.Tables[0].Rows[0]["krxm"] != null && ds.Tables[0].Rows[0]["krxm"].ToString() != "")
                {
                    model.krxm = ds.Tables[0].Rows[0]["krxm"].ToString();
                }
                if (ds.Tables[0].Rows[0]["fjrb"] != null && ds.Tables[0].Rows[0]["fjrb"].ToString() != "")
                {
                    model.fjrb = ds.Tables[0].Rows[0]["fjrb"].ToString();
                }
                if (ds.Tables[0].Rows[0]["fjbh"] != null && ds.Tables[0].Rows[0]["fjbh"].ToString() != "")
                {
                    model.fjbh = ds.Tables[0].Rows[0]["fjbh"].ToString();
                }
                if (ds.Tables[0].Rows[0]["sktt"] != null && ds.Tables[0].Rows[0]["sktt"].ToString() != "")
                {
                    model.sktt = ds.Tables[0].Rows[0]["sktt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["xfrq"] != null && ds.Tables[0].Rows[0]["xfrq"].ToString() != "")
                {
                    model.xfrq = DateTime.Parse(ds.Tables[0].Rows[0]["xfrq"].ToString());
                }
                if (ds.Tables[0].Rows[0]["xfsj"] != null && ds.Tables[0].Rows[0]["xfsj"].ToString() != "")
                {
                    model.xfsj = DateTime.Parse(ds.Tables[0].Rows[0]["xfsj"].ToString());
                }
                if (ds.Tables[0].Rows[0]["czy"] != null && ds.Tables[0].Rows[0]["czy"].ToString() != "")
                {
                    model.czy = ds.Tables[0].Rows[0]["czy"].ToString();
                }
                if (ds.Tables[0].Rows[0]["xfdr"] != null && ds.Tables[0].Rows[0]["xfdr"].ToString() != "")
                {
                    model.xfdr = ds.Tables[0].Rows[0]["xfdr"].ToString();
                }
                if (ds.Tables[0].Rows[0]["xfrb"] != null && ds.Tables[0].Rows[0]["xfrb"].ToString() != "")
                {
                    model.xfrb = ds.Tables[0].Rows[0]["xfrb"].ToString();
                }
                if (ds.Tables[0].Rows[0]["xfxm"] != null && ds.Tables[0].Rows[0]["xfxm"].ToString() != "")
                {
                    model.xfxm = ds.Tables[0].Rows[0]["xfxm"].ToString();
                }
                if (ds.Tables[0].Rows[0]["xfbz"] != null && ds.Tables[0].Rows[0]["xfbz"].ToString() != "")
                {
                    model.xfbz = ds.Tables[0].Rows[0]["xfbz"].ToString();
                }
                if (ds.Tables[0].Rows[0]["xfzy"] != null && ds.Tables[0].Rows[0]["xfzy"].ToString() != "")
                {
                    model.xfzy = ds.Tables[0].Rows[0]["xfzy"].ToString();
                }
                if (ds.Tables[0].Rows[0]["fkfs"] != null && ds.Tables[0].Rows[0]["fkfs"].ToString() != "")
                {
                    model.fkfs = ds.Tables[0].Rows[0]["fkfs"].ToString();
                }
                if (ds.Tables[0].Rows[0]["xfje"] != null && ds.Tables[0].Rows[0]["xfje"].ToString() != "")
                {
                    model.xfje = decimal.Parse(ds.Tables[0].Rows[0]["xfje"].ToString());
                }
                if (ds.Tables[0].Rows[0]["sjxfje"] != null && ds.Tables[0].Rows[0]["sjxfje"].ToString() != "")
                {
                    model.sjxfje = decimal.Parse(ds.Tables[0].Rows[0]["sjxfje"].ToString());
                }
                if (ds.Tables[0].Rows[0]["czy_bc"] != null && ds.Tables[0].Rows[0]["czy_bc"].ToString() != "")
                {
                    model.czy_bc = ds.Tables[0].Rows[0]["czy_bc"].ToString();
                }
                if (ds.Tables[0].Rows[0]["shsc"] != null && ds.Tables[0].Rows[0]["shsc"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["shsc"].ToString() == "1") || (ds.Tables[0].Rows[0]["shsc"].ToString().ToLower() == "true"))
                    {
                        model.shsc = true;
                    }
                    else
                    {
                        model.shsc = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["syzd"] != null && ds.Tables[0].Rows[0]["syzd"].ToString() != "")
                {
                    model.syzd = ds.Tables[0].Rows[0]["syzd"].ToString();
                }
                if (ds.Tables[0].Rows[0]["czzt"] != null && ds.Tables[0].Rows[0]["czzt"].ToString() != "")
                {
                    model.czzt = ds.Tables[0].Rows[0]["czzt"].ToString();
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#5
0
        string krly_temp = "";//

        //押金操作(以经放到服务端执行)
        public string Syjcz_add_edit(string id, string yydh, string qymc, string id_app, string jzbh, string lsbh, string krxm, string fjrb, string fjbh, string sktt, string xfrq, string xfsj,
                                     string czy, string xfdr, string xfrb, string xfxm, string xfbz, string xfzy, string fkfs, string xfje, string sjxfje, string czy_bc, string syzd, string add_edit_delete, string xxzs)
        {
            string s = common_file.common_app.get_failure;

            M_Syjcz = new Hotel_app.Model.Syjcz();
            if (xxzs == common_file.common_app.xxzs_xxvalue)
            {
            }
            if (xxzs == common_file.common_app.xxzs_zsvalue)
            {
            }
            if (add_edit_delete == common_file.common_app.get_add)
            {
                M_Syjcz.yydh   = yydh;
                M_Syjcz.qymc   = qymc;
                M_Syjcz.id_app = id_app;
                M_Syjcz.jzbh   = jzbh;
                M_Syjcz.lsbh   = lsbh;
                M_Syjcz.krxm   = krxm;
                M_Syjcz.fjrb   = fjrb;
                M_Syjcz.fjbh   = fjbh;
                M_Syjcz.sktt   = sktt;
                M_Syjcz.xfrq   = Convert.ToDateTime(xfrq);
                M_Syjcz.xfsj   = Convert.ToDateTime(xfsj);
                M_Syjcz.czy    = czy;
                M_Syjcz.xfdr   = xfdr;
                M_Syjcz.xfrb   = xfrb;
                M_Syjcz.xfxm   = xfxm;
                M_Syjcz.xfbz   = xfbz;
                M_Syjcz.xfzy   = xfzy;
                M_Syjcz.fkfs   = fkfs;
                M_Syjcz.xfje   = Convert.ToDecimal(xfje);
                M_Syjcz.sjxfje = Convert.ToDecimal(sjxfje);
                M_Syjcz.czy_bc = czy_bc;
                M_Syjcz.syzd   = syzd;

                if (B_Syjcz.Add(M_Syjcz) > 0)
                {
                    s = common_file.common_app.get_suc;
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_edit)
            {
                M_Syjcz        = B_Syjcz.GetModel(Convert.ToInt32(id));
                M_Syjcz.yydh   = yydh;
                M_Syjcz.qymc   = qymc;
                M_Syjcz.id_app = id_app;
                M_Syjcz.jzbh   = jzbh;
                M_Syjcz.lsbh   = lsbh;
                M_Syjcz.krxm   = krxm;
                M_Syjcz.fjrb   = fjrb;
                M_Syjcz.fjbh   = fjbh;
                M_Syjcz.sktt   = sktt;
                M_Syjcz.xfrq   = Convert.ToDateTime(xfrq);
                M_Syjcz.xfsj   = Convert.ToDateTime(xfsj);
                M_Syjcz.czy    = czy;
                M_Syjcz.xfdr   = xfdr;
                M_Syjcz.xfrb   = xfrb;
                M_Syjcz.xfxm   = xfxm;
                M_Syjcz.xfbz   = xfbz;
                M_Syjcz.xfzy   = xfzy;
                M_Syjcz.fkfs   = fkfs;
                M_Syjcz.xfje   = Convert.ToDecimal(xfje);
                M_Syjcz.sjxfje = Convert.ToDecimal(sjxfje);
                M_Syjcz.czy_bc = czy_bc;
                M_Syjcz.syzd   = syzd;
                M_Syjcz.id     = int.Parse(id);
                if (B_Syjcz.Update(M_Syjcz))
                {
                    s = common_file.common_app.get_suc;
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_delete)
            {
                if (id != "")
                {
                    B_Syjcz.Delete(Convert.ToInt32(id));
                    s = common_file.common_app.get_suc;
                }
            }
            return(s);
        }