Example #1
0
        public virtual int VoteAdd(VoteSurveyName surveyItem, List <VoteOptionName> optionList)
        {
            DbCommand cmd = GetStoredProcCommand("P_Vote_Add");

            AddInParameter(cmd, "@SurveyName", DbType.String, surveyItem.SurveyName);
            AddInParameter(cmd, "@CityId", DbType.Int32, surveyItem.CityId);
            AddInParameter(cmd, "@UserId", DbType.Int32, surveyItem.UserId);
            AddInParameter(cmd, "@SurveyType", DbType.Int32, surveyItem.SurveyType);
            AddInParameter(cmd, "@ViewData", DbType.Int32, surveyItem.ViewData);
            AddInParameter(cmd, "@EndTime", DbType.DateTime, surveyItem.EndTime);
            AddInParameter(cmd, "@IP", DbType.String, ZJB.Web.Utilities.IpUtility.GetIp());
            AddInParameter(cmd, "@OptionNameList", DbType.Xml, ZJB.Core.Utilities.XmlUtility.Serialize(optionList, Encoding.UTF8, "OptionNameList"));
            int result = ExecuteNonQuery(cmd);

            return(result);
        }
Example #2
0
        public JsonResult VoteAdd(VoteAddReq parame)
        {
            PublicUserModel       loginUser     = this.GetLoginUser();
            VoteSurveyName        newVote       = new VoteSurveyName();
            List <VoteOptionName> optioNameList = new List <VoteOptionName>();

            newVote.CityId     = loginUser.CityID;
            newVote.EndTime    = parame.EndTime;
            newVote.UserId     = loginUser.UserID;
            newVote.SurveyName = parame.SurveyName;
            newVote.SurveyType = parame.SurveyType;
            newVote.ViewData   = parame.ViewData;
            optioNameList      = jss.Deserialize <List <VoteOptionName> >(parame.OptionNameList);
            int result = voteBll.VoteAdd(newVote, optioNameList);

            return(Json(new { status = result }));
        }
Example #3
0
 public virtual int VoteAdd(VoteSurveyName surveyItem, List <VoteOptionName> optionList)
 {
     return(voteDal.VoteAdd(surveyItem, optionList));
 }