private void DeleteRowByID(DataTable table, int rowID) { DataRow found = FindRowByID(table, rowID); if (found != null) { table.Rows.Remove(found); Hashtable hasData = new Hashtable(); hasData["ID"] = rowID; hasData["FIsDelete"] = 1; hasData["FDelDate"] = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ssss")); hasData["FDelUser"] = GetIdentityName(); MessageSettingDal.Update(hasData); } }
private void UpdateDataRow(JObject modifiedRow, int rowId, DataTable source) { DataRow rowData = FindRowByID(source, rowId); UpdateDataRow(modifiedRow, rowData); Hashtable hasData = new Hashtable(); hasData["ID"] = rowData["ID"]; hasData["Contacts"] = rowData["Contacts"]; hasData["ContactPhone"] = rowData["ContactPhone"]; hasData["Type"] = Convert.ToInt32(rowData["Type"] == DBNull.Value ? "0" : rowData["Type"]); hasData["FUpdUser"] = GetIdentityName(); hasData["FUpdDate"] = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ssss")); MessageSettingDal.Update(hasData); }