Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
 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;
     }
 }
Exemplo n.º 4
0
 public SqlHelper()
 {
     ds        = new SearchCondition();
     sqlString = String.Empty;
 }