예제 #1
0
        public static bool DeleteData(OpcionesRecord pComp, ref string sMensaje)
        {
            bool bRetorno = true;

            try
            {
                V2_OPCIONES oCom = new V2_OPCIONES();
                oCom.ConnectionString = Parametros.CadenaConexion;

                oCom.LoadByPrimaryKey(pComp.OPC_ID);


                oCom.MarkAsDeleted();

                oCom.Save();
            }
            catch (Exception ex)
            {
                sMensaje = ex.Message.ToString();
                bRetorno = false;
            }

            return(bRetorno);
        }
예제 #2
0
        public static bool SaveData(OpcionesRecord pComp, ref string sMensaje, bool bAdiciona)
        {
            bool bRetorno = true;

            try
            {
                V2_OPCIONES oCom = new V2_OPCIONES();
                oCom.ConnectionString = Parametros.CadenaConexion;

                if (!bAdiciona)
                {
                    oCom.LoadByPrimaryKey(pComp.OPC_ID);
                }
                else
                {
                    oCom.AddNew();
                }


                oCom.OPC_NAME      = pComp.OPC_NAME;
                oCom.OPC_STATE     = pComp.OPC_STATE;
                oCom.OPC_PARENT_ID = pComp.OPC_PARENT_ID;
                oCom.OPC_FORM      = pComp.OPC_FORM;


                oCom.Save();
            }
            catch (Exception ex)
            {
                sMensaje = ex.Message.ToString();
                bRetorno = false;
            }


            return(bRetorno);
        }