示例#1
0
 public bool Delete(int _idSuppiler)
 {
     try
     {
         string[] arrParaName  = new string[] { "@Id" };
         object[] arrParaValue = new object[] { _idSuppiler };
         COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(confItem);
         _sql.ExecuteNonQuery("USP_DEL_DEPARTMENT", arrParaName, arrParaValue);
         return(true);
     }
     catch (Exception ex)
     {
         //TODO: Ghi log cho nay.
         throw ex;
     }
 }
示例#2
0
 private void Delete(int _id)
 {
     try
     {
         string[] arrParaName = new string[] {
             "@Id"
         };
         object[] arrParaValue = new object[] {
             _id
         };
         COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(_ConfigItem);
         _sql.ExecuteNonQuery("USP_DEL_UNIT", arrNames: arrParaName, arrValues: arrParaValue);
     }
     catch (Exception ex)
     {
         AppDebug(ex);
     }
 }
示例#3
0
 public static int Update(ConfigItem p_configItem, DataRow p_drGroup)
 {
     COREBASE.COMMAND.SQL.AccessSQL l_sql = new COREBASE.COMMAND.SQL.AccessSQL(p_configItem);
     try
     {
         string[] l_arrName  = new string[] { "@Id", "@Name", "@Mod_By", "@Remark", "@ID_Cat" };
         object[] l_arrValue = new object[] { p_drGroup["Id"], p_drGroup["Name"], p_configItem.Login_UserName, p_drGroup["Remark"], p_drGroup["Id_Cat"] };
         l_sql.Connect(p_configItem);
         return(l_sql.ExecuteNonQuery("USP_UPD_GROUP", l_arrName, l_arrValue));
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         l_sql.Disconnect();
     }
 }
示例#4
0
 public static int Delete(ConfigItem p_configItem, int p_Group_Pk)
 {
     COREBASE.COMMAND.SQL.AccessSQL l_sql = new COREBASE.COMMAND.SQL.AccessSQL(p_configItem);
     try
     {
         string[] l_arrName  = new string[] { "@Id" };
         object[] l_arrValue = new object[] { p_Group_Pk };
         l_sql.Connect(p_configItem);
         return(l_sql.ExecuteNonQuery("USP_DEL_GROUP", l_arrName, l_arrValue));
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         l_sql.Disconnect();
     }
 }
示例#5
0
 public static bool Delete(ConfigItem p_ConfigItem, int _idSuppiler)
 {
     COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem);
     try
     {
         string[] arrParaName  = new string[] { "@Id" };
         object[] arrParaValue = new object[] { _idSuppiler };
         _sql.Connect(p_ConfigItem);
         _sql.ExecuteNonQuery("USP_DEL_SUPPLIER", arrParaName, arrParaValue);
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         _sql.Disconnect();
     }
 }
示例#6
0
 public static bool Update(ConfigItem p_ConfigItem, object[] arrValue)
 {
     COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem);
     try
     {
         string[] arrParaName = new string[] {
             "@Id",
             "@RoleList"
         };
         _sql.Connect(p_ConfigItem);
         _sql.ExecuteNonQuery("USP_Update_USERROLE", arrParaName, arrValue);
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         _sql.Disconnect();
     }
 }
示例#7
0
 public static bool ketchuyen(COMMAND.Config.ConfigItem _confItem)
 {
     try
     {
         string[] arrParaName  = new string[] { "@Crt_By" };
         object[] arrParaValue = new object[] { _confItem.Login_UserName };
         COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(_confItem);
         if (_sql.ExecuteNonQuery("usp_vpp_ketchuyenkho", arrParaName, arrParaValue) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         //TODO: Ghi log cho nay.
         throw ex;
     }
 }
示例#8
0
        public bool Update(object [] arrValue)
        {
            try
            {
                string[] arrParaName = new string[] {
                    "@Id",
                    "@Name",
                    "@Mod_Dt",
                    "@Mod_By",
                    "@Is_Del",
                    "@Remark",
                    "@Id_Cat"
                };

                COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(confItem);
                _sql.ExecuteNonQuery("usp_UpdateVPP_GROUP", arrNames: arrParaName, arrValues: arrValue);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#9
0
        public bool Update(object[] arrValue)
        {
            try
            {
                string[] arrParaName = new string[] {
                    "@Id",
                    "@Id_Dis",
                    "@Name",
                    "@Mod_By",
                    "@Remark",
                    "@Phone",
                    "@LeaderId"
                };

                COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(confItem);
                _sql.ExecuteNonQuery("USP_UPD_DEPARTMENT", arrNames: arrParaName, arrValues: arrValue);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#10
0
 public static void Restore(ConfigItem p_ConfigItem, string file)
 {
     COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem);
     try
     {
         string[] arrParaName = new string[] {
             "@Path"
         };
         string[] arrParaValue = new string[] {
             file
         };
         _sql.Connect(p_ConfigItem);
         _sql.ExecuteNonQuery("[USP_SYS_Restore]", arrParaName, arrParaValue);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         _sql.Disconnect();
     }
 }
示例#11
0
        public static bool DeleteDetail(ConfigItem p_ConfigItem, DataRow p_drValue)
        {
            bool l_rs = false;

            COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem);
            string[] arrParaName  = new string[] { "@Id", "@Crt_By" };
            object[] arrParaValue = new object[] { p_drValue["Id"], p_ConfigItem.Login_ID };
            try
            {
                _sql.Connect(p_ConfigItem);
                _sql.ExecuteNonQuery("USP_DEL_TAKE_OUT_DETAIL", arrParaName, arrParaValue);
                l_rs = true;
            }
            catch (Exception ex)
            {
                l_rs = false;
                throw ex;
            }
            finally
            {
                _sql.Disconnect();
            }
            return(l_rs);
        }
示例#12
0
 private void Insert(DataRow row)
 {
     try
     {
         string[] arrParaName = new string[] {
             "@Name",
             "@Crt_Dt",
             "@Crt_By",
             "@Remark"
         };
         object[] arrParaValue = new object[] {
             row["Name"],
             DateTime.Now,
             _ConfigItem.Login_UserName,
             row["Remark"]
         };
         COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(_ConfigItem);
         _sql.ExecuteNonQuery("USP_INS_UNIT", arrNames: arrParaName, arrValues: arrParaValue);
     }
     catch (Exception ex)
     {
         AppDebug(ex);
     }
 }
示例#13
0
 private bool UpdateData(DataTable tbDetail, int _id_WareHouse, int _TotalAMT, int _iId_Supplier_Pk, DateTime _iTake_In_Date, int _User_Pk, string _BillNumber, string _Remark, DateTime _billdate, int _pk)
 {
     System.Data.SqlClient.SqlConnection _sqlConnection = new System.Data.SqlClient.SqlConnection(_ConfigItem.StrConnection);
     if (_sqlConnection.State != ConnectionState.Open)
     {
         _sqlConnection.Open();
     }
     System.Data.SqlClient.SqlTransaction _sqlTransaction = _sqlConnection.BeginTransaction();
     try
     {
         int      _iNumberItem = tbDetail.Rows.Count;
         string[] arrName      = new string[] { "@Supplier_Pk", "@Take_In_Date", "@Number_Item", "@TotalAMT", "@Crt_By", "@WareHouse_Pk", "@Remark", "@BillNumber", "@BillDate", "@Pk", "@User_Pk" };
         object[] arrValue     = new object[] { _iId_Supplier_Pk, _iTake_In_Date, _iNumberItem, _TotalAMT, _ConfigItem.Login_UserName, _id_WareHouse, _Remark, _BillNumber, _billdate, _pk, _User_Pk };
         _providerSQL = new COREBASE.COMMAND.SQL.AccessSQL();
         int _idMaster = _providerSQL.ExecuteNonQuery(_sqlConnection, _sqlTransaction, "USP_UPD_TAKE_IN", arrName, arrValue);
         for (int i = 0; i < _iNumberItem; i++)
         {
             arrName = new string[] {
                 "@Take_In_Pk",
                 "@Crt_By",
                 "@Remark",
                 "@Number_Bill",
                 "@Number_Real",
                 "@Price",
                 "@Vat",
                 "@Item_Pk",
                 "@UnitStyle_Pk",
                 "@pk"
             };
             arrValue = new object[] {
                 _idMaster,
                 _ConfigItem.Login_UserName,
                 string.Empty,
                 tbDetail.Rows[i]["Number_Bill"],
                 tbDetail.Rows[i]["Number_Real"],
                 tbDetail.Rows[i]["Price"],
                 tbDetail.Rows[i]["Vat"],
                 tbDetail.Rows[i]["Item_Pk"],
                 tbDetail.Rows[i]["UnitStyle_Pk"],
                 tbDetail.Rows[i]["Id"]
             };
             _providerSQL.ExecuteNonQuery(_sqlConnection, _sqlTransaction, "USP_UPD_TAKE_IN_DETAIL", arrName, arrValue);
         }
         _sqlTransaction.Commit();
         _providerSQL.Disconnect(_sqlConnection);
         return(true);
     }
     catch (Exception ex)
     {
         _sqlTransaction.Rollback();
         AppDebug(ex);
         if (_providerSQL != null)
         {
             if (_sqlConnection != null)
             {
                 _providerSQL.Disconnect(_sqlConnection);
             }
         }
         return(false);
     }
 }
示例#14
0
        public static bool Update(ConfigItem p_ConfigItem, DataRow p_drValue, DataTable p_dtValue)
        {
            bool l_rs = false;

            System.Data.SqlClient.SqlConnection _sqlConnection = new System.Data.SqlClient.SqlConnection(p_ConfigItem.StrConnection);
            if (_sqlConnection.State != ConnectionState.Open)
            {
                _sqlConnection.Open();
            }
            System.Data.SqlClient.SqlTransaction _sqlTransaction = _sqlConnection.BeginTransaction();
            COREBASE.COMMAND.SQL.AccessSQL       _providerSQL    = new COREBASE.COMMAND.SQL.AccessSQL();
            try
            {
                string[] arrParaName = new string[] {
                    "@Id",
                    "@Number_Item",
                    "@Remark",
                    "@Crt_By",
                    "@Department_pk",
                    "@PriceTotal",
                    "@Take_Out_Date",
                    "@User_Pk"
                };
                object[] arrValue = new object[] {
                    p_drValue["Id"],
                    p_drValue["Number_Item"],
                    p_drValue["Remark"],
                    p_ConfigItem.Login_ID,
                    p_drValue["Department_pk"],
                    p_drValue["PriceTotal"],
                    p_drValue["Take_Out_Date"],
                    p_drValue["User_Pk"]
                };
                int _idMaster = _providerSQL.ExecuteNonQuery(_sqlConnection, _sqlTransaction, "USP_UPD_TAKE_OUT", arrParaName, arrValue);

                arrParaName = new string[] {
                    "@Id",
                    "@Take_Out_Pk",
                    "@Number_Item",
                    "@Remark",
                    "@Crt_By",
                    "@Price",
                    "@Item_Pk",
                    "@UnitStyle_Pk"
                };
                for (int i = 0; i < p_dtValue.Rows.Count; i++)
                {
                    DataRow l_drValue = p_dtValue.Rows[i];
                    if (p_dtValue.Rows[i].RowState == DataRowState.Added)
                    {
                        arrValue = new object[] {
                            l_drValue["Take_Out_Pk"],
                            p_ConfigItem.Login_ID,
                            l_drValue["Remark"],
                            l_drValue["Number_Real"],
                            l_drValue["Price"],
                            l_drValue["Item_Pk"],
                            l_drValue["UnitStyle_Pk"]
                        };
                        _providerSQL.ExecuteNonQuery(_sqlConnection, _sqlTransaction, "USP_INS_TAKE_OUT_DETAIL", arrParaName, arrValue);
                    }
                    if (p_dtValue.Rows[i].RowState == DataRowState.Modified)
                    {
                        arrValue = new object[] {
                            l_drValue["Id"],
                            l_drValue["Take_Out_Pk"],
                            l_drValue["Number_Real"],
                            l_drValue["Remark"],
                            p_ConfigItem.Login_ID,
                            l_drValue["Price"],
                            l_drValue["Item_Pk"],
                            l_drValue["UnitStyle_Pk"]
                        };
                        _providerSQL.ExecuteNonQuery(_sqlConnection, _sqlTransaction, "USP_UPD_TAKE_OUT_DETAIL", arrParaName, arrValue);
                    }
                }
                _sqlTransaction.Commit();
                l_rs = true;
            }
            catch (Exception ex)
            {
                l_rs = false;
                _sqlTransaction.Rollback();
                throw ex;
            }
            finally
            {
                _providerSQL.Disconnect(_sqlConnection);
            }
            return(l_rs);
        }