public ActionResult PopupboxForReply(CustomerServCenter model, Dictionary <string, string> queryvalues) { var a = model.CSCMainID; model.GUName = "客服"; model.GUType = 2; model.GUUserID = 0; model.CSCSubId = model.CSCMainID; model.CSCState = cscState.未处理; model.CSCTime = DateTime.Now; int result = CustomerServCenterBLL.Insert(model); if (result > 0) { CustomerServCenter c = new CustomerServCenter { CSCUpdateTime = DateTime.Now, CSCMainID = model.CSCMainID, CSCState = cscState.已回复 }; int r = CustomerServCenterBLL.UpdateForManage(c); return(Json(new { result = 0 })); } else { return(Json(new { result = 1 })); } }
public object Post([FromBody] CustomerServCenter model) { //var a = model.CSCMainID; model.GUName = "管理员"; model.GUType = 1; model.GUUserID = 0; model.CSCSubId = model.CSCMainID; model.CSCState = cscState.未处理; model.CSCTime = DateTime.Now; int result = CustomerServCenterBLL.Insert(model); if (result > 0) { CustomerServCenter c = new CustomerServCenter { CSCMainID = model.CSCMainID, CSCState = cscState.已回复 }; int r = CustomerServCenterBLL.UpdateForManage(c); return(new { result = 0 }); } else { return(new { result = 1 }); } }
public object Delete([FromBody] CustomerServCenter model) { int result = CustomerServCenterBLL.Delete(model); if (result > 0) { return(new { result = 0 }); } return(new { result = 1 }); }
internal static CustomerServCenter GetModel(CustomerServCenter model) { using (var cn = new MySqlConnection(sqlconnectionString)) { cn.Open(); IEnumerable <CustomerServCenter> csc = cn.Query <CustomerServCenter>(@"select * from CustomerServCenter where CSCMainID = @CSCMainID", model); cn.Close(); return(csc.FirstOrDefault()); } }
internal static IEnumerable <CustomerServCenter> GetListWithCSCSubId(CustomerServCenter cust) { using (var cn = new MySqlConnection(sqlconnectionString)) { cn.Open(); IEnumerable <CustomerServCenter> csc = cn.Query <CustomerServCenter>(@"select * from CustomerServCenter where CSCMainID = @CSCMainID or CSCSubId = @CSCMainID order by CSCMainID asc", cust); cn.Close(); return(csc); } }
internal static int Update(CustomerServCenter c) { using (var cn = new MySqlConnection(sqlconnectionString)) { cn.Open(); int i = cn.Execute(@"update CustomerServCenter set CSCState = @CSCState where CSCMainID = @CSCMainID and GUUserID = @GUUserID", c); cn.Close(); return(i); } }
internal static int Insert(CustomerServCenter cust) { using (var cn = new MySqlConnection(sqlconnectionString)) { cn.Open(); int i = cn.Execute(@"insert into CustomerServCenter(CSCSubId,GUUserID,CSCTime,CSCTitle,CSCType,CSCContent,CSCState,GUName,GUType)values (@CSCSubId,@GUUserID,@CSCTime,@CSCTitle,@CSCType,@CSCContent,@CSCState,@GUName,@GUType)", cust); cn.Close(); return(i); } }
internal static int UpdateForManage(CustomerServCenter c) { using (var cn = new MySqlConnection(sqlconnectionString)) { cn.Open(); int i = cn.Execute(@"update CustomerServCenter set CSCUpdateTime='" + DateTime.Now.ToString() + "', CSCState = @CSCState where CSCMainID = @CSCMainID", c); cn.Close(); return(i); } }
internal static int Delete(CustomerServCenter cust) { using (var cn = new MySqlConnection(sqlconnectionString)) { cn.Open(); int i = cn.Execute(@"Delete from CustomerServCenter where CSCMainID = @CSCMainID or CSCSubId = @CSCMainID", cust); cn.Close(); return(i); } }
public ActionResult PopupboxForReply(Dictionary <string, string> queryvalues) { int CSCMainID = queryvalues.ContainsKey("CSCMainID") ? Convert.ToInt32(queryvalues["CSCMainID"]) : 0; if (CSCMainID > 0) { //CustomerServCenter res = CustomerServCenterBLL.GetModel(new CustomerServCenter { CSCMainID = CSCMainID }); IEnumerable <CustomerServCenter> result = CustomerServCenterBLL.GetListWithCSCSubId(new CustomerServCenter { CSCMainID = CSCMainID }); CustomerServCenter res = result.Where(x => x.CSCMainID == CSCMainID).FirstOrDefault(); ViewData["res"] = res; return(View(result)); } return(View()); }
public object Post(int id, [FromBody] CustomerServCenter cust) { if (cust.GUUserID == 0) { return(new { result = 1 }); } if (string.IsNullOrWhiteSpace(cust.GUName)) { return(new { result = 1 }); } if (string.IsNullOrWhiteSpace(cust.CSCContent)) { return(new { result = 1 }); } if (cust.CSCContent.Length < 20 || cust.CSCContent.Length > 500) { return(new { result = 1 }); } //cust.CSCMainID = id; cust.GUType = 0; cust.CSCSubId = id; cust.CSCState = cscState.未处理; cust.CSCTime = DateTime.Now; int result = CustomerServCenterBLL.Insert(cust); if (result > 0) { CustomerServCenter c = new CustomerServCenter { CSCMainID = id, CSCState = cscState.未处理, GUUserID = cust.GUUserID }; int r = CustomerServCenterBLL.Update(c); return(new { result = 0 }); } else { return(new { result = 1 }); } }
public object Post([FromBody] CustomerServCenter cust) { if (cust.GUUserID == 0) { return(new { result = 1 }); } if (string.IsNullOrWhiteSpace(cust.GUName)) { return(new { result = 1 }); } if (string.IsNullOrWhiteSpace(cust.CSCTitle)) { return(new { result = 1 }); } if (string.IsNullOrWhiteSpace(cust.CSCContent)) { return(new { result = 1 }); } if (cust.CSCTitle.Length < 4 || cust.CSCTitle.Length > 20) { return(new { result = 1 }); } if (cust.CSCContent.Length < 20 || cust.CSCContent.Length > 500) { return(new { result = 1 }); } cust.GUType = 0; cust.CSCSubId = 0; cust.CSCState = cscState.未处理; cust.CSCTime = DateTime.Now; int result = CustomerServCenterBLL.Insert(cust); if (result > 0) { return(new { result = 0 }); } else { return(new { result = 1 }); } }
// GET: a222 public object Post(int id, [FromBody] CustomerServCenter cust) { if (cust.CSCState != cscState.已解决) { return(new { result = 1 }); } CustomerServCenter c = new CustomerServCenter { CSCMainID = id, CSCState = cust.CSCState, GUUserID = cust.GUUserID }; int result = CustomerServCenterBLL.Update(c); if (result > 0) { return(new { result = 0 }); } else { return(new { result = 1 }); } }
// GET: a222 public object Post(int id, [FromBody] CustomerServCenter cust) { //if (cust.CSCState != 3) //{ // return new { result = 1 }; //} CustomerServCenter c = new CustomerServCenter { CSCMainID = id, CSCState = cust.CSCState, GUUserID = cust.GUUserID }; int result = Data.BLL.CustomerServCenterBLL.Update(c); if (result > 0) { return(new { result = 0 }); } else { return(new { result = 1 }); } }
internal static int Update(CustomerServCenter c) { return(Data.DAL.CustomerServCenterDAL.Update(c)); }
public static CustomerServCenter GetModel(CustomerServCenter model) { return(DAL.CustomerServCenterDAL.GetModel(model)); }
public static IEnumerable <CustomerServCenter> GetListWithCSCSubId(CustomerServCenter cust) { return(DAL.CustomerServCenterDAL.GetListWithCSCSubId(cust)); }
public static int Delete(CustomerServCenter cust) { return(DAL.CustomerServCenterDAL.Delete(cust)); }
public static int Update(CustomerServCenter model) { return(DAL.CustomerServCenterDAL.Update(model)); }
public static int Insert(CustomerServCenter model) { return(DAL.CustomerServCenterDAL.Insert(model)); }
internal static int Insert(CustomerServCenter cust) { return(Data.DAL.CustomerServCenterDAL.Insert(cust)); }
public static int UpdateForManage(CustomerServCenter c) { return(DAL.CustomerServCenterDAL.UpdateForManage(c)); }