예제 #1
0
        protected override Web.Com.XResp Execute()
        {
            x_coop coop = new x_coop();

            if (id > 0)
            {
                coop = DB.x_coop.SingleOrDefault(o => o.coop_id == id);
                if (coop == null)
                {
                    throw new XExcep("0x0005");
                }
            }
            coop.agent_id = agid;
            coop.house    = house;

            coop.room      = room;
            coop.hall      = hall;
            coop.toilet    = toilet;
            coop.livein    = livein;
            coop.build_age = build_age;
            coop.door_no   = hno.Trim() + " " + (string.IsNullOrEmpty(uno) ? "" : uno.Trim()) + " " + dno.Trim();
            coop.intime    = intime;

            coop.img_fx = img_fx;
            coop.img_sn = img_sn;
            coop.img_xq = img_xq;

            if (string.IsNullOrEmpty(coop.images))
            {
                cover = "";
            }
            else if (string.IsNullOrEmpty(cover))
            {
                cover = coop.images.Split(',')[0];
            }

            coop.cover = cover;

            coop.area     = area;
            coop.pay_way  = pay_way;
            coop.lea_way  = lea_way;
            coop.price    = price;
            coop.unit     = unit;
            coop.type     = type;
            coop.toward   = toward;
            coop.floor    = floor;
            coop.onfloor  = onfloor;
            coop.decorate = decorate;

            if (!string.IsNullOrEmpty(point))
            {
                var pt = point.Split(',');
                if (pt.Length == 2)
                {
                    coop.longitude = decimal.Parse(pt[0]);
                    coop.latitude  = decimal.Parse(pt[1]);
                }
            }

            coop.lea_room = lea_room;

            coop.config =
                GetReqParms("c1") + "," +
                GetReqParms("c2") + "," +
                GetReqParms("c3") + "," +
                GetReqParms("c4") + "," +
                GetReqParms("c5") + "," +
                GetReqParms("c6") + "," +
                GetReqParms("c7") + "," +
                GetReqParms("c8") + "," +
                GetReqParms("c9") + "," +
                GetReqParms("c10") + "," +
                GetReqParms("c11") + "," +
                GetReqParms("c12") + "," +
                GetReqParms("c13") + "," +
                GetReqParms("c14") + "," +
                GetReqParms("c15") + "," +
                GetReqParms("c16") + "," +
                GetReqParms("c17") + "," +
                GetReqParms("c18") + "," +
                GetReqParms("c19") + "," +
                GetReqParms("c20");

            coop.feiyong =
                GetReqParms("d1") + "," +
                GetReqParms("d2") + "," +
                GetReqParms("d3") + "," +
                GetReqParms("d4") + "," +
                GetReqParms("d5") + "," +
                GetReqParms("d6");

            coop.remark =
                GetReqParms("t1") + "," +
                GetReqParms("t2") + "," +
                GetReqParms("t3") + "," +
                GetReqParms("t4") + "," +
                GetReqParms("t5");

            coop.more = more;

            coop.time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            coop.region       = region;
            coop.businessarea = businessarea;

            if (coop.id == 0)
            {
                coop.status  = 1;
                coop.up_time = coop.time;
                DB.x_coop.InsertOnSubmit(coop);

                SubmitDBChanges();

                var rt = new x_rent()
                {
                    coop_id = coop.id,
                    z_time  = coop.time,// DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    status  = 1,
                    e_time  = intime,
                    z_price = price
                };

                DB.x_rent.InsertOnSubmit(rt);
            }

            var zf_id = ZufangSdk.PushCoop(coop);

            if (zf_id == 0)
            {
                Loger.Info("mgr.coop.save->租房数据推送失败");
            }
            coop.zf_id = zf_id;

            SubmitDBChanges();

            return(new XResp());
        }
예제 #2
0
파일: save.cs 프로젝트: lxyandy66/x.yfj
        protected override XResp Execute()
        {
            x_coop coop = new x_coop();

            if (id > 0)
            {
                coop = DB.x_coop.SingleOrDefault(o => o.coop_id == id);
                if (coop == null)
                {
                    throw new XExcep("0x0005");
                }
            }

            coop.house = house;

            coop.room      = room;
            coop.hall      = hall;
            coop.toilet    = toilet;
            coop.livein    = livein;
            coop.build_age = build_age;
            coop.door_no   = hno.Trim() + " " + (string.IsNullOrEmpty(uno) ? "" : uno.Trim()) + " " + dno.Trim();
            coop.intime    = intime;

            if (string.IsNullOrEmpty(coop.images))
            {
                cover = "";
            }
            else if (string.IsNullOrEmpty(cover))
            {
                cover = coop.images.Split(',')[0];
            }
            coop.cover = cover;

            coop.img_fx = img_fx;
            coop.img_sn = img_sn;
            coop.img_xq = img_xq;

            coop.area     = area;
            coop.pay_way  = pay_way;
            coop.lea_way  = lea_way;
            coop.price    = price;
            coop.unit     = unit;
            coop.type     = type;
            coop.toward   = toward;
            coop.floor    = floor;
            coop.onfloor  = onfloor;
            coop.decorate = decorate;

            if (!string.IsNullOrEmpty(point))
            {
                var pt = point.Split(',');
                if (pt.Length == 2)
                {
                    coop.longitude = decimal.Parse(pt[0]);
                    coop.latitude  = decimal.Parse(pt[1]);
                }
            }

            coop.lea_room = lea_room;

            if (!string.IsNullOrEmpty(cfgs))
            {
                var cs = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0".Split(',');
                foreach (var c in cfgs.Split(','))
                {
                    if (string.IsNullOrEmpty(c))
                    {
                        continue;
                    }
                    var i = int.Parse(c) - 1;
                    cs[i] = "1";
                }
                coop.config = string.Join(",", cs);// cs.Join(',');
            }

            if (!string.IsNullOrEmpty(fys))
            {
                var cs = "0,0,0,0,0,0".Split(',');
                foreach (var c in fys.Split(','))
                {
                    if (string.IsNullOrEmpty(c))
                    {
                        continue;
                    }
                    var i = int.Parse(c) - 1;
                    cs[i] = "1";
                }
                coop.feiyong = string.Join(",", cs);// cs.Join(',');
            }

            if (!string.IsNullOrEmpty(ms))
            {
                var cs = "0,0,0,0,0".Split(',');
                foreach (var c in ms.Split(','))
                {
                    if (string.IsNullOrEmpty(c))
                    {
                        continue;
                    }
                    var i = int.Parse(c) - 1;
                    cs[i] = "1";
                }
                coop.remark = string.Join(",", cs);// cs.Join(',');
            }

            coop.more = more;

            coop.time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            coop.region       = region;
            coop.businessarea = businessarea;

            if (coop.id == 0)
            {
                coop.agent_id = cag.id;
                coop.status   = 1;
                coop.up_time  = coop.time;
                DB.x_coop.InsertOnSubmit(coop);

                SubmitDBChanges();

                var rt = new x_rent()
                {
                    coop_id = coop.id,
                    z_time  = coop.time,// DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    status  = 1,
                    e_time  = intime,
                    z_price = price
                };

                DB.x_rent.InsertOnSubmit(rt);
            }
            else
            {
                var ret = coop.x_rent.LastOrDefault();
                if (ret != null)
                {
                    ret.e_time = coop.intime;
                }
            }

            var zf_id = ZufangSdk.PushCoop(coop);

            if (zf_id == 0)
            {
                Loger.Info("app.agent.coop.save->租房数据推送失败");
            }
            coop.zf_id = zf_id;

            SubmitDBChanges();

            return(new XResp());
        }