示例#1
0
        protected void btnGuardarRols_Click(object sender, EventArgs e)
        {
            clsRol rol = new clsRol();
            rol.SRol_name = txtRol.Text;

            if (string.IsNullOrEmpty(txtCodigo.Text))
            {
                int iRol_id = CRol.Insert(rol);
                txtCodigo.Text = iRol_id.ToString();
                pnlBuscar.Visible = true;
                LoadRoles();
                grdRols.Enabled = true;

            }
            else
            {
                rol.IRol_id = Convert.ToInt32(txtCodigo.Text);
                rol.sStatus = 0;
                CRol.Update(rol);
                LoadRoles();

                pnlNuevo.Visible = false;
                grdRols.Enabled = true;
            }
        }
示例#2
0
文件: CRol.cs 项目: giselleCZ/edesoft
 private static clsRol Load(DataRow fila)
 {
     clsRol objProxy = new clsRol();
     objProxy.IRol_id = Convert.ToInt32(fila["iRol_id"]);
     objProxy.SRol_name = fila["sRol_name"].ToString();
     objProxy.sStatus = Convert.ToInt32(fila["bStatus"]);
     return objProxy;
 }
示例#3
0
文件: CRol.cs 项目: giselleCZ/edesoft
        public static int Insert(clsRol objProxy)
        {
            ValidationException x = new ValidationException();
            if (string.IsNullOrEmpty(objProxy.SRol_name))
                x.AgregarError("Ingrese el nombre del rol");

            if (x.Cantidad > 0)
                throw x;

            DAORol daoProxy = new DAORol();
            return daoProxy.Insert(objProxy.SRol_name,objProxy.sStatus);
        }