Esempio n. 1
0
        /// <summary>
        /// Grava dados do Usuario na HzCorporativo..tblUsuario.
        /// </summary>
        private bool Gravar()
        {
            tblUsuario table  = null;
            bool       retval = false;

            try
            {
                table = new tblUsuario();
                table.cmpCoUsuario = ViewState["cmpCoUsuario"].ToString();
                table.cmpDcUsuario = txtUsuario.Text;
                table.cmpCoPerfil  = cmbPerfil.SelectedValue;
                table.cmpDcEmail   = txtEmail.Text;
                table.cmpInAtivo   = chkAtivo.Checked.ToString();
                table.cmpDcSenha   = txtPwd.Text;

                using (DataTable tbl = table.Save(Global.GetConnection()))
                {
                    if (retval = (tbl != null && tbl.Rows.Count > 0))
                    {
                        ViewState["cmpCoUsuario"] = tbl.Rows[0]["cmpCoUsuario"];
                    }
                }

                return(retval);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }