Exemplo n.º 1
0
        public ActionResult toAdd1(C_UserAdvice para)
        {
            if (string.IsNullOrWhiteSpace(para.Contents))
            {
                return(Content("Please select the fault problem"));
            }

            if (string.IsNullOrWhiteSpace(para.Phone))
            {
                return(Content("Please fill in the SN code or your phone number"));
            }
            B_bd cnt = B_bd.login(para.Phone);

            if (cnt == null)
            {
                return(Content("The phone number doesn't exist"));
            }
            para.DatCreate = DateTime.Now;
            int rtn = para.InsertAndReturnIdentity();

            if (rtn > 0)
            {
                return(Content("ok"));
            }
            return(Content("Add an error"));
        }
Exemplo n.º 2
0
        public ActionResult toAdd(C_UserAdvice para)
        {
            if (string.IsNullOrWhiteSpace(para.Contents))
            {
                return(Content("请选择故障问题"));
            }

            if (string.IsNullOrWhiteSpace(para.Phone))
            {
                return(Content("请填写SN码或者您的电话号码"));
            }

            B_bd cnt = B_bd.login(para.Phone);

            if (cnt == null)
            {
                return(Content("手机号不存在"));
            }
            para.Name      = para.Name;
            para.DatCreate = DateTime.Now;
            para.State     = "退货";
            int rtn = para.InsertAndReturnIdentity();

            if (rtn > 0)
            {
                return(Content("ok"));
            }
            return(Content("添加出错"));
        }
Exemplo n.º 3
0
 public ContentResult ToAdd(string Contents, string Phone, string Name)
 {
     try
     {
         C_UserAdvice c = new C_UserAdvice();
         c.Contents  = Contents;
         c.Phone     = Phone;
         c.Name      = Name;
         c.DatCreate = DateTime.Now;
         c.State     = "未审核";
         c.InsertAndReturnIdentity();
         return(Content("ok"));
     }
     catch (Exception)
     {
         return(Content("提交失败"));
     }
 }