Пример #1
0
        private void DeleteMaster(EEmpresa entity)
        {
            IDOUpdate objDO = new SYDOMnt.Empresa();

            if(entity.EntityState == EntityState.Unchanged)
                return;

            objDO.Delete(entity);
        }
Пример #2
0
        private object[] UpdateMaster(EEmpresa entity)
        {
            IDOUpdate objDO = new SYDOMnt.Empresa();

            if(entity.EntityState == EntityState.Unchanged)
                return null;

            object[] objRet = null;

            switch(entity.EntityState)
            {

                case EntityState.Added:
                    objRet = objDO.Insert(entity);
                break;

                case EntityState.Modified:
                    if(entity.StAnulado == ConstFlagEstado.DESACTIVADO)
                        objDO.Update(entity);
                    else
                        objDO.Delete(entity);
                break;

                case EntityState.Deleted:
                    objDO.Delete(entity);
                break;

            }

            return objRet;
        }
Пример #3
0
        private ArrayList BuildParamInterface(EEmpresa value)
        {
            ArrayList arrPrm = new ArrayList();

             arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, value.IdEmpresa));
             arrPrm.Add(DataHelper.CreateParameter("@pdsEmpresa", SqlDbType.VarChar, 100, value.DsEmpresa));
             arrPrm.Add(DataHelper.CreateParameter("@pdsAbrev", SqlDbType.VarChar, 15, value.DsAbrev));
             arrPrm.Add(DataHelper.CreateParameter("@pnuRuc", SqlDbType.Char, 11, value.NuRuc));
             arrPrm.Add(DataHelper.CreateParameter("@pdsDireccion", SqlDbType.VarChar, 100, value.DsDireccion));
             arrPrm.Add(DataHelper.CreateParameter("@pfeAcogmtpe", SqlDbType.DateTime, value.FeAcogmtpe));
             arrPrm.Add(DataHelper.CreateParameter("@pnuAcogmtpe", SqlDbType.VarChar, 25, value.NuAcogmtpe));
             arrPrm.Add(DataHelper.CreateParameter("@pidRegLaboral", SqlDbType.Char, 3, value.IdRegLaboral));
             arrPrm.Add(DataHelper.CreateParameter("@pidPais", SqlDbType.Char, 4, value.IdPais));
             arrPrm.Add(DataHelper.CreateParameter("@pidDepa", SqlDbType.Char, 2, value.IdDepa));
             arrPrm.Add(DataHelper.CreateParameter("@pidProv", SqlDbType.Char, 2, value.IdProv));
             arrPrm.Add(DataHelper.CreateParameter("@pidDist", SqlDbType.Char, 2, value.IdDist));
             arrPrm.Add(DataHelper.CreateParameter("@pstAdmPublica", SqlDbType.Char, 1, value.StAdmPublica));
             arrPrm.Add(DataHelper.CreateParameter("@pstAgenEmple", SqlDbType.Char, 1, value.StAgenEmple));
             arrPrm.Add(DataHelper.CreateParameter("@pstEmpIntLab", SqlDbType.Char, 1, value.StEmpIntLab));
             arrPrm.Add(DataHelper.CreateParameter("@pstAfecSenati", SqlDbType.Char, 1, value.StAfecSenati));
             arrPrm.Add(DataHelper.CreateParameter("@pstMicroEmp", SqlDbType.Char, 3, value.StMicroEmp));
             arrPrm.Add(DataHelper.CreateParameter("@pstActivo", SqlDbType.Char, 1, value.StActivo));

             return arrPrm;
        }