Ejemplo n.º 1
0
 public decimal UserInfo_Delete(int p_user_id)
 {
     try
     {
         UserInfoDA _UserInfoDA = new UserInfoDA();
         decimal    _ck         = _UserInfoDA.UserInfo_Delete(p_user_id);
         DBMemory.GetUser_DoanhNghiep();
         return(_ck);
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(-1);
     }
 }
Ejemplo n.º 2
0
 public bool Contract_Insert(string CONTRACT_CODE, DateTime REGISTER_DATE, decimal PERIOD,
                             decimal RECEIVE_YEAR, decimal WAREHOUSE_ID, string WAREHOUSE_NAME, decimal BUSINESS_ID,
                             decimal MONEY_TYPE, decimal STATUS, string CREATED_BY, DateTime CREATED_DATE, DateTime DUE_DATE)
 {
     try
     {
         Contract_DA _objDA = new Contract_DA();
         return(_objDA.Contract_Insert(CONTRACT_CODE, REGISTER_DATE, PERIOD,
                                       RECEIVE_YEAR, DBMemory.Contract_Get_NextNumber_Receive(), WAREHOUSE_ID, WAREHOUSE_NAME, BUSINESS_ID,
                                       MONEY_TYPE, STATUS, CREATED_BY, CREATED_DATE, DUE_DATE));
     }
     catch (Exception ex)
     {
         Common.log.Error(ex.ToString());
         return(false);
     }
 }
Ejemplo n.º 3
0
 public decimal WareHouse_Delete(decimal WareHouse_Id)
 {
     try
     {
         WareHouse_DA _objDA = new WareHouse_DA();
         decimal      _ck    = _objDA.WareHouse_Delete(WareHouse_Id);
         if (_ck == 1)
         {
             DBMemory.GetWareHouse();
         }
         return(_ck);
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(-1);
     }
 }
Ejemplo n.º 4
0
 public bool WareHouse_Update(decimal WareHouse_Id, string WareHous_Name, string Location)
 {
     try
     {
         WareHouse_DA _objDA = new WareHouse_DA();
         bool         _ck    = _objDA.WareHouse_Update(WareHouse_Id, WareHous_Name, Location);
         if (_ck)
         {
             DBMemory.GetWareHouse();
         }
         return(_ck);
     }
     catch (Exception ex)
     {
         Common.log.Error(ex.ToString());
         return(false);
     }
 }
Ejemplo n.º 5
0
 public decimal WareHouse_Insert(string WareHouse_Code, string WareHouse_Name, string Location)
 {
     try
     {
         WareHouse_DA _objDA = new WareHouse_DA();
         decimal      _ck    = _objDA.WareHouse_Insert(WareHouse_Code, WareHouse_Name, Location);
         if (_ck == 0)
         {
             DBMemory.GetWareHouse();
         }
         return(_ck);
     }
     catch (Exception ex)
     {
         Common.log.Error(ex.ToString());
         return(-1);
     }
 }
Ejemplo n.º 6
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);
     }
 }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
0
        public decimal UserInfo_Insert(string user_name, string password, string fullname, decimal Custom_Id,
                                       decimal user_type, decimal status, string Phone, string Email)
        {
            try
            {
                UserInfoDA _UserInfoDA = new UserInfoDA();
                decimal    _ck         = _UserInfoDA.UserInfo_Insert(user_name, password, fullname, Custom_Id, user_type, status, Phone, Email);

                if (_ck == 0 && user_type == (decimal)NaviCommon.Enum_User_Type.DoanhNghiep)
                {
                    DBMemory.GetUser_DoanhNghiep();
                }
                return(_ck);
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(-1);
            }
        }
Ejemplo n.º 9
0
 public decimal Declaration_Insert(string Declaration_Code, decimal Contract_Id, string Contract_Code, decimal Type, decimal Declaration_Type,
                                   DateTime Register_Date, decimal Money_Type, decimal Total_Value, decimal WareHouse_Id, string WareHouse_Name, string WareHouse_Location, string Gate,
                                   decimal Receive_Number, decimal Receive_Year, decimal VanDon_Number, DateTime VanDon_Date,
                                   decimal Status, string Source, decimal Declaration_Refence_Id, string Declaration_Refence_Code, string Custom_Register,
                                   string CREATED_BY, DateTime CREATED_DATE)
 {
     try
     {
         Declaration_DA _objDA = new Declaration_DA();
         return(_objDA.Declaration_Insert(Declaration_Code, Contract_Id, Contract_Code, Type, Declaration_Type,
                                          Register_Date, Money_Type, Total_Value, WareHouse_Id, WareHouse_Name, WareHouse_Location, Gate,
                                          DBMemory.Declare_Get_NextNumber_Receive(), Receive_Year, VanDon_Number, VanDon_Date,
                                          Status, Source, Declaration_Refence_Id, Declaration_Refence_Code, Custom_Register, CREATED_BY, CREATED_DATE));
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(-1);
     }
 }
Ejemplo n.º 10
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);
            }
        }