Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AddPhotoBLL mybll      = new AddPhotoBLL();
        Client      client     = new Client();
        ClientInfo  clientinfo = new ClientInfo();

        client.ID = int.Parse(Session["CID"].ToString());
        //client.ID = 12;//测试

        //string portrait_url = Request.Form["imageurl"].ToString();
        //string db_url = IMGPath(portrait_url, client.ID);
        //clientinfo.Pic = db_url;

        clientinfo.NickName = Request.Form["nickname"].ToString();//从前端获取
        clientinfo.Sex      = Request.Form["sex"].ToString();
        clientinfo.Country  = Request.Form["countrySelect"].ToString();
        clientinfo.Province = Request.Form["provSelect"].ToString();
        clientinfo.City     = Request.Form["citySelect"].ToString();
        string habbit_name = Request.Form["label"].ToString();



        string[] habbit_nam = habbit_name.Split(',');
        int      modify     = mybll.modifyInfo(clientinfo, client, habbit_nam);

        if (modify == 0)
        {
            Response.Write("no_modify");//没有修改任何信息
        }
        else
        {
            Response.Write("success");//修改成功
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AddPhotoBLL mybll = new AddPhotoBLL();
        // string str = "风好";
        string str = Request.Form["search"].ToString();

        char[] temp = str.ToCharArray();
        for (int i = 0; i < temp.Length; i++)
        {
            DataSet ds_label    = mybll.searchLabel(temp[i].ToString());
            string  ds_label_js = JsonHelper.ToJson(ds_label);
            Response.Write(ds_label_js);
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string client_id;
        string clientID = Session["CID"].ToString();

        AddPhotoBLL mybll = new AddPhotoBLL();

        //int client_id = Convert.ToInt32(Session["CID"]);
        if (Request.Form["c_id"] != "")
        {
            client_id = Request.Form["c_id"].ToString();
        }
        else
        {
            client_id = clientID;
        }
        //根据用户ID生成时间轴
        DataSet ds_axis   = mybll.timeAxis(client_id);
        string  time_axis = JsonHelper.ToJson(ds_axis);

        Response.Write(time_axis);
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AddPhotoBLL addphotobll = new AddPhotoBLL();
        Photo       myPhoto     = new Photo();

        // 上传照片信息
        string url = Request.Form["imageurl"].ToString();

        myPhoto.CommentsNum = 0;
        myPhoto.LikeNum     = 0;
        myPhoto.ClientID    = int.Parse(Session["CID"].ToString());
        //myPhoto.ClientID = 1;
        myPhoto.Time = System.DateTime.Now;
        string db_url = IMGPath(url);

        myPhoto.Pic      = db_url;
        myPhoto.IfPublic = Request.Form["publicVal"].ToString();


        //上传照片时添加标签
        //string label_name = "悬疑,小说";//测试
        string label_name = Request.Form["photoLabels"].ToString();

        string[] label_nam = label_name.Split(',');



        int add = addphotobll.addPhoto(myPhoto, label_nam);

        if (add == 1)
        {
            Response.Write("success");
        }
        else
        {
            Response.Write("fail");
        }
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AddPhotoBLL mybll     = new AddPhotoBLL();
        int         client_id = int.Parse(Session["CID"].ToString());
        //int client_id = 22;
        string action = Request.Form["action"].Trim();

        //string action = "0";
        switch (action)
        {
        case "0":    //显示默认头像和昵称
            DataSet ds_pic_nick = mybll.getPortrait(client_id);
            string  pic_nick    = JsonHelper.ToJson(ds_pic_nick);
            Response.Write(pic_nick);
            break;

        case "1":    //给前端推送爱好
            DataSet ds_habbit = mybll.getHabbit();
            string  habbit    = JsonHelper.ToJson(ds_habbit);
            Response.Write(habbit);
            break;
        }
    }