Пример #1
0
 public DisbursementFacade()
 {
     ctx = new SSISDBEntities();
 }
 public PurchaseOrderReportEntityFacade()
 {
     entity = new SSISDBEntities();
     sqlCon = new SqlConnection(ConfigurationManager.ConnectionStrings["SSISDBConnectionString"].ConnectionString);
 }
Пример #3
0
 public UserFacade()
 {
     ctx = new SSISDBEntities();
     errorobj = new ErrorLog();
 }
Пример #4
0
 public LoginFacade()
 {
     entity = new SSISDBEntities();
 }
Пример #5
0
 public MenuFacade()
 {
     entity = new SSISDBEntities();
 }
Пример #6
0
        public void updateStock(string itemId, int stockQty)
        {
            try
            {
                //ctx.updateStockPro(itemId, stockQty);

                using(SSISDBEntities ct = new SSISDBEntities())
                {
                    item it = (from i in ct.items
                               where i.itemId == itemId
                               select i).FirstOrDefault();

                    int result = Convert.ToInt32(it.stockBalance) - stockQty;
                    if(result <0)
                    {
                        it.stockBalance = 0;
                    }
                    else
                    {
                        it.stockBalance = result;
                    }

                    ct.SaveChanges();
                }

            }
            catch (Exception exception)
            {
                errorobj.WriteErrorLog("CatalogueFacade-updateStock():::" + exception.ToString());
            }
        }
Пример #7
0
 public CatalogueFacade()
 {
     ctx = new SSISDBEntities();
     errorobj = new ErrorLog();
 }
Пример #8
0
 public RequisitionFacade()
 {
     ctx = new SSISDBEntities();
     errorobj = new ErrorLog();
 }
Пример #9
0
 public DepartmentFacade()
 {
     ctx = new SSISDBEntities();
     errorobj = new ErrorLog();
 }