コード例 #1
0
    protected void save_Click(object sender, EventArgs e)
    {
        int       houseId   = (int)Session["houseId"];
        ArrayList al        = new ArrayList();
        string    photo     = "";
        string    headPhoto = "";

        if (Session["fileList"] != null)
        {
            al = (ArrayList)Session["fileList"];
            foreach (string photoPath in al)
            {
                photo += photoPath + ";";
            }
            headPhoto = (string)al[0];
        }

        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.HOUSE_INFO
                                 where r.houseId == houseId
                                 select r;
        HOUSE_INFO house = result.FirstOrDefault();

        house.photo     = photo;
        house.headPhoto = headPhoto;
        lqdb.SubmitChanges();
        nextStep();
        Response.Redirect("~/housePublish6.aspx");
    }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //Session.Clear();
     //addImage();
     if (!IsPostBack)
     {
         stepCheck();
         int             houseId = (int)Session["houseId"];
         GoatDataContext lqdb    = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
         var             result  = from r in lqdb.HOUSE_INFO
                                   where r.houseId == houseId
                                   select r;
         HOUSE_INFO house = result.FirstOrDefault();
         Session["fileList"] = null;
         if (house.photo != null)
         {
             string[]  photo = house.photo.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
             ArrayList al    = new ArrayList();
             for (int i = 0; i < photo.Length; i++)
             {
                 al.Add(photo[i]);
             }
             Session["fileList"] = al;
         }
     }
     addImage();
 }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         stepCheck();
         int             houseId = (int)Session["houseId"];
         GoatDataContext lqdb    = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
         var             result  = from r in lqdb.HOUSE_INFO
                                   where r.houseId == houseId
                                   select r;
         HOUSE_INFO house     = result.FirstOrDefault();
         string     cellphone = "";
         string     weixin    = "";
         if (house.cellphone != null)
         {
             cellphone           = (string)house.cellphone;
             this.cellphone.Text = cellphone;
         }
         if (house.weixin != null)
         {
             weixin           = (string)house.weixin;
             this.weixin.Text = weixin;
         }
     }
 }
コード例 #4
0
    protected void next8_Click(object sender, EventArgs e)
    {
        int    houseId = (int)Session["houseId"];
        string start   = this.datetimepickerStart.Value.ToString();
        string end     = this.datetimepickerStop.Value.ToString();

        if ((start == null) || (end == null) || (string.Compare(start, end) > 0))
        {
            Response.Write("<script>alert('时间输入有误')</script>");
        }
        else
        {
            GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
            var             result = from r in lqdb.HOUSE_INFO
                                     where r.houseId == houseId
                                     select r;
            foreach (HOUSE_INFO h in result)
            {
                h.startDate = start;
                h.endDate   = end;
            }
            lqdb.SubmitChanges();
            nextStep();
            Response.Redirect("~/housePublish9.aspx");
        }
    }
コード例 #5
0
ファイル: addComment.aspx.cs プロジェクト: jjkobe/goat
    protected void Button2_Click(object sender, EventArgs e)
    {
        int             houseId    = (int)Session["houseId"];
        int             customerId = (int)Session["customerId"];
        string          content    = comment.Text.ToString();
        GoatDataContext lqdb       = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result     = from r in lqdb.COMMENT
                                     where r.houseId == houseId
                                     select r;
        COMMENT com = new COMMENT();

        com.houseId        = houseId;
        com.commentContent = content;
        com.commentId      = customerId;
        string pis = getHeadPicById(customerId);

        com.photo = pis;
        string date = DateTime.Now.ToString();

        com.commentDate = date;
        lqdb.COMMENT.InsertOnSubmit(com);
        lqdb.SubmitChanges();
        Response.Write("<script>alert('评论已经成功提交')</script>");
        Response.Redirect("~/historyOrder.aspx");
    }
コード例 #6
0
ファイル: addComment.aspx.cs プロジェクト: jjkobe/goat
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Session["houseId"] = 3;
         int             houseId    = (int)Session["houseId"];
         int             customerId = (int)Session["customerId"];
         GoatDataContext lqdb       = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
         var             result     = from r in lqdb.HOUSE_INFO
                                      where r.houseId == houseId
                                      select r;
         HOUSE_INFO house = result.FirstOrDefault();
         houseName.Text = house.houseName;
         price.Text     = house.price;
         province.Text  = house.province;
         city.Text      = house.city;
         startDate.Text = house.startDate;
         endDate.Text   = house.endDate;
         string   url = house.photo;
         string[] s   = url.Split(new char[] { ';' });
         Image1.ImageUrl = s[0];
         string date = DateTime.Now.ToString("yyyy-MM-dd");
         datenow.Text = date;
         var result1 = from r in lqdb.USER_PROFILE
                       where r.userId == customerId
                       select r;
         USER_PROFILE user = result1.FirstOrDefault();
         name.Text       = user.userName;
         Image2.ImageUrl = user.headImage;
     }
 }
コード例 #7
0
ファイル: stepCheck.aspx.cs プロジェクト: jjkobe/goat
    private int checkAllSubmit(int id)
    {
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.REF_USER_HOUSEINFO
                                 where r.userId == id
                                 select r;
        bool check = true;
        int  step  = 0;

        foreach (REF_USER_HOUSEINFO ruf in result)
        {
            if (ruf.state == 0)
            {
                if (ruf.step != null)
                {
                    step = (int)ruf.step;
                }
                Session["houseId"] = ruf.houseId;
                check = false;
                break;
            }
        }
        if (check)
        {
            return(0);
        }
        else
        {
            return(step);
        }
    }
コード例 #8
0
    protected void next5_Click(object sender, EventArgs e)
    {
        int houseId    = (int)Session["houseId"];
        int smokeAlert = 0;
        int coAlert    = 0;
        int aid        = 0;
        int aidCard    = 0;
        int fire       = 0;

        if (this.smokeAlert.Checked == true)
        {
            smokeAlert = 1;
        }
        if (this.coAlert.Checked == true)
        {
            coAlert = 1;
        }
        if (this.aid.Checked == true)
        {
            aid = 1;
        }
        if (this.aidCard.Checked == true)
        {
            aidCard = 1;
        }
        if (this.fire.Checked == true)
        {
            fire = 1;
        }
        string          fireLocation      = this.fireLocation.Text.ToString();
        string          fireAlertLocation = this.fireAlertLocation.Text.ToString();
        string          coEnd             = this.coEnd.Text.ToString();
        string          exitLocation      = this.exitLocation.Text.ToString();
        string          aidCall           = this.aidCall.Text.ToString();
        string          fireCall          = this.fireCall.Text.ToString();
        string          policeCall        = this.policeCall.Text.ToString();
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.HOUSE_INFO
                                 where r.houseId == houseId
                                 select r;

        foreach (HOUSE_INFO h in result)
        {
            h.smokeAlert        = smokeAlert;
            h.coAlert           = coAlert;
            h.aid               = aid;
            h.aidCard           = aidCard;
            h.fire              = fire;
            h.fireLocation      = fireLocation;
            h.fireAlertLocation = fireAlertLocation;
            h.coEnd             = coEnd;
            h.exitLocation      = exitLocation;
            h.aidCall           = aidCall;
            h.fireCall          = fireCall;
            h.policeCall        = policeCall;
        }
        lqdb.SubmitChanges();
        nextStep();
        Response.Redirect("~/Service.aspx");
    }
コード例 #9
0
ファイル: housePublish2.aspx.cs プロジェクト: jjkobe/goat
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         stepCheck();
         int             houseId = (int)Session["houseId"];
         GoatDataContext lqdb    = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
         var             result  = from r in lqdb.HOUSE_INFO
                                   where r.houseId == houseId
                                   select r;
         HOUSE_INFO house = result.FirstOrDefault();
         string     name  = "";
         string     des   = "";
         if (house.houseName != null)
         {
             name = (string)house.houseName;
             initName(name);
         }
         if (house.houseDescription != null)
         {
             des = (string)house.houseDescription;
             initDes(des);
         }
     }
 }
コード例 #10
0
ファイル: housePublish1.aspx.cs プロジェクト: jjkobe/goat
    protected void next_Click(object sender, EventArgs e)
    {
        int             houseId  = (int)Session["houseId"];
        int             style    = getStyle();
        int             type     = getType();
        int             limit    = getLimit();
        int             bedroom  = getBedroom();
        int             bed      = getBed();
        int             restroom = getRestroom();
        GoatDataContext lqdb     = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result   = from r in lqdb.HOUSE_INFO
                                   where r.houseId == houseId
                                   select r;

        foreach (HOUSE_INFO h in result)
        {
            h.style    = style;
            h.type     = type;
            h.limit    = limit;
            h.bedroom  = bedroom;
            h.bed      = bed;
            h.restroom = restroom;
        }
        lqdb.SubmitChanges();
        nextStep();
        Response.Redirect("~/housePublish2.aspx");
    }
コード例 #11
0
    protected void save_Click(object sender, EventArgs e)
    {
        string name   = Request.Form["name"].ToString();
        string gender = Request.Form["gender"].ToString();
        //string female = Request.Form["female"].ToString();
        string          phone       = Request.Form["phone"].ToString();
        string          place       = Request.Form["place"].ToString();
        string          description = Request.Form["description"].ToString();
        string          school      = Request.Form["school"].ToString();
        string          work        = Request.Form["work"].ToString();
        string          email       = Request.Form["email"].ToString();
        GoatDataContext lqdb        = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        //USER_PROFILE userProfile = new USER_PROFILE();
        int id = (int)Session["ID"];
        //int id = 10;
        var result = from r in lqdb.USER_PROFILE
                     where r.userId == id
                     select r;

        foreach (USER_PROFILE userProfile in result)
        {
            userProfile.gender      = Convert.ToInt32(gender);
            userProfile.userName    = name;
            userProfile.email       = email;
            userProfile.phone       = phone;
            userProfile.description = description;
        }
        lqdb.SubmitChanges();
        Response.Redirect("~/Default.aspx");
    }
コード例 #12
0
ファイル: profile.aspx.cs プロジェクト: jjkobe/goat
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["userId"] = 1;
        int             userId = (int)Session["userId"];
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.USER_PROFILE
                                 where r.userId == userId
                                 select r;
        USER_PROFILE user = result.FirstOrDefault();

        Image1.ImageUrl = user.headImage;
        Label1.Text     = user.userName;
        Label2.Text     = user.userName;
        Label3.Text     = user.phone;
        Label4.Text     = user.description;
        if (user.gender == 1)
        {
            Label5.Text = "男";
        }
        else if (user.gender == 0)
        {
            Label5.Text = "女";
        }
        Label6.Text = user.email;
    }
コード例 #13
0
ファイル: location.aspx.cs プロジェクト: jjkobe/goat
    protected void Page_Load(object sender, EventArgs e)
    {
        string phone   = Request.QueryString["phone"];
        string pass    = Request.QueryString["password"];
        string lat     = Request.QueryString["lat"];
        string lng     = Request.QueryString["lng"];
        string houseId = Request.QueryString["houseId"];

        if (check(phone, pass))
        {
            int             id     = Convert.ToInt32(houseId);
            GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
            var             result = from r in lqdb.HOUSE_INFO
                                     where r.houseId == id
                                     select r;
            foreach (HOUSE_INFO h in result)
            {
                h.lat = Convert.ToDecimal(lat);
                h.lng = Convert.ToDecimal(lng);;
            }
            lqdb.SubmitChanges();
            Response.Write("yes");
            Response.End();
        }
        else
        {
            Response.Write("no");
            Response.End();
        }
    }
コード例 #14
0
ファイル: housePublish3.aspx.cs プロジェクト: jjkobe/goat
    protected void next3_Click(object sender, EventArgs e)
    {
        double          a          = (double)Session["log"];
        double          b          = (double)Session["lat"];
        int             houseId    = (int)Session["houseId"];
        string          province   = this.province.Text.ToString();
        string          city       = this.city.Text.ToString();
        string          postCode   = this.postCode.Text.ToString();
        string          street     = this.street.Text.ToString();
        string          department = this.department.Text.ToString();
        GoatDataContext lqdb       = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result     = from r in lqdb.HOUSE_INFO
                                     where r.houseId == houseId
                                     select r;

        foreach (HOUSE_INFO h in result)
        {
            h.department = department;
            h.postCode   = postCode;
            h.province   = province;
            h.city       = city;
            h.street     = street;
            h.lat        = (decimal)b;
            h.lng        = (decimal)a;
        }
        lqdb.SubmitChanges();
        nextStep();
        Response.Redirect("~/housePublish4.aspx");
    }
コード例 #15
0
ファイル: doRegister.aspx.cs プロジェクト: jjkobe/goat
    private void addUserProfile(int id)
    {
        GoatDataContext lqdb        = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        USER_PROFILE    userProfile = new USER_PROFILE();

        userProfile.userId = id;
        lqdb.USER_PROFILE.InsertOnSubmit(userProfile);
        lqdb.SubmitChanges();
    }
コード例 #16
0
ファイル: addComment.aspx.cs プロジェクト: jjkobe/goat
    private string getHeadPicById(int customerId)
    {
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.USER_PROFILE
                                 where r.userId == customerId
                                 select r;
        USER_PROFILE user = result.FirstOrDefault();
        string       pic  = user.headImage;

        return(pic);
    }
コード例 #17
0
    private void saveIdByPhone(string _phone)
    {
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.USER
                                 where r.phone == _phone
                                 select r;
        USER user = result.FirstOrDefault();
        int  id   = user.userId;

        Session["ID"] = user.userId;//ID是用户编号
    }
コード例 #18
0
ファイル: stepCheck.aspx.cs プロジェクト: jjkobe/goat
    private void createNewHouseInfo()
    {
        GoatDataContext lqdb      = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        HOUSE_INFO      houseInfo = new HOUSE_INFO();

        lqdb.HOUSE_INFO.InsertOnSubmit(houseInfo);
        lqdb.SubmitChanges();
        int id = houseInfo.houseId;

        Session["houseId"] = id;
        createNewRefInfo(id);
    }
コード例 #19
0
ファイル: likething.aspx.cs プロジェクト: jjkobe/goat
    protected void Button1_Click(object sender, EventArgs e)
    {
        Button          button        = (Button)sender;
        int             _collectionId = Convert.ToInt32(button.CommandArgument.ToString());
        GoatDataContext lqdb          = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result        = from r in lqdb.COLLECCTION
                                        where r.collectionId == _collectionId
                                        select r;

        lqdb.COLLECCTION.DeleteAllOnSubmit(result);
        lqdb.SubmitChanges();
        dataBind();
    }
コード例 #20
0
ファイル: profile.aspx.cs プロジェクト: jjkobe/goat
    private void SaveImage(String path)
    {
        int             userId = (int)Session["userId"];
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.USER_PROFILE
                                 where r.userId == userId
                                 select r;

        foreach (USER_PROFILE user in result)
        {
            user.headImage = path;
        }
        lqdb.SubmitChanges();
    }
コード例 #21
0
ファイル: housePublish1.aspx.cs プロジェクト: jjkobe/goat
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         stepCheck();
         int             houseId = (int)Session["houseId"];
         GoatDataContext lqdb    = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
         var             result  = from r in lqdb.HOUSE_INFO
                                   where r.houseId == houseId
                                   select r;
         HOUSE_INFO house      = result.FirstOrDefault();
         int        styleId    = 0;
         int        typeId     = 0;
         int        limitId    = 0;
         int        bedroomId  = 0;
         int        bedId      = 0;
         int        restroomId = 0;
         this.style.ClearSelection();
         if (house.style != null)
         {
             styleId = (int)house.style;
             initStyle(styleId);
         }
         if (house.type != null)
         {
             typeId = (int)house.type;
             initType(typeId);
         }
         if (house.limit != null)
         {
             limitId = (int)house.limit;
             initLimit(limitId);
         }
         if (house.bedroom != null)
         {
             bedroomId = (int)house.bedroom;
             initBedroom(bedroomId);
         }
         if (house.bed != null)
         {
             bedId = (int)house.bed;
             initBed(bedId);
         }
         if (house.restroom != null)
         {
             restroomId = (int)house.restroom;
             initRestroom(restroomId);
         }
     }
 }
コード例 #22
0
ファイル: historyOrder.aspx.cs プロジェクト: jjkobe/goat
    protected void Button1_Click(object sender, EventArgs e)
    {
        Button          button   = (Button)sender;
        int             _orderId = Convert.ToInt32(button.CommandArgument.ToString());
        int             command  = Convert.ToInt32(button.CommandName.ToString());
        GoatDataContext lqdb     = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result   = from r in lqdb.HOUSE_ORDER
                                   where r.orderId == _orderId
                                   select r;

        if (command == 1)
        {
            foreach (HOUSE_ORDER h in result)
            {
                h.state             = 2;
                h.stateNameCustomer = "已付款";
                h.stateHintCustomer = "完成";
                h.stateHintHost     = "完成";
                h.stateNameHost     = "已付款";
                h.isShowHost        = 1;
            }
        }
        else if (command == 2)
        {
            foreach (HOUSE_ORDER h in result)
            {
                h.state             = 3;
                h.stateHintCustomer = "";
                h.stateNameCustomer = "等待对方完成";
                h.isShowCustomer    = 0;
            }
        }
        else if (command == 4)
        {
            foreach (HOUSE_ORDER h in result)
            {
                h.state             = 5;
                h.stateHintCustomer = "";
                h.stateNameCustomer = "已完成";
                h.isShowCustomer    = 0;
                h.stateHintHost     = "";
                h.stateNameHost     = "已完成";
                h.isShowHost        = 0;
                h.customerCheck     = 1;
            }
        }
        lqdb.SubmitChanges();
        dataBind();
    }
コード例 #23
0
ファイル: stepCheck.aspx.cs プロジェクト: jjkobe/goat
    private void createNewRefInfo(int id)
    {
        GoatDataContext    lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        REF_USER_HOUSEINFO REF  = new REF_USER_HOUSEINFO();
        int userId = (int)Session["ID"];

        //int userId = 1;
        REF.houseId     = id;
        REF.userId      = userId;
        REF.step        = 1;
        Session["step"] = 1;
        REF.state       = 0;
        lqdb.REF_USER_HOUSEINFO.InsertOnSubmit(REF);
        lqdb.SubmitChanges();
    }
コード例 #24
0
ファイル: doRegister.aspx.cs プロジェクト: jjkobe/goat
    private bool findIdByPhone(string _phone)
    {
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.USER
                                 where r.phone == _phone
                                 select r;

        if (result.FirstOrDefault() != null)
        {
            return(false);
        }
        else
        {
            return(true);
        }
    }
コード例 #25
0
ファイル: stepCheck.aspx.cs プロジェクト: jjkobe/goat
    private bool checkIsHave(int id)
    {
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.REF_USER_HOUSEINFO
                                 where r.userId == id
                                 select r;

        if (result.FirstOrDefault() != null)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
コード例 #26
0
ファイル: location.aspx.cs プロジェクト: jjkobe/goat
    private bool check(string phone, string pass)
    {
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.USER
                                 where r.phone == phone
                                 select r;
        USER u = result.FirstOrDefault();

        if (u.password == pass)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
コード例 #27
0
    private bool checkLogin(string _phone, string _password)
    {
        GoatDataContext lqdb   = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result = from r in lqdb.USER
                                 where r.phone == _phone && r.password == _password
                                 select r;

        if (result.FirstOrDefault() != null)
        {
            saveIdByPhone(_phone);
            return(true);
        }
        else
        {
            return(false);
        }
    }
コード例 #28
0
ファイル: housePublish6.aspx.cs プロジェクト: jjkobe/goat
    protected void next6_Click(object sender, EventArgs e)
    {
        int             houseId = (int)Session["houseId"];
        string          price   = this.price.Text.ToString().Trim();
        GoatDataContext lqdb    = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
        var             result  = from r in lqdb.HOUSE_INFO
                                  where r.houseId == houseId
                                  select r;

        foreach (HOUSE_INFO h in result)
        {
            h.price = price;
        }
        lqdb.SubmitChanges();
        nextStep();
        Response.Redirect("~/housePublish7.aspx");
    }
コード例 #29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         stepCheck();
         int             houseId = (int)Session["houseId"];
         GoatDataContext lqdb    = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());
         var             result  = from r in lqdb.HOUSE_INFO
                                   where r.houseId == houseId
                                   select r;
         HOUSE_INFO h = result.FirstOrDefault();
         if (h.engage == 1)
         {
             this.engage.Checked = true;
         }
         if (h.brorrowCar == 1)
         {
             this.brorrowCar.Checked = true;
         }
         if (h.foodGuide == 1)
         {
             this.foodGuide.Checked = true;
         }
         if (h.shopGuide == 1)
         {
             this.shopGuide.Checked = true;
         }
         if (h.spotGuide == 1)
         {
             this.spotGuide.Checked = true;
         }
         if (h.foodMake == 1)
         {
             this.foodMake.Checked = true;
         }
         if (h.ticket == 1)
         {
             this.ticket.Checked = true;
         }
         if (h.translate == 1)
         {
             this.translate.Checked = true;
         }
     }
 }
コード例 #30
0
ファイル: doRegister.aspx.cs プロジェクト: jjkobe/goat
    private bool addUser(string _phone, string _repassword)
    {
        GoatDataContext lqdb = new GoatDataContext(ConfigurationManager.ConnectionStrings["GoatConnectionString"].ConnectionString.ToString());

        if (findIdByPhone(_phone) == false)
        {
            return(false);
        }
        else
        {
            USER user = new USER();
            user.phone    = _phone;
            user.password = _repassword;
            lqdb.USER.InsertOnSubmit(user);
            lqdb.SubmitChanges();
            return(true);
        }
    }