Ejemplo n.º 1
0
        public string Post(LU_Distributorlist _LU_Distributorlist, string transactionType)
        {
            string ret = string.Empty;

            try
            {
                Parameters[] colparameters = new Parameters[8] {
                    new Parameters("@paramId", _LU_Distributorlist.Id, DbType.Int32, ParameterDirection.Input),
                    new Parameters("@paramName", _LU_Distributorlist.Name, DbType.String, ParameterDirection.Input),
                    new Parameters("@paramCreatorId", _LU_Distributorlist.CreatorId, DbType.Int32, ParameterDirection.Input),
                    new Parameters("@paramCreationDate", _LU_Distributorlist.CreationDate, DbType.DateTime, ParameterDirection.Input),
                    new Parameters("@paramModifierId", _LU_Distributorlist.ModifierId, DbType.Int32, ParameterDirection.Input),
                    new Parameters("@paramModificationDate", _LU_Distributorlist.ModificationDate, DbType.DateTime, ParameterDirection.Input),
                    new Parameters("@paramIsActive", _LU_Distributorlist.IsActive, DbType.Boolean, ParameterDirection.Input),
                    new Parameters("@paramTransactionType", transactionType, DbType.String, ParameterDirection.Input)
                };
                dbExecutor.ManageTransaction(TransactionType.Open);
                ret = dbExecutor.ExecuteScalarString(true, CommandType.StoredProcedure, "wsp_LU_DistributorList_Post", colparameters, true);
                dbExecutor.ManageTransaction(TransactionType.Commit);
            }
            catch (DBConcurrencyException except)
            {
                dbExecutor.ManageTransaction(TransactionType.Rollback);
                throw except;
            }
            catch (Exception ex)
            {
                dbExecutor.ManageTransaction(TransactionType.Rollback);
                throw ex;
            }
            return(ret);
        }
        public string Post(LU_Distributorlist obj, string transactionType)
        {
            string ret = string.Empty;

            try
            {
                obj.CreatorId        = 1;
                obj.ModifierId       = 1;
                obj.CreationDate     = DateTime.Now;
                obj.ModificationDate = DateTime.Now;
                ret = Facade.LU_DistributorlistDAO.Post(obj, transactionType);
                return(ret);
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }