Exemplo n.º 1
0
        public string SaveSuggest(string content, string name, string phone)
        {
            T_Suggestion t = new T_Suggestion()
            {
                Name = name, Phone = phone, Content = content, CreateDate = DateTime.Now, Processed = false
            };
            int i = B_Common.AddSuggestion(t);

            return(i > 0 ? "" : "Error");
        }
Exemplo n.º 2
0
        public static int AddSuggestion(T_Suggestion s)
        {
            object o = MySqlHelper.ExecuteScalar(Util.GetConnectString(HomeConnString),
                                                 "insert into T_Suggestion(Id, Name, Phone, Content, CreateDate, Processed) values (null, @Name, @Phone, @Content, @CreateDate, @Processed); select last_insert_id();",
                                                 "@Name".ToVarCharInPara(s.Name),
                                                 "@Phone".ToVarCharInPara(s.Phone),
                                                 "@Content".ToVarCharInPara(s.Content),
                                                 "@CreateDate".ToDateTimeInPara(s.CreateDate),
                                                 "@Processed".ToBitInPara(s.Processed)
                                                 );

            return(o == null ? 0 : int.Parse(o.ToString()));
        }