Beispiel #1
0
        public int Insert(string sRol_name, int sStatus)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@id";
            prmA.Direction = ParameterDirection.Output;
            lstParametros.Add(prmA);

            DbParameter prmsRol_name = new SqlParameter();
            prmsRol_name.DbType = DbType.String;
            prmsRol_name.ParameterName = "@sRol_name";
            prmsRol_name.Value = sRol_name;
            prmsRol_name.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsRol_name);

            DbParameter prmsStatus = new SqlParameter();
            prmsStatus.DbType = DbType.Int32;
            prmsStatus.ParameterName = "@sStatus";
            prmsStatus.Value = sStatus;
            prmsStatus.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsStatus);

            SQLConexion conProxy = new SQLConexion();
            if (conProxy.EjecutarDML(lstParametros, "dbo.sp_tblRols_Insert"))
                return Convert.ToInt32(prmA.Value);
            return -1;
        }
Beispiel #2
0
        public int Insert(string sCostCenter_name, string sCostCenter_desc, int iCostCenter_gestion)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmCC = new SqlParameter();
            prmCC.DbType = DbType.Int32;
            prmCC.ParameterName = "@iCostCenter_id";
            prmCC.Direction = ParameterDirection.Output;
            lstParametros.Add(prmCC);

            DbParameter prmsCostCenter_name = new SqlParameter();
            prmsCostCenter_name.DbType = DbType.String;
            prmsCostCenter_name.ParameterName = "@sCostCenter_name";
            prmsCostCenter_name.Value = sCostCenter_name;
            prmsCostCenter_name.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsCostCenter_name);

            DbParameter prmsCostCenter_desc = new SqlParameter();
            prmsCostCenter_desc.DbType = DbType.String;
            prmsCostCenter_desc.ParameterName = "@sCostCenter_desc";
            prmsCostCenter_desc.Value = sCostCenter_desc;
            prmsCostCenter_desc.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsCostCenter_desc);

            DbParameter prmiCostCenter_gestion = new SqlParameter();
            prmiCostCenter_gestion.DbType = DbType.Int16;
            prmiCostCenter_gestion.ParameterName = "@iCostCenter_gestion";
            prmiCostCenter_gestion.Value = iCostCenter_gestion;
            prmiCostCenter_gestion.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiCostCenter_gestion);

            SQLConexion conProxy = new SQLConexion();
            if (conProxy.EjecutarDML(lstParametros, "dbo.InsCostCenter"))
                return Convert.ToInt32(prmCC.Value);
            return -1;
        }
Beispiel #3
0
        public int Insert(string sFamily_name, string sFamily_desc, int iDepreciation_time)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmiFamily_id = new SqlParameter();
            prmiFamily_id.DbType = DbType.Int32;
            prmiFamily_id.ParameterName = "@id";
            prmiFamily_id.Direction = ParameterDirection.Output;
            lstParametros.Add(prmiFamily_id);

            DbParameter prmsFamily_name = new SqlParameter();
            prmsFamily_name.DbType = DbType.String;
            prmsFamily_name.ParameterName = "@sFamily_name";
            prmsFamily_name.Value = sFamily_name;
            prmsFamily_name.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsFamily_name);

            DbParameter prmsFamily_desc = new SqlParameter();
            prmsFamily_desc.DbType = DbType.String;
            prmsFamily_desc.ParameterName = "@sFamily_desc";
            prmsFamily_desc.Value = sFamily_desc;
            prmsFamily_desc.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsFamily_desc);

            DbParameter prmiDepreciation = new SqlParameter();
            prmiDepreciation.DbType = DbType.String;
            prmiDepreciation.ParameterName = "@iDepreciation_time";
            prmiDepreciation.Value = iDepreciation_time;
            prmiDepreciation.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiDepreciation);

            SQLConexion conProxy = new SQLConexion();
            if (conProxy.EjecutarDML(lstParametros, "dbo.sp_tblFamilies_Insert"))
                return Convert.ToInt32(prmiFamily_id.Value);
            return -1;
        }
Beispiel #4
0
        public int Insertar(DateTime fecha, string nombreFactura, string nitFactura, SqlTransaction transaccion)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@codigo";
            prmA.Direction = ParameterDirection.Output;
            lstParametros.Add(prmA);

            DbParameter prmB = new SqlParameter();
            prmB.DbType = DbType.DateTime;
            prmB.ParameterName = "@fecha";
            prmB.Value = fecha;
            prmB.Direction = ParameterDirection.Input;
            lstParametros.Add(prmB);

            DbParameter prmC = new SqlParameter();
            prmC.DbType = DbType.String;
            prmC.ParameterName = "@nombreFactura";
            prmC.Value = nombreFactura;
            prmC.Direction = ParameterDirection.Input;
            lstParametros.Add(prmC);

            DbParameter prmD = new SqlParameter();
            prmD.DbType = DbType.String;
            prmD.ParameterName = "@nitFactura";
            prmD.Value = nitFactura;
            prmD.Direction = ParameterDirection.Input;
            lstParametros.Add(prmD);

            SQLConexion conProxy = new SQLConexion();
            if (conProxy.EjecutarDML(lstParametros, "dbo.InsertFactura", transaccion))
                return Convert.ToInt32(prmA.Value);
            return -1;
        }
Beispiel #5
0
        public int Insertar(int factura_id, int producto_id, int cantidad, SqlTransaction transaccion)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@codigo";
            prmA.Direction = ParameterDirection.Output;
            lstParametros.Add(prmA);

            DbParameter prmB = new SqlParameter();
            prmB.DbType = DbType.Int32;
            prmB.ParameterName = "@factura_id";
            prmB.Value = factura_id;
            prmB.Direction = ParameterDirection.Input;
            lstParametros.Add(prmB);

            DbParameter prmC = new SqlParameter();
            prmC.DbType = DbType.Int32;
            prmC.ParameterName = "@producto_id";
            prmC.Value = producto_id;
            prmC.Direction = ParameterDirection.Input;
            lstParametros.Add(prmC);

            DbParameter prmD = new SqlParameter();
            prmD.DbType = DbType.Int32;
            prmD.ParameterName = "@cantidad";
            prmD.Value = cantidad;
            prmD.Direction = ParameterDirection.Input;
            lstParametros.Add(prmD);

            SQLConexion conProxy = new SQLConexion();
            if (conProxy.EjecutarDML(lstParametros, "dbo.InsertDFactura", transaccion))
                return Convert.ToInt32(prmA.Value);
            return -1;
        }
Beispiel #6
0
        public bool Actualizar(int codigo, string nm,  string rs, string phone, string email, string desc, string dir)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@iProvider_id";
            prmA.Value = codigo;
            prmA.Direction = ParameterDirection.Input;
            lstParametros.Add(prmA);

            DbParameter prmB = new SqlParameter();
            prmB.DbType = DbType.String;
            prmB.ParameterName = "@sProvider_name";
            prmB.Value = nm;
            prmB.Direction = ParameterDirection.Input;
            lstParametros.Add(prmB);

            DbParameter prmD = new SqlParameter();
            prmD.DbType = DbType.String;
            prmD.ParameterName = "@sProvider_rs";
            prmD.Value = rs;
            prmD.Direction = ParameterDirection.Input;
            lstParametros.Add(prmD);
            ////
            DbParameter prmE = new SqlParameter();
            prmE.DbType = DbType.String;
            prmE.ParameterName = "@sProvider_phone";
            prmE.Value = phone;
            prmE.Direction = ParameterDirection.Input;
            lstParametros.Add(prmE);

            DbParameter prmF = new SqlParameter();
            prmF.DbType = DbType.String;
            prmF.ParameterName = "@sProvider_email";
            prmF.Value = email;
            prmF.Direction = ParameterDirection.Input;
            lstParametros.Add(prmF);

            DbParameter prmG = new SqlParameter();
            prmG.DbType = DbType.String;
            prmG.ParameterName = "@sProvider_desc";
            prmG.Value = desc;
            prmG.Direction = ParameterDirection.Input;
            lstParametros.Add(prmG);

            DbParameter prmH = new SqlParameter();
            prmH.DbType = DbType.String;
            prmH.ParameterName = "@sProvider_address";
            prmH.Value = dir;
            prmH.Direction = ParameterDirection.Input;
            lstParametros.Add(prmH);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblProviders_Update");
        }
Beispiel #7
0
        public bool Eliminar(int codigo)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();

            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@iProvider_id";
            prmA.Value = codigo;
            prmA.Direction = ParameterDirection.Input;
            lstParametros.Add(prmA);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblProviders_DeleteRow");
        }
Beispiel #8
0
        public bool Delete(int iFamily_id)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();

            DbParameter prmiFamily_id = new SqlParameter();
            prmiFamily_id.DbType = DbType.Int32;
            prmiFamily_id.ParameterName = "@iFamily_id";
            prmiFamily_id.Value = iFamily_id;
            prmiFamily_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiFamily_id);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblFamilies_DeleteRow");
        }
Beispiel #9
0
        public bool Delete(int codigo)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();

            DbParameter prmId = new SqlParameter();
            prmId.DbType = DbType.Int32;
            prmId.ParameterName = "@iPerson_id";
            prmId.Value = codigo;
            prmId.Direction = ParameterDirection.Input;
            lstParametros.Add(prmId);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblResponsibles_DeleteRow");
        }
Beispiel #10
0
        public bool Eliminar(int iCostCenter_id)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();

            DbParameter prmiCostCenter_id = new SqlParameter();
            prmiCostCenter_id.DbType = DbType.Int32;
            prmiCostCenter_id.ParameterName = "@iCostCenter_id";
            prmiCostCenter_id.Value = iCostCenter_id;
            prmiCostCenter_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiCostCenter_id);

            /*   DbParameter prmDe = new SqlParameter();
               prmDe.DbType = DbType.Int32;
               prmDe.ParameterName = "@iEvento";
               prmDe.Value = 3;
               prmDe.Direction = ParameterDirection.Input;
               lstParametros.Add(prmDe);*/
            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.DeleteCostCenter");
        }
Beispiel #11
0
        public bool Actualizar(int codigo, string nombre)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();

            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@codigo";
            prmA.Value = codigo;
            prmA.Direction = ParameterDirection.Input;
            lstParametros.Add(prmA);

            DbParameter prmB = new SqlParameter();
            prmB.DbType = DbType.String;
            prmB.ParameterName = "@nombre";
            prmB.Value = nombre;
            prmB.Direction = ParameterDirection.Input;
            lstParametros.Add(prmB);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.UpdateEmpleado");
        }
        public bool Delete(int iPerson_id, int iActive_id)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();

            DbParameter prmiPerson_id = new SqlParameter();
            prmiPerson_id.DbType = DbType.Int32;
            prmiPerson_id.ParameterName = "@iPerson_id";
            prmiPerson_id.Value = iPerson_id;
            prmiPerson_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiPerson_id);

            DbParameter prmiActive_id = new SqlParameter();
            prmiActive_id.DbType = DbType.Int32;
            prmiActive_id.ParameterName = "@iActive_id";
            prmiActive_id.Value = iActive_id;
            prmiActive_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiActive_id);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblAsigResponsibleActive_DeleteRow");
        }
Beispiel #13
0
        /// <summary>
        /// Inserta un registro al origen de datos
        /// </summary>
        /// <param name="nombre">Nombre empleado</param>
        /// <returns>Id del empleado insertado</returns>
        public int Insertar(string nombre)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@codigo";
            prmA.Direction = ParameterDirection.Output;
            lstParametros.Add(prmA);

            DbParameter prmB = new SqlParameter();
            prmB.DbType = DbType.String;
            prmB.ParameterName = "@nombre";
            prmB.Value = nombre;
            prmB.Direction = ParameterDirection.Input;
            lstParametros.Add(prmB);

            SQLConexion conProxy = new SQLConexion();
            if (conProxy.EjecutarDML(lstParametros, "dbo.InsertEmpleado"))
                return Convert.ToInt32(prmA.Value);
            return -1;
        }
Beispiel #14
0
        public int Insert(
            int iResponsible_id,
            int iCostCenter_id,
            int iPercent,
            DateTime dtAsignation_time)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmiResponsible_id = new SqlParameter();
            prmiResponsible_id.DbType = DbType.Int32;
            prmiResponsible_id.ParameterName = "@iResponsible_id";
            prmiResponsible_id.Value = Convert.ToInt32(iResponsible_id);
            prmiResponsible_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiResponsible_id);

            DbParameter prmiCostCenter_id = new SqlParameter();
            prmiCostCenter_id.DbType = DbType.Int32;
            prmiCostCenter_id.ParameterName = "@iCostCenter_id";
            prmiCostCenter_id.Value = Convert.ToInt32(iCostCenter_id);
            prmiCostCenter_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiCostCenter_id);

            DbParameter prmiPercent = new SqlParameter();
            prmiPercent.DbType = DbType.Int32;
            prmiPercent.ParameterName = "@iPercent";
            prmiPercent.Value = Convert.ToInt32(iPercent);
            prmiPercent.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiPercent);

            DbParameter prmdtAsignation_time = new SqlParameter();
            prmdtAsignation_time.DbType = DbType.DateTime;
            prmdtAsignation_time.ParameterName = "@dtAsignation_time";
            prmdtAsignation_time.Value = dtAsignation_time;
            prmdtAsignation_time.Direction = ParameterDirection.Input;
            lstParametros.Add(prmdtAsignation_time);

            SQLConexion conProxy = new SQLConexion();
            if (conProxy.EjecutarDML(lstParametros, "dbo.sp_tblPeopleCostCenters_Insert"))
                return 1;
            return -1;
        }
Beispiel #15
0
        public bool Delete(
            int iResponsible_id,
            int iCostCenter_id)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmiResponsible_id = new SqlParameter();
            prmiResponsible_id.DbType = DbType.Int32;
            prmiResponsible_id.ParameterName = "@iResponsible_id";
            prmiResponsible_id.Value = Convert.ToInt32(iResponsible_id);
            prmiResponsible_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiResponsible_id);

            DbParameter prmiCostCenter_id = new SqlParameter();
            prmiCostCenter_id.DbType = DbType.Int32;
            prmiCostCenter_id.ParameterName = "@iCostCenter_id";
            prmiCostCenter_id.Value = Convert.ToInt32(iCostCenter_id);
            prmiCostCenter_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiCostCenter_id);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblPeopleCostCenters_DeleteRow");
        }
Beispiel #16
0
        public int Insertar(string sActive_name,
            string sStatus, int iSubFamily_id,
            int iProvider_id,
            string sBarcode,
            DateTime dRegister_time,
            int iUtilTime,
            string sBrand,
            string sModel,
            string sForm,
            string sSerialNumber,
            string sColor,
            string sCapacity,
            string sMaterial,
            double iHeihgt,
            double iWidth,
            double iWide,
            double iDiameter,
            string sUnit,
            int iDivNumber,
            string sAsign_type,
            string sAcquisition_type,
            DateTime dtBuy_time,
            double iBuy_price,
            bool bInActive)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
                DbParameter prmCod = new SqlParameter();
                prmCod.DbType = DbType.Int32;
                prmCod.ParameterName = "@codigo";
                prmCod.Direction = ParameterDirection.Output;
                lstParametros.Add(prmCod);

                DbParameter prmsActive_name = new SqlParameter();
                prmsActive_name.DbType = DbType.String;
                prmsActive_name.ParameterName = "@sActive_name";
                prmsActive_name.Value = sActive_name;
                prmsActive_name.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsActive_name);

                DbParameter prmsStatus = new SqlParameter();
                prmsStatus.DbType = DbType.String;
                prmsStatus.ParameterName = "@sStatus";
                prmsStatus.Value = sStatus;
                prmsStatus.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsStatus);

                DbParameter prmiSubFamily_id = new SqlParameter();
                prmiSubFamily_id.DbType = DbType.Int16;
                prmiSubFamily_id.ParameterName = "@iSubFamily_id";
                prmiSubFamily_id.Value = iSubFamily_id;
                prmiSubFamily_id.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiSubFamily_id);

                DbParameter prmiProvider_id = new SqlParameter();
                prmiProvider_id.DbType = DbType.Int16;
                prmiProvider_id.ParameterName = "@iProvider_id";
                prmiProvider_id.Value = iProvider_id;
                prmiProvider_id.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiProvider_id);

                DbParameter prmsBarcode = new SqlParameter();
                prmsBarcode.DbType = DbType.String;
                prmsBarcode.ParameterName = "@sBarcode";
                prmsBarcode.Value = sBarcode;
                prmsBarcode.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsBarcode);

                DbParameter prmdRegister_time = new SqlParameter();
                prmdRegister_time.DbType = DbType.DateTime;
                prmdRegister_time.ParameterName = "@dRegister_time";
                prmdRegister_time.Value = dRegister_time;
                prmdRegister_time.Direction = ParameterDirection.Input;
                lstParametros.Add(prmdRegister_time);

                DbParameter prmiUtilTime = new SqlParameter();
                prmiUtilTime.DbType = DbType.Int32;
                prmiUtilTime.ParameterName = "@iUtilTime";
                prmiUtilTime.Value = iUtilTime;
                prmiUtilTime.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiUtilTime);

                DbParameter prmsBrand = new SqlParameter();
                prmsBrand.DbType = DbType.String;
                prmsBrand.ParameterName = "@sBrand";
                prmsBrand.Value = sBrand;
                prmsBrand.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsBrand);

                DbParameter prmsModel = new SqlParameter();
                prmsModel.DbType = DbType.String;
                prmsModel.ParameterName = "@sModel";
                prmsModel.Value = sModel;
                prmsModel.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsModel);

                DbParameter prmsForm = new SqlParameter();
                prmsForm.DbType = DbType.String;
                prmsForm.ParameterName = "@sForm";
                prmsForm.Value = sForm;
                prmsForm.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsForm);

                DbParameter prmsSerialNumber = new SqlParameter();
                prmsSerialNumber.DbType = DbType.String;
                prmsSerialNumber.ParameterName = "@sSerialNumber";
                prmsSerialNumber.Value = sSerialNumber;
                prmsSerialNumber.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsSerialNumber);

                DbParameter prmsColor = new SqlParameter();
                prmsColor.DbType = DbType.String;
                prmsColor.ParameterName = "@sColor";
                prmsColor.Value = sColor;
                prmsColor.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsColor);

                DbParameter prmsCapacity = new SqlParameter();
                prmsCapacity.DbType = DbType.String;
                prmsCapacity.ParameterName = "@sCapacity";
                prmsCapacity.Value = sCapacity;
                prmsCapacity.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsCapacity);

                DbParameter prmsMaterial = new SqlParameter();
                prmsMaterial.DbType = DbType.String;
                prmsMaterial.ParameterName = "@sMaterial";
                prmsMaterial.Value = sMaterial;
                prmsMaterial.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsMaterial);

                DbParameter prmiHeihgt = new SqlParameter();
                prmiHeihgt.DbType = DbType.Int16;
                prmiHeihgt.ParameterName = "@iHeihgt";
                prmiHeihgt.Value = iHeihgt;
                prmiHeihgt.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiHeihgt);

                DbParameter prmiWidth = new SqlParameter();
                prmiWidth.DbType = DbType.Int16;
                prmiWidth.ParameterName = "@iWidth";
                prmiWidth.Value = iWidth;
                prmiWidth.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiWidth);

                DbParameter prmsColor = new SqlParameter();
                prmsColor.DbType = DbType.String;
                prmsColor.ParameterName = "@sColor";
                prmsColor.Value = sColor;
                prmsColor.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsColor);

                SQLConexion conProxy = new SQLConexion();
                if (conProxy.EjecutarDML(lstParametros, "dbo.InsertFactura", transaccion))
                    return Convert.ToInt32(prmA.Value);
                return -1;
        }
Beispiel #17
0
        public int Insertar(string nm, string rs, string phone, string email, string desc, string dir, SqlTransaction transaccion)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@iProvider_id";
            prmA.Direction = ParameterDirection.Output;
            lstParametros.Add(prmA);

            DbParameter prmB = new SqlParameter();
            prmB.DbType = DbType.String;
            prmB.ParameterName = "@sProvider_name";
            prmB.Value = nm;
            prmB.Direction = ParameterDirection.Input;
            lstParametros.Add(prmB);

            DbParameter prmD = new SqlParameter();
            prmD.DbType = DbType.String;
            prmD.ParameterName = "@sProvider_rs";
            prmD.Value = rs;
            prmD.Direction = ParameterDirection.Input;
            lstParametros.Add(prmD);
            ////
            DbParameter prmE = new SqlParameter();
            prmE.DbType = DbType.String;
            prmE.ParameterName = "@sProvider_phone";
            prmE.Value = phone;
            prmE.Direction = ParameterDirection.Input;
            lstParametros.Add(prmE);

            DbParameter prmF = new SqlParameter();
            prmF.DbType = DbType.String;
            prmF.ParameterName = "@sProvider_email";
            prmF.Value = email;
            prmF.Direction = ParameterDirection.Input;
            lstParametros.Add(prmF);

            DbParameter prmG = new SqlParameter();
            prmG.DbType = DbType.String;
            prmG.ParameterName = "@sProvider_desc";
            prmG.Value = desc;
            prmG.Direction = ParameterDirection.Input;
            lstParametros.Add(prmG);

            DbParameter prmH = new SqlParameter();
            prmH.DbType = DbType.String;
            prmH.ParameterName = "@sProvider_address";
            prmH.Value = dir;
            prmH.Direction = ParameterDirection.Input;
            lstParametros.Add(prmH);

            SQLConexion conProxy = new SQLConexion();
            if (conProxy.EjecutarDML(lstParametros, "dbo.sp_tblProviders_Insert", transaccion))
                return Convert.ToInt32(prmA.Value);
            return -1;
        }
Beispiel #18
0
        public bool Update(int iFamily_id, string sFamily_name, string sFamily_desc, int iDepreciation_time)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmiFamily_id = new SqlParameter();
            prmiFamily_id.DbType = DbType.Int32;
            prmiFamily_id.ParameterName = "@iFamily_id";
            prmiFamily_id.Value = iFamily_id;
            prmiFamily_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiFamily_id);

            DbParameter prmsFamily_name = new SqlParameter();
            prmsFamily_name.DbType = DbType.String;
            prmsFamily_name.ParameterName = "@sFamily_name";
            prmsFamily_name.Value = sFamily_name;
            prmsFamily_name.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsFamily_name);

            DbParameter prmsFamily_desc = new SqlParameter();
            prmsFamily_desc.DbType = DbType.String;
            prmsFamily_desc.ParameterName = "@sFamily_desc";
            prmsFamily_desc.Value = sFamily_desc;
            prmsFamily_desc.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsFamily_desc);

            DbParameter prmiDepreciation = new SqlParameter();
            prmiDepreciation.DbType = DbType.String;
            prmiDepreciation.ParameterName = "@iDepreciation_time";
            prmiDepreciation.Value = iDepreciation_time;
            prmiDepreciation.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiDepreciation);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblFamilies_Update");
        }
Beispiel #19
0
        public bool Update(int iSubFamily_id,
            int iFamily_id,
            string sSubFamily_name,
            string sSubFamily_desc)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmiSubFamily_id = new SqlParameter();
            prmiSubFamily_id.DbType = DbType.Int32;
            prmiSubFamily_id.ParameterName = "@iSubFamily_id";
            prmiSubFamily_id.Value = Convert.ToInt32(iSubFamily_id);
            prmiSubFamily_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiSubFamily_id);

            DbParameter prmsSubFamily_name = new SqlParameter();
            prmsSubFamily_name.DbType = DbType.String;
            prmsSubFamily_name.ParameterName = "@sSubFamily_name";
            prmsSubFamily_name.Value = sSubFamily_name;
            prmsSubFamily_name.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsSubFamily_name);

            DbParameter prmsSubFamily_desc = new SqlParameter();
            prmsSubFamily_desc.DbType = DbType.String;
            prmsSubFamily_desc.ParameterName = "@sSubFamily_desc";
            prmsSubFamily_desc.Value = sSubFamily_desc;
            prmsSubFamily_desc.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsSubFamily_desc);

            DbParameter prmiFamily_id = new SqlParameter();
            prmiFamily_id.DbType = DbType.Int32;
            prmiFamily_id.ParameterName = "@iFamily_id";
            prmiFamily_id.Value = Convert.ToInt32(iFamily_id);
            prmiFamily_id.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiFamily_id);

            SQLConexion conProxy=new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblSubFamilies_Update");
        }
Beispiel #20
0
        public bool Update(int iCostCenter_id, string sCostCenter_name, string sCostCenter_desc, int iCostCenter_gestion)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmCC = new SqlParameter();
            prmCC.DbType = DbType.Int32;
            prmCC.ParameterName = "@iCostCenter_id";
            prmCC.Value = iCostCenter_id;
            prmCC.Direction = ParameterDirection.Input;
            lstParametros.Add(prmCC);

            DbParameter prmsCostCenter_name = new SqlParameter();
            prmsCostCenter_name.DbType = DbType.String;
            prmsCostCenter_name.ParameterName = "@sCostCenter_name";
            prmsCostCenter_name.Value = sCostCenter_name;
            prmsCostCenter_name.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsCostCenter_name);

            DbParameter prmsCostCenter_desc = new SqlParameter();
            prmsCostCenter_desc.DbType = DbType.String;
            prmsCostCenter_desc.ParameterName = "@sCostCenter_desc";
            prmsCostCenter_desc.Value = sCostCenter_desc;
            prmsCostCenter_desc.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsCostCenter_desc);

            DbParameter prmiCostCenter_gestion = new SqlParameter();
            prmiCostCenter_gestion.DbType = DbType.Int16;
            prmiCostCenter_gestion.ParameterName = "@iCostCenter_gestion";
            prmiCostCenter_gestion.Value = iCostCenter_gestion;
            prmiCostCenter_gestion.Direction = ParameterDirection.Input;
            lstParametros.Add(prmiCostCenter_gestion);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.ActCostCenter");
        }
Beispiel #21
0
        public bool Update(int iRol_id, string sRol_name, int sStatus)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@iRol_id";
            prmA.Value = iRol_id;
            prmA.Direction = ParameterDirection.Input;
            lstParametros.Add(prmA);

            DbParameter prmsRol_name = new SqlParameter();
            prmsRol_name.DbType = DbType.String;
            prmsRol_name.ParameterName = "@sRol_name";
            prmsRol_name.Value = sRol_name;
            prmsRol_name.Direction = ParameterDirection.Input;
            lstParametros.Add(prmsRol_name);

            DbParameter prmbStatus = new SqlParameter();
            prmbStatus.DbType = DbType.Int32;
            prmbStatus.ParameterName = "@sStatus";
            prmbStatus.Value = sStatus;
            prmbStatus.Direction = ParameterDirection.Input;
            lstParametros.Add(prmbStatus);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblRols_Update");
        }
Beispiel #22
0
        public bool Update( 
            int iActive_id,
            string sActive_name,
            int iSubFamily_id,
            int iProvider_id,
            string sActive_desc,
            string sBarcode,
            DateTime dRegister_time,
            DateTime iUtilTime,
            string sBrand,
            string sModel,
            string sForm,
            string sSerialNumber,
            string sColor,
            string sCapacity,
            string sMaterial,
            decimal iHeihgt,
            decimal iWidth,
            decimal iWide,
            decimal iDiameter,
            string sUnit,
            int iDivNumber,
            string sAsign_type,
            string sAquisition_type,
            DateTime dtBuy_time,
            decimal iBuy_price,
            bool sStatus)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();

                DbParameter prmiActive_id = new SqlParameter();
                prmiActive_id.DbType = DbType.Int32;
                prmiActive_id.ParameterName = "@iActive_id";
                prmiActive_id.Value = iActive_id;
                prmiActive_id.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiActive_id);

                DbParameter prmsActive_name = new SqlParameter();
                prmsActive_name.DbType = DbType.String;
                prmsActive_name.ParameterName = "@sActive_name";
                prmsActive_name.Value = sActive_name;
                prmsActive_name.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsActive_name);

                DbParameter prmiSubFamily_id = new SqlParameter();
                prmiSubFamily_id.DbType = DbType.Int16;
                prmiSubFamily_id.ParameterName = "@iSubFamily_id";
                prmiSubFamily_id.Value = iSubFamily_id;
                prmiSubFamily_id.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiSubFamily_id);

                DbParameter prmiProvider_id = new SqlParameter();
                prmiProvider_id.DbType = DbType.Int16;
                prmiProvider_id.ParameterName = "@iProvider_id";
                prmiProvider_id.Value = iProvider_id;
                prmiProvider_id.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiProvider_id);

                DbParameter prmsBarcode = new SqlParameter();
                prmsBarcode.DbType = DbType.String;
                prmsBarcode.ParameterName = "@sBarcode";
                prmsBarcode.Value = sBarcode;
                prmsBarcode.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsBarcode);

                DbParameter prmsBrand = new SqlParameter();
                prmsBrand.DbType = DbType.String;
                prmsBrand.ParameterName = "@sBrand";
                prmsBrand.Value = sBrand;
                prmsBrand.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsBrand);

                DbParameter prmsModel = new SqlParameter();
                prmsModel.DbType = DbType.String;
                prmsModel.ParameterName = "@sModel";
                prmsModel.Value = sModel;
                prmsModel.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsModel);

                DbParameter prmsForm = new SqlParameter();
                prmsForm.DbType = DbType.String;
                prmsForm.ParameterName = "@sForm";
                prmsForm.Value = sForm;
                prmsForm.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsForm);

                DbParameter prmsSerialNumber = new SqlParameter();
                prmsSerialNumber.DbType = DbType.String;
                prmsSerialNumber.ParameterName = "@sSerialNumber";
                prmsSerialNumber.Value = sSerialNumber;
                prmsSerialNumber.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsSerialNumber);

                DbParameter prmsColor = new SqlParameter();
                prmsColor.DbType = DbType.String;
                prmsColor.ParameterName = "@sColor";
                prmsColor.Value = sColor;
                prmsColor.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsColor);

                DbParameter prmsCapacity = new SqlParameter();
                prmsCapacity.DbType = DbType.String;
                prmsCapacity.ParameterName = "@sCapacity";
                prmsCapacity.Value = sCapacity;
                prmsCapacity.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsCapacity);

                DbParameter prmsMaterial = new SqlParameter();
                prmsMaterial.DbType = DbType.String;
                prmsMaterial.ParameterName = "@sMaterial";
                prmsMaterial.Value = sMaterial;
                prmsMaterial.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsMaterial);

                DbParameter prmsUnit = new SqlParameter();
                prmsUnit.DbType = DbType.String;
                prmsUnit.ParameterName = "@sUnit";
                prmsUnit.Value = sUnit;
                prmsUnit.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsUnit);

                DbParameter prmsAsign_type = new SqlParameter();
                prmsAsign_type.DbType = DbType.String;
                prmsAsign_type.ParameterName = "@sAsign_type";
                prmsAsign_type.Value = sAsign_type;
                prmsAsign_type.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsAsign_type);

                DbParameter prmsAquisition_type = new SqlParameter();
                prmsAquisition_type.DbType = DbType.String;
                prmsAquisition_type.ParameterName = "@sAcquisition_type";
                prmsAquisition_type.Value = sAquisition_type;
                prmsAquisition_type.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsAquisition_type);

                DbParameter prmsStatus = new SqlParameter();
                prmsStatus.DbType = DbType.Boolean;
                prmsStatus.ParameterName = "@sStatus";
                prmsStatus.Value = sStatus;
                prmsStatus.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsStatus);

                DbParameter prmsActive_desc = new SqlParameter();
                prmsActive_desc.DbType = DbType.String;
                prmsActive_desc.ParameterName = "@sActive_desc";
                prmsActive_desc.Value = sActive_desc;
                prmsActive_desc.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsActive_desc);

                DbParameter prmdRegister_time = new SqlParameter();
                prmdRegister_time.DbType = DbType.DateTime;
                prmdRegister_time.ParameterName = "@dRegister_time";
                prmdRegister_time.Value = dRegister_time;
                prmdRegister_time.Direction = ParameterDirection.Input;
                lstParametros.Add(prmdRegister_time);

                DbParameter prmiUtilTime = new SqlParameter();
                prmiUtilTime.DbType = DbType.DateTime;
                prmiUtilTime.ParameterName = "@iUtilTime";
                prmiUtilTime.Value = iUtilTime;
                prmiUtilTime.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiUtilTime);

                DbParameter prmdtBuy_time = new SqlParameter();
                prmdtBuy_time.DbType = DbType.DateTime;
                prmdtBuy_time.ParameterName = "@dtBuy_time";
                prmdtBuy_time.Value = dtBuy_time;
                prmdtBuy_time.Direction = ParameterDirection.Input;
                lstParametros.Add(prmdtBuy_time);

                DbParameter prmiHeihgt = new SqlParameter();
                prmiHeihgt.DbType = DbType.Decimal;
                prmiHeihgt.ParameterName = "@iHeihgt";
                prmiHeihgt.Value = iHeihgt;

                prmiHeihgt.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiHeihgt);

                DbParameter prmiWidth = new SqlParameter();
                prmiWidth.DbType = DbType.Decimal;
                prmiWidth.ParameterName = "@iWidth";
                prmiWidth.Value = iWidth;
                prmiWidth.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiWidth);

                DbParameter prmiWide = new SqlParameter();
                prmiWide.DbType = DbType.Decimal;
                prmiWide.ParameterName = "@iWide";
                prmiWide.Value = iWide;
                prmiWide.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiWide);

                DbParameter prmiDiameter = new SqlParameter();
                prmiDiameter.DbType = DbType.Decimal;
                prmiDiameter.ParameterName = "@iDiameter";
                prmiDiameter.Value = iDiameter;
                prmiDiameter.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiDiameter);

                DbParameter prmiBuy_price = new SqlParameter();
                prmiBuy_price.DbType = DbType.Decimal;
                prmiBuy_price.ParameterName = "@iBuy_price";
                prmiBuy_price.Value = iBuy_price;
                prmiBuy_price.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiBuy_price);

                DbParameter prmiDivNumber = new SqlParameter();
                prmiDivNumber.DbType = DbType.Int32;
                prmiDivNumber.ParameterName = "@iDivNumber";
                prmiDivNumber.Value = iDivNumber;
                prmiDivNumber.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiDivNumber);

                SQLConexion conProxy=new SQLConexion();
                return conProxy.EjecutarDML(lstParametros, "dbo.sp_tblActives_Update");
        }
        public int Insert(
            string sConfirmed_desc,
            string sAsign_desc,
            bool bStatus,
            DateTime dtAsign_date,
            DateTime dtDevolution_date,
            bool bConfirmed,
            int iPerson_id,
            int iActive_id)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
                DbParameter prmCod = new SqlParameter();
                prmCod.DbType = DbType.Int32;
                prmCod.ParameterName = "@id";
                prmCod.Direction = ParameterDirection.Output;
                lstParametros.Add(prmCod);

                DbParameter prmsConfirmed_desc = new SqlParameter();
                prmsConfirmed_desc.DbType = DbType.String;
                prmsConfirmed_desc.ParameterName = "@sConfirmed_desc";
                prmsConfirmed_desc.Value = sConfirmed_desc;
                prmsConfirmed_desc.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsConfirmed_desc);

                DbParameter prmsAsign_desc = new SqlParameter();
                prmsAsign_desc.DbType = DbType.String;
                prmsAsign_desc.ParameterName = "@sAsign_desc";
                prmsAsign_desc.Value = sAsign_desc;
                prmsAsign_desc.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsAsign_desc);

                DbParameter prmbStatus = new SqlParameter();
                prmbStatus.DbType = DbType.Boolean;
                prmbStatus.ParameterName = "@bStatus";
                prmbStatus.Value = bStatus;
                prmbStatus.Direction = ParameterDirection.Input;
                lstParametros.Add(prmbStatus);

                DbParameter prmdtAsign_date = new SqlParameter();
                prmdtAsign_date.DbType = DbType.DateTime;
                prmdtAsign_date.ParameterName = "@dtAsign_date";
                prmdtAsign_date.Value = dtAsign_date;
                prmdtAsign_date.Direction = ParameterDirection.Input;
                lstParametros.Add(prmdtAsign_date);

                DbParameter prmdtDevolution_date = new SqlParameter();
                prmdtDevolution_date.DbType = DbType.DateTime;
                prmdtDevolution_date.ParameterName = "@dtDevolution_date";
                prmdtDevolution_date.Value = dtDevolution_date;
                prmdtDevolution_date.Direction = ParameterDirection.Input;
                lstParametros.Add(prmdtDevolution_date);

                DbParameter prmbConfirmed = new SqlParameter();
                prmbConfirmed.DbType = DbType.Boolean;
                prmbConfirmed.ParameterName = "@bConfirmed";
                prmbConfirmed.Value = bConfirmed;
                prmbConfirmed.Direction = ParameterDirection.Input;
                lstParametros.Add(prmbConfirmed);

                DbParameter prmiPerson_id = new SqlParameter();
                prmiPerson_id.DbType = DbType.Int16;
                prmiPerson_id.ParameterName = "@iPerson_id";
                prmiPerson_id.Value = iPerson_id;
                prmiPerson_id.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiPerson_id);

                SQLConexion conProxy = new SQLConexion();
                if (conProxy.EjecutarDML(lstParametros, "dbo.sp_AsigResponsibleActive_Insert"))
                    return Convert.ToInt32(prmCod.Value);
                return -1;
        }
Beispiel #24
0
        public int Insert(
            string sPerson_name,
            string sPerson_lname,
            string sPerson_dni,
            string sPerson_phone,
            string sPerson_email,
            string sUsername,
            string sPassword,
            int iRol_id,
            DateTime dtStart_time,
            DateTime dtEnd_time,
            int sStatus)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
                DbParameter prmId = new SqlParameter();
                prmId.DbType = DbType.Int32;
                prmId.ParameterName = "@id";
                prmId.Direction = ParameterDirection.Output;
                lstParametros.Add(prmId);

                DbParameter prmsPerson_lname = new SqlParameter();
                prmsPerson_lname.DbType = DbType.String;
                prmsPerson_lname.ParameterName = "@sPerson_lname";
                prmsPerson_lname.Value = sPerson_lname;
                prmsPerson_lname.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsPerson_lname);

                DbParameter prmsPerson_name = new SqlParameter();
                prmsPerson_name.DbType = DbType.String;
                prmsPerson_name.ParameterName = "@sPerson_name";
                prmsPerson_name.Value = sPerson_name;
                prmsPerson_name.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsPerson_name);

                DbParameter prmsStatus = new SqlParameter();
                prmsStatus.DbType = DbType.Int32;
                prmsStatus.ParameterName = "@sStatus";
                prmsStatus.Value = Convert.ToInt32(sStatus);
                prmsStatus.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsStatus);

                DbParameter prmsPerson_dni = new SqlParameter();
                prmsPerson_dni.DbType = DbType.String;
                prmsPerson_dni.ParameterName = "@sPerson_dni";
                prmsPerson_dni.Value = sPerson_dni;
                prmsPerson_dni.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsPerson_dni);

                DbParameter prmsPerson_phone = new SqlParameter();
                prmsPerson_phone.DbType = DbType.String;
                prmsPerson_phone.ParameterName = "@sPerson_phone";
                prmsPerson_phone.Value = sPerson_phone;
                prmsPerson_phone.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsPerson_phone);

                DbParameter prmsPerson_email = new SqlParameter();
                prmsPerson_email.DbType = DbType.String;
                prmsPerson_email.ParameterName = "@sPerson_email";
                prmsPerson_email.Value = sPerson_email;
                prmsPerson_email.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsPerson_email);

                DbParameter prmsUsername = new SqlParameter();
                prmsUsername.DbType = DbType.String;
                prmsUsername.ParameterName = "@sUsername";
                prmsUsername.Value = sUsername;
                prmsUsername.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsUsername);

                DbParameter prmsPassword = new SqlParameter();
                prmsPassword.DbType = DbType.String;
                prmsPassword.ParameterName = "@sPassword";
                prmsPassword.Value = sPassword;
                prmsPassword.Direction = ParameterDirection.Input;
                lstParametros.Add(prmsPassword);

                DbParameter prmiRol_id = new SqlParameter();
                prmiRol_id.DbType = DbType.Int32;
                prmiRol_id.ParameterName = "@iRol_id";
                prmiRol_id.Value = iRol_id;
                prmiRol_id.Direction = ParameterDirection.Input;
                lstParametros.Add(prmiRol_id);

                DbParameter prmdtStart_time = new SqlParameter();
                prmdtStart_time.DbType = DbType.DateTime;
                prmdtStart_time.ParameterName = "@dtStart_time";
                prmdtStart_time.Value = dtStart_time;
                prmdtStart_time.Direction = ParameterDirection.Input;
                lstParametros.Add(prmdtStart_time);

                DbParameter prmdtEnd_time = new SqlParameter();
                prmdtEnd_time.DbType = DbType.DateTime;
                prmdtEnd_time.ParameterName = "@dtEnd_time";
                prmdtEnd_time.Value = dtEnd_time;
                prmdtEnd_time.Direction = ParameterDirection.Input;
                lstParametros.Add(prmdtEnd_time);

                SQLConexion conProxy = new SQLConexion();
                if (conProxy.EjecutarDML(lstParametros, "dbo.sp_tblResponsibles_Insert"))
                    return Convert.ToInt32(prmId.Value);
                return -1;
        }
Beispiel #25
0
        public int Insert(string name, string desc, bool estado, int subarea)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@iLocation_id";
            prmA.Direction = ParameterDirection.Output;
            lstParametros.Add(prmA);

            DbParameter prmB = new SqlParameter();
            prmB.DbType = DbType.String;
            prmB.ParameterName = "@sLocation_name";
            prmB.Value = name;
            prmB.Direction = ParameterDirection.Input;
            lstParametros.Add(prmB);

            DbParameter prmC = new SqlParameter();
            prmC.DbType = DbType.String;
            prmC.ParameterName = "@sLocation_desc";
            prmC.Value = desc;
            prmC.Direction = ParameterDirection.Input;
            lstParametros.Add(prmC);

            DbParameter prmD = new SqlParameter();
            prmD.DbType = DbType.Boolean;
            prmD.ParameterName = "@sStatus";
            prmD.Value = estado;
            prmD.Direction = ParameterDirection.Input;
            lstParametros.Add(prmD);

            DbParameter prmE = new SqlParameter();
            prmE.DbType = DbType.Int32;
            prmE.ParameterName = "@iSubArea_id";
            prmE.Value = subarea;
            prmE.Direction = ParameterDirection.Input;
            lstParametros.Add(prmE);

            SQLConexion conProxy = new SQLConexion();

            if (conProxy.EjecutarDML(lstParametros, "dbo.sp_tblLocations_Insert"))
                return Convert.ToInt32(prmA.Value);
            return -1;
        }
Beispiel #26
0
        //public int Insert(string name, string desc, bool stado, int subarea, SqlTransaction transaccion)
        // {
        //     List<DbParameter> lstParametros = new List<DbParameter>();
        //     DbParameter prmA = new SqlParameter();
        //     prmA.DbType = DbType.Int32;
        //     prmA.ParameterName = "@iLocation_id";
        //     prmA.Direction = ParameterDirection.Output;
        //     lstParametros.Add(prmA);
        //     DbParameter prmB = new SqlParameter();
        //     prmB.DbType = DbType.String;
        //     prmB.ParameterName = "@sLocation_name";
        //     prmB.Value = name;
        //     prmB.Direction = ParameterDirection.Input;
        //     lstParametros.Add(prmB);
        //     DbParameter prmC = new SqlParameter();
        //     prmC.DbType = DbType.String;
        //     prmC.ParameterName = "@sLocation_desc";
        //     prmC.Value = desc;
        //     prmC.Direction = ParameterDirection.Input;
        //     lstParametros.Add(prmC);
        //     DbParameter prmD = new SqlParameter();
        //     prmD.DbType = DbType.Int32;
        //     prmD.ParameterName = "@sStatus";
        //     prmD.Value = stado;
        //     prmD.Direction = ParameterDirection.Input;
        //     lstParametros.Add(prmD);
        //     DbParameter prmE = new SqlParameter();
        //     prmE.DbType = DbType.String;
        //     prmE.ParameterName = "@iSubArea_id";
        //     prmE.Value = subarea;
        //     prmE.Direction = ParameterDirection.Input;
        //     lstParametros.Add(prmE);
        //     SQLConexion conProxy = new SQLConexion();
        //     if (conProxy.EjecutarDML(lstParametros, "dbo.sp_tblLocations_Insert", transaccion))
        //         return Convert.ToInt32(prmA.Value);
        //     return -1;
        // }
        public bool Actualizar(int codigo, string name, string desc, bool stado, int subarea)
        {
            List<DbParameter> lstParametros = new List<DbParameter>();
            DbParameter prmA = new SqlParameter();
            prmA.DbType = DbType.Int32;
            prmA.ParameterName = "@iLocation_id";
            prmA.Value = codigo;
            prmA.Direction = ParameterDirection.Input;
            lstParametros.Add(prmA);

            DbParameter prmB = new SqlParameter();
            prmB.DbType = DbType.String;
            prmB.ParameterName = "@sLocation_name";
            prmB.Value = name;
            prmB.Direction = ParameterDirection.Input;
            lstParametros.Add(prmB);

            DbParameter prmC = new SqlParameter();
            prmC.DbType = DbType.String;
            prmC.ParameterName = "@sLocation_desc";
            prmC.Value = desc;
            prmC.Direction = ParameterDirection.Input;
            lstParametros.Add(prmC);

            DbParameter prmD = new SqlParameter();
            prmD.DbType = DbType.Boolean;
            prmD.ParameterName = "@sStatus";
            prmD.Value = stado;
            prmD.Direction = ParameterDirection.Input;
            lstParametros.Add(prmD);

            DbParameter prmE = new SqlParameter();
            prmE.DbType = DbType.Int32;
            prmE.ParameterName = "@iSubArea_id";
            prmE.Value = subarea;
            prmE.Direction = ParameterDirection.Input;
            lstParametros.Add(prmE);

            SQLConexion conProxy = new SQLConexion();
            return conProxy.EjecutarDML(lstParametros, "sp_tblLocations_Update");
        }