private void AddUpdate() { string strJson = new StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd(); Position_DTO objInfo = JsonConvert.DeserializeObject <Position_DTO>(strJson); int result = 0; ResponseResult objResponse = new ResponseResult(); if ((objInfo != null)) { if ((objInfo.PositionID < 1)) { result = objImpl.Insert(objInfo); objResponse.d = Convert.ToString(result); objResponse.msg = "Thêm mới thành công!"; objResponse.hasExecuted = true; objResponse.c = 1; } else { result = objImpl.Update(objInfo); objResponse.d = Convert.ToString(result); objResponse.msg = "Sửa thành công!"; objResponse.hasExecuted = true; objResponse.c = 1; } } HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "application/json"; HttpContext.Current.Response.Write(JsonConvert.SerializeObject(objResponse)); HttpContext.Current.Response.End(); }
public int Insert(Position_DTO obj) { return(Int32.Parse(SqlHelper.ExecuteScalarOfT("Position_Insert", obj).ToString())); }
public int Update(Position_DTO obj) { return(SqlHelper.ExecuteNonQueryOfT("Position_Update", obj)); }
public int Insert(Position_DTO obj) { return(objPositon_DAL.Insert(obj)); }
public int Update(Position_DTO obj) { return(objPositon_DAL.Update(obj)); }