internal DataBlockGroupsEntity GetDataBlockGroupsByGroupId(int DataBlockGroupId) { DataBlockGroupsEntity results = new DataBlockGroupsEntity(); try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "cfg.GetDataBlockGroupsByGroupId"; sproc.StoredProceduresParameter.Add(GetParam("@DataBlockGroupId", DataBlockGroupId.ToString(), SQLServerDatatype.IntDataType)); DataTable dt = new DataTable(); dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, ""); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow rw in dt.Rows) { results = new DataBlockGroupsAdapter().AdaptItem(rw); } } } catch (Exception) { throw; } return(results); }
internal string UpsertDataBlockGroups(DataBlockGroupsEntity obj) { try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "cfg.UpsertDataBlockGroups"; sproc.StoredProceduresParameter.Add(GetParam("@DataBlockGroupId", obj.DataBlockGroupId.ToString(), SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@DataBlockGroupName", obj.DataBlockGroupName, SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@DataBlocksIds", obj.DataBlocksIds, SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@DataBlocks", obj.DataBlocks, SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@APIURL", obj.APIURL, SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@TradeUp", string.IsNullOrEmpty(obj.TradeUp) ? null : obj.TradeUp, SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@CustomerReference", string.IsNullOrEmpty(obj.CustomerReference) ? "" : obj.CustomerReference, SQLServerDatatype.VarcharDataType)); sql.ExecuteNoReturn(CommandType.StoredProcedure, sproc); return(string.Empty); } catch (Exception) { throw; } }
public string UpsertDataBlockGroups(DataBlockGroupsEntity obj) { return(rep.UpsertDataBlockGroups(obj)); }