//Areas public void insertUpdateAreas(string DataTitle, VD_AREAS areas, ref string outputMsg, ref long outputResult) { SqlCommand command = this.DataManager.CreateCommand(DataTitle, CommandType.StoredProcedure); DataManager.AddParameterWithValue(command, "@ID", areas.ID); DataManager.AddParameterWithValue(command, "@Name", areas.Name); DataManager.AddParameterWithValue(command, "@Descriptions", areas.Descriptions); DataManager.AddParameterWithValue(command, "@Quantity", areas.Quantity); DataManager.AddParameterWithValue(command, "@IsActive", areas.IsActive); DataManager.AddParameterWithValue(command, "@zIndex", areas.zIndex); SqlParameter paramOutputMsg = new SqlParameter("@outputMsg", SqlDbType.NVarChar, 1000); paramOutputMsg.Direction = ParameterDirection.Output; DataManager.AddParameter(command, paramOutputMsg); SqlParameter paramOutputResult = new SqlParameter("@outputResult", SqlDbType.BigInt); paramOutputResult.Direction = ParameterDirection.Output; DataManager.AddParameter(command, paramOutputResult); DataManager.ExecuteNonQuery(command); if (paramOutputResult.Value != null) { outputResult = (long)paramOutputResult.Value; outputMsg = paramOutputMsg.Value.ToString(); } else { outputResult = -1; outputMsg = string.Empty; } }
public VD_AREAS getDetailsAreas(string AreasID) { VD_AREAS areas = new VD_AREAS(); _DBAccess = new DBController(); DataSet ds = new DataSet(); ds = _DBAccess.GetEntityDetails("WEB_VD_GET_DETAILS_AREAS", AreasID); if (ds != null && ds.Tables.Count > 0) { if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { areas.ID = Convert.ToInt64(ds.Tables[0].Rows[0]["ID"]); areas.Name = Convert.ToString(ds.Tables[0].Rows[0]["Name"]); areas.Descriptions = Convert.ToString(ds.Tables[0].Rows[0]["Descriptions"]); areas.Quantity = Convert.ToInt32(ds.Tables[0].Rows[0]["Quantity"]); areas.PersonRegister = _DBAccess.countPersonOnAreas("WEB_VD_COUNT_PERSON_AREAS", Convert.ToInt64(ds.Tables[0].Rows[0]["ID"])); areas.IsActive = Convert.ToBoolean(ds.Tables[0].Rows[0]["IsActive"]); areas.zIndex = Convert.ToInt32(ds.Tables[0].Rows[0]["zIndex"]); } } return(areas); }