/// <summary>
    /// 注册
    /// </summary>
    /// <param name="loginName"></param>
    /// <param name="loginPsw"></param>
    /// <param name="alias"></param>
    /// <param name="age"></param>
    /// <returns></returns>
    private Result RegisterClothes(string loginName, string loginPsw, string alias, string age)
    {
        var result = new Result <List <User> >();
        //此处需优化,参数化处理
        var sqltextFomat = "insert into [clothes].[dbo].[user] (userName,password,age,alias) values ('{0}','{1}','{2}','{3}') ";
        var sqlText      = string.Format(sqltextFomat, loginName, loginPsw, age, alias);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
Esempio n. 2
0
    /// <summary>
    /// 注册
    /// </summary>
    /// <param name="loginName"></param>
    /// <param name="loginPsw"></param>
    /// <param name="alias"></param>
    /// <param name="age"></param>
    /// <returns></returns>
    private Result updateUser(string loginName, string loginPsw, string alias, string age, string id)
    {
        var result = new Result <List <User> >();
        //此处需优化,参数化处理
        var sqltextFomat = "update [clothes].[dbo].[user] set userName='******',password='******',age='{2}',alias='{3}' where id={4} ";
        var sqlText      = string.Format(sqltextFomat, loginName, loginPsw, age, alias, id);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
Esempio n. 3
0
    public static Result DeleteClothById(int id)
    {
        var        result     = new Result();
        DbHelperV2 dbhelperv2 = new DbHelperV2();
        //此处需优化,参数化处理
        var sqltextFomat = "delete from [clothes].[dbo].[cloth] where id={0} ";
        var sqlText      = string.Format(sqltextFomat, id);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
Esempio n. 4
0
    public static Result EditCloth(Cloth model, int id)
    {
        var        result     = new Result();
        DbHelperV2 dbhelperv2 = new DbHelperV2();
        //此处需优化,参数化处理
        var sqltextFomat = "update [clothes].[dbo].[cloth]  set  userId='{0}',clothTypeId='{1}',clothName='{2}',price='{3}',brand='{4}',fabric='{5}',season='{6}',size='{7}',color='{8}',imgUrl='{9}',createTime='{10}',endTime='{11}' where id={12}  ";
        var sqlText      = string.Format(sqltextFomat, model.userId, model.clothTypeId, model.clothName, model.price, model.brand, model.fabric, model.season, model.size, model.color, model.imgUrl, model.createTime, model.endTime, id);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
Esempio n. 5
0
    public static Result AddCloth(Cloth model)
    {
        var        result     = new Result();
        DbHelperV2 dbhelperv2 = new DbHelperV2();
        //此处需优化,参数化处理
        var sqltextFomat = "insert into [clothes].[dbo].[cloth] (userId,clothTypeId,clothName,price,brand,fabric,season,size,color,imgUrl,createTime,endTime) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}') ";
        var sqlText      = string.Format(sqltextFomat, model.userId, model.clothTypeId, model.clothName, model.price, model.brand, model.fabric, model.season, model.size, model.color, model.imgUrl, model.createTime, model.endTime);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
    public static Result EditStyleType(int id, string sName, string describe)
    {
        var result = new Result();
        //此处需优化,参数化处理
        var        sqltextFomat = "update [clothes].[dbo].[style] set sName='{0}',describe='{1}' where id={2} ";
        var        sqlText      = string.Format(sqltextFomat, sName, describe, id);
        DbHelperV2 dbhelperv2   = new DbHelperV2();

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
    public static Result AddStyleType(string sName, string describe)
    {
        var result = new Result();
        //此处需优化,参数化处理
        var        sqltextFomat = "insert into [clothes].[dbo].[style] (sName,describe) values ('{0}','{1}') ";
        var        sqlText      = string.Format(sqltextFomat, sName, describe);
        DbHelperV2 dbhelperv2   = new DbHelperV2();

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
Esempio n. 8
0
    public static Result EditClothType(string type, int id)
    {
        var        result     = new Result();
        DbHelperV2 dbhelperv2 = new DbHelperV2();
        //此处需优化,参数化处理
        var sqltextFomat = "update [clothes].[dbo].[ClothType] set type='{0}' where id={1} ";
        var sqlText      = string.Format(sqltextFomat, type, id);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
    public static Result EditFigure(int userId, string weight, string stature, string chestSize, string waistSize, string hiplineSize, int id)
    {
        var        result     = new Result();
        DbHelperV2 dbhelperv2 = new DbHelperV2();
        //此处需优化,参数化处理
        var sqltextFomat = "update [clothes].[dbo].[figure] set userId='{0}',weight='{1}',stature='{2}',chestSize='{3}',waistSize='{4}',hiplineSize='{5}' where id={6} ";
        var sqlText      = string.Format(sqltextFomat, userId, weight, stature, chestSize, waistSize, hiplineSize, id);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
    public static Result AddFigure(string userId, string weight, string stature, string chestSize, string waistSize, string hiplineSize)
    {
        var        result     = new Result();
        DbHelperV2 dbhelperv2 = new DbHelperV2();
        //此处需优化,参数化处理
        var sqltextFomat = "insert into [clothes].[dbo].[figure] (userId,weight,stature,chestSize,waistSize,hiplineSize) values ('{0}','{1}','{2}','{3}','{4}','{5}') ";
        var sqlText      = string.Format(sqltextFomat, userId, weight, stature, chestSize, waistSize, hiplineSize);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
    public static Result AddChuanDa(string userId, string name, string styleId, string clothIds, string describe, string createTime, string endTime)
    {
        var        result     = new Result();
        DbHelperV2 dbhelperv2 = new DbHelperV2();
        //此处需优化,参数化处理
        var sqltextFomat = "insert into [clothes].[dbo].[chuanda] (userId,name,styleId,clothIds,describe,createTime,endTime) values ('{0}','{1}','{2}','{3}','{4}','{5}', '{6}') ";
        var sqlText      = string.Format(sqltextFomat, userId, name, styleId, clothIds, describe, createTime, endTime);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }
    public static Result EditChuanDa(string id, string userId, string name, string styleId, string clothIds, string describe, string createTime, string endTime)
    {
        var        intid      = Convert.ToInt32(id);
        var        result     = new Result();
        DbHelperV2 dbhelperv2 = new DbHelperV2();
        //此处需优化,参数化处理
        var sqltextFomat = "update [clothes].[dbo].[chuanda] set name='{0}',styleId='{1}',clothIds='{2}',describe='{3}',createTime='{4}',endTime='{5}', userId='{6}' where id={7}  ";
        var sqlText      = string.Format(sqltextFomat, name, styleId, clothIds, describe, createTime, endTime, userId, intid);

        dbhelperv2.ExecuteNonQuery(new List <string> {
            sqlText
        });
        result.Code    = 200;
        result.Message = "成功!";
        result.IsTrue  = true;
        return(result);
    }