Exemplo n.º 1
0
 public decimal Product_Delete(decimal Product_Id)
 {
     try
     {
         Product_DA _objDA = new Product_DA();
         decimal    _ck    = _objDA.Product_Delete(Product_Id);
         if (_ck == 1)
         {
             DBMemory.GetProduct();
         }
         return(_ck);
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(-1);
     }
 }
Exemplo n.º 2
0
        public bool Product_Update(decimal Product_Id, string Product_Name, decimal Category_Id, string Unit)
        {
            try
            {
                Product_DA _objDA = new Product_DA();
                bool       _ck    = _objDA.Product_Update(Product_Id, Product_Name, Category_Id, Unit);
                if (_ck)
                {
                    DBMemory.GetProduct();
                }

                return(_ck);
            }
            catch (Exception ex)
            {
                Common.log.Error(ex.ToString());
                return(false);
            }
        }
Exemplo n.º 3
0
        static bool c_HadRunOne = false; //dánh dấu đã gọi lần nào chưa? nếu gọi 1 lần rồi thì sẽ cập nhật thành true

        /// <summary>
        /// Khoi tao luc dau.
        /// return = 0 la ko co loi gi ca,
        /// return = 1 lỗi kết nối db qr, 2-dbcore, 3-dbMSDS
        /// </summary>
        public static int RunStart(ref string p_error)
        {
            try
            {
                if (c_HadRunOne == false)
                {
                    // check connect database
                    DBMemory _DBMemory = new DBMemory();
                    int      _db       = _DBMemory.CheckConnect_Database(ref p_error);
                    if (_db != 0)
                    {
                        return(_db);
                    }

                    DBMemory.Get_First_NumberReceive();

                    DBMemory.GetUser_DoanhNghiep();
                    DBMemory.GetWareHouse();
                    DBMemory.GetProduct();

                    Operator _Operator           = new Operator();
                    Thread   _thr_auto_SendAlert = new Thread(_Operator.ThreadSendAlert_Expiredate);
                    _thr_auto_SendAlert.IsBackground = true;
                    //_thr_auto_SendAlert.Start();

                    //chua chay thì chay và đánh dấu là đã chạy để biét và không chạy lần nữa
                    c_HadRunOne = true;
                }

                return(0);
            }
            catch (Exception ex)
            {
                Common.log.Error(ex.ToString());
                return(-1);
            }
        }