public CategoryInfo GetCategoryById(Guid categoryId) { SqlConnection conn; IList<CategoryInfo> category; SearchCondition[] condition = new SearchCondition[] { new SearchCondition{con="id=@id",param="@id",value=categoryId.ToString()}}; using (conn = SqlHelper.CreateConntion()) { conn.Open(); category = categoryDal.GetCategory(condition, conn); if(category.Count>0) { return category[0]; } conn.Close(); return null; } }
public CheckBillInfo GetCheckBillById(Guid id) { SqlConnection conn; IList<CheckBillInfo> l; SearchCondition[] condition = new SearchCondition[] { new SearchCondition{con="id=@id",param="@id",value=categoryId.ToString()}}; using (conn = SqlHelper.CreateConntion()) { conn.Open(); l = DAL.GetCheckBill(condition, conn); if(l.Count>0) { return l[0]; } conn.Close(); return null; } }
public StockInInfo GetStockInById(Guid stockInId) { SqlConnection conn; IList<StockInInfo> l; SearchCondition[] condition = new SearchCondition[] { new SearchCondition { con = "id=@id", param = "@id", value = stockInId.ToString() } }; using (conn = SqlHelper.CreateConntion()) { conn.Open(); l = DAL.GetStockIn(condition, conn); if(l.Count>0) { return l[0]; } conn.Close(); return null; } }
public SqlHelper() { ds = new SearchCondition(); sqlString = String.Empty; }