public ActionResult Add(string key, string codeLogin) { var msg = new JsonMessage(false, "Thêm mới dữ liệu thành công."); var model = new DN_Export(); try { if (key != Keyapi) { return(Json(0, JsonRequestBehavior.AllowGet)); } UpdateModel(model); model.Note = HttpUtility.UrlDecode(model.Note); var dateCreated = Request["DateCreated_"] ?? DateTime.Now.ToString("dd/MM/yyyy"); model.DateExport = dateCreated.StringToDecimal(); model.Export_Product_Value = GetListExportItem(codeLogin, model.DateExport); model.DateCreated = DateTime.Now.TotalSeconds(); model.AgencyId = Agencyid(); model.IsDeleted = false; model.Code = DateTime.Now.ToString("yyMMddHHmm"); _da.Add(model); _da.Save(); } catch (Exception ex) { msg.Erros = true; msg.Message = "Dữ liệu chưa được thêm mới."; Log2File.LogExceptionToFile(ex); } return(Json(msg, JsonRequestBehavior.AllowGet)); }
public void Delete(DN_Export item) { FDIDB.DN_Export.Remove(item); }
public void Add(DN_Export item) { FDIDB.DN_Export.Add(item); }