Ejemplo n.º 1
0
        public static string AddUserPortrait(P_Sys_UserPortraitModel model)
        {
            //string remark = ",";

            //if (!string.IsNullOrEmpty(model.RemarkContent1))
            //{
            //    int reVal1 = UserPortraitBLL.AddRemark(model.RemarkType1, model.RemarkContent1);
            //    if (reVal1 > 0)
            //    {
            //        remark += reVal1.ToString() + ",";
            //    }
            //}

            //if (!string.IsNullOrEmpty(model.RemarkContent2))
            //{
            //    int reVal2 = UserPortraitBLL.AddRemark(model.RemarkType2, model.RemarkContent2);
            //    if (reVal2 > 0)
            //    {
            //        remark += reVal2.ToString() + ",";
            //    }
            //}

            //if (remark.Length > 1)
            //{
            //    model.RemarkId = remark;
            //}
            //用户拓展信息保留一个备注
            model.RemarkId = model.RemarkContent1;
            return(UserPortraitBLL.AddUserPortrait(model));
        }
Ejemplo n.º 2
0
 public string AddUserPortrait(P_Sys_UserPortraitModel model)
 {
     return(UserPortrait.AddUserPortrait(model));
 }
Ejemplo n.º 3
0
        public string AddUserPortrait(P_Sys_UserPortraitModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(*) from P_Sys_UserPortrait where AccId=@accid;");

            int count = DapperHelper.ExecuteScalar <int>(strSql.ToString(), new { accid = model.AccId });

            strSql.Clear();

            if (count == 0)
            {
                strSql.Append("insert into P_Sys_UserPortrait (" +
                              " InsertTime," +
                              " AccId," +
                              " Industry," +
                              " UserSourcePortrait," +
                              " ChoiceReason," +
                              " CompetingProduct," +
                              " PotentialNeed," +
                              " Attitude," +
                              " BusinessExp," +
                              " PhoneNum," +
                              " QQNum," +
                              " AgeGrade," +
                              " Gender," +
                              " WebExpGrade," +
                              " SalesmanNum," +
                              " RealName," +
                              " Email," +
                              " Weixin," +
                              " IdCardNo," +
                              " InvoiceTitle," +
                              " ShopAddress," +
                              " BranchNum," +
                              " RemarkId,MainQuestion) values(" +
                              " @InsertTime," +
                              " @AccId," +
                              " @Industry," +
                              " @UserSourcePortrait," +
                              " @ChoiceReason," +
                              " @CompetingProduct," +
                              " @PotentialNeed," +
                              " @Attitude," +
                              " @BusinessExp," +
                              " @PhoneNum," +
                              " @QQNum," +
                              " @AgeGrade," +
                              " @Gender," +
                              " @WebExpGrade," +
                              " @SalesmanNum," +
                              " @RealName," +
                              " @Email," +
                              " @Weixin," +
                              " @IdCardNo," +
                              " @InvoiceTitle," +
                              " @ShopAddress," +
                              " @BranchNum," +
                              " @RemarkId,@MainQuestion);");

                try
                {
                    int reVal = DapperHelper.Execute(strSql.ToString(), new
                    {
                        InsertTime         = DateTime.Now,
                        AccId              = model.AccId,
                        Industry           = model.Industry,
                        UserSourcePortrait = model.UserSourcePortrait,
                        ChoiceReason       = model.ChoiceReason,
                        CompetingProduct   = model.CompetingProduct,
                        PotentialNeed      = model.PotentialNeed,
                        Attitude           = model.Attitude,
                        BusinessExp        = model.BusinessExp,
                        PhoneNum           = model.PhoneNum,
                        QQNum              = model.QQNum,
                        AgeGrade           = model.AgeGrade,
                        Gender             = model.Gender,
                        WebExpGrade        = model.WebExpGrade,
                        SalesmanNum        = model.SalesmanNum,
                        RealName           = model.RealName,
                        Email              = model.Email,
                        Weixin             = model.Weinxin,
                        IdCardNo           = model.IdCardNo,
                        InvoiceTitle       = model.InvoiceTitle,
                        ShopAddress        = model.ShopAddress,
                        BranchNum          = model.BranchNum,
                        RemarkId           = model.RemarkId,
                        MainQuestion       = model.MainQuestion
                    });

                    if (reVal > 0)
                    {
                        return("");
                    }
                    else
                    {
                        return("err");
                    }
                }
                catch (Exception ex)
                {
                    return("err");
                }
            }
            else
            {
                strSql.Append("update P_Sys_UserPortrait set " +
                              " InsertTime=@insertTime," +
                              " Industry=@industry," +
                              " UserSourcePortrait=@userSource," +
                              " ChoiceReason=@choiceReason," +
                              " CompetingProduct=@competingProduct," +
                              " PotentialNeed=@potentialNeed," +
                              " Attitude=@attitude," +
                              " BusinessExp=@business," +
                              " PhoneNum=@phone," +
                              " QQNum=@qq," +
                              " AgeGrade=@ageGrade," +
                              " Gender=@gender," +
                              " WebExpGrade=@webExpGrade," +
                              " SalesmanNum=@salemanNum," +
                              " RealName=@RealName," +
                              " Email=@Email," +
                              " Weixin=@Weixin," +
                              " IdCardNo=@IdCardNo," +
                              " InvoiceTitle=@InvoiceTitle," +
                              " ShopAddress=@ShopAddress," +
                              " BranchNum=@BranchNum," +
                              " RemarkId=@remarkId,MainQuestion=@MainQuestion where AccId=@accid;");

                try
                {
                    int reVal = DapperHelper.Execute(strSql.ToString(), new
                    {
                        insertTime       = DateTime.Now,
                        industry         = model.Industry,
                        userSource       = model.UserSourcePortrait,
                        choiceReason     = model.ChoiceReason,
                        competingProduct = model.CompetingProduct,
                        potentialNeed    = model.PotentialNeed,
                        attitude         = model.Attitude,
                        business         = model.BusinessExp,
                        phone            = model.PhoneNum,
                        qq           = model.QQNum,
                        ageGrade     = model.AgeGrade,
                        gender       = model.Gender,
                        webExpGrade  = model.WebExpGrade,
                        salemanNum   = model.SalesmanNum,
                        remarkId     = model.RemarkId,
                        RealName     = model.RealName,
                        Email        = model.Email,
                        Weixin       = model.Weinxin,
                        IdCardNo     = model.IdCardNo,
                        InvoiceTitle = model.InvoiceTitle,
                        ShopAddress  = model.ShopAddress,
                        BranchNum    = model.BranchNum,
                        accid        = model.AccId,
                        MainQuestion = model.MainQuestion
                    });

                    if (reVal > 0)
                    {
                        return("");
                    }
                    else
                    {
                        return("err");
                    }
                }
                catch (Exception ex)
                {
                    return("err");
                }
            }
        }
Ejemplo n.º 4
0
        public static string AddUserPortrait(P_Sys_UserPortraitModel model)
        {
            UserPortraitDAL dal = new UserPortraitDAL();

            return(dal.AddUserPortrait(model));
        }