private void JYInfo() { try { var tname = _ct.Request.Form["tname"]; var tmsg = _ct.Request.Form["tmsg"]; var model = new Forms(); model.Attach(); model.Title = ""; model.FormType = 0; model.Name = tname; model.Number = 0; model.Mobile = ""; model.Age = 0; model.Source = tmsg; model.Income = ""; model.Remark = ""; model.AddTime = DateTime.Now; model.Status = 0; model.Orders = 0; model.UpdateTime = DateTime.Now; model.Extend = ""; model.Extend2 = ""; model.Type = 21; model.JFCount = 0; int t = DbSession.Default.Insert <Forms>(model); _ct.Response.Write("{\"ist\":\"" + 1 + "\"}"); } catch (Exception ex) { _ct.Response.Write("{\"ismsgs\":\"" + ex.Message + "\",\"ist\":\"" + 0 + "\"}"); } }
private void WJdc() { try { var tname = _ct.Request.Form["tname"]; var tmsg = _ct.Request.Form["tcod"]; var tmodel = DbSession.Default.From <Forms>().Where(s => s.Name.Equals(tname)).ToFirstDefault(); if (tmodel.Id > 0) { _ct.Response.Write("{\"ist\":\"" + 1 + "\"}"); } else { var model = new Forms(); model.Attach(); model.Title = ""; model.FormType = 0; model.Name = tname; model.Number = 0; model.Mobile = ""; model.Age = 0; model.Source = tmsg; model.Income = ""; model.Remark = ""; model.AddTime = DateTime.Now; model.Status = 0; model.Orders = 0; model.UpdateTime = DateTime.Now; model.Extend = ""; model.Extend2 = ""; model.Type = 20; model.JFCount = 0; int t = DbSession.Default.Insert <Forms>(model); _ct.Response.Write("{\"ist\":\"" + 1 + "\"}"); } } catch (Exception ex) { _ct.Response.Write("{\"ismsgs\":\"" + ex.Message + "\",\"ist\":\"" + 0 + "\"}"); } }