• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Admin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Admin的典型用法代码示例。如果您正苦于以下问题:C# Admin类的具体用法?C# Admin怎么用?C# Admin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Admin类属于命名空间,在下文中一共展示了Admin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SaveAdmin

 public bool SaveAdmin(ref Admin admin,
     ref string message)
 {
     var result = true;
     if (!AdminCheck(ref admin, ref message))
     {
         result = false;
     }
     else
     {
         try
         {
             var adminBDO = new AdminBDO();
             TranslateAdminDTOToAdminBDO(admin,
                 adminBDO);
             result = adminLogic.InsertAdmin(
                 ref adminBDO, ref message);
         }
         catch (Exception e)
         {
             var msg = e.Message;
             throw new FaultException<AdminFault>
                 (new AdminFault(msg), msg);
         }
     }
     return result;
 }
开发者ID:handup,项目名称:Public-hospital,代码行数:27,代码来源:AdminService.cs


示例2: button2_Click

        private void button2_Click(object sender, EventArgs e)
        {
            string id = textBox1.Text.Trim();
            string password = textBox2.Text.Trim();
            string againPw = textBox3.Text.Trim();

            if (id != "" && password != "" && againPw != "")
            {
                if (SqlAdmin.exitById(id))
                {
                    MessageBox.Show("该用户名已经存在。");
                    return;
                }
                else if (password != againPw)
                {
                    MessageBox.Show("请确保两段密码相同.");
                }
                else
                {
                    Admin admin = new Admin(id,password);
                    SqlAdmin.addAdmin(admin);
                    MessageBox.Show("注册成功.");
                    Login loginView = new Login();
                    loginView.Show();
                    this.Dispose();
                }
            }
            else
            {
                MessageBox.Show("该输入所有数据.");
            }
        }
开发者ID:IrisLinSQ,项目名称:007,代码行数:32,代码来源:Register.cs


示例3: btConfirm_Click

    /// <summary>
    /// 处理确定按钮点击事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btConfirm_Click(object sender, EventArgs e)
    {
        Admin admin = new Admin();

        MD5CryptoServiceProvider HashMD5 = new MD5CryptoServiceProvider();
        string oldPwd =
            ASCIIEncoding.ASCII.GetString(HashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(tbOldPwd.Text)));
        string newPwd1 =
            ASCIIEncoding.ASCII.GetString(HashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(tbNewPwd1.Text)));
        string newPwd2 =
            ASCIIEncoding.ASCII.GetString(HashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(tdNewPwd2.Text)));

        if (admin.ChangePassword(Session["UserName"].ToString(), oldPwd, newPwd1, newPwd2))
        {
            //胡媛媛修改,修改跳转语句的位置,2010-01-15
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert",
                "<script>alert('修改成功!');window.location='./index.aspx'</script>");
            //Response.Redirect("./index.aspx");
            //胡媛媛修改,修改跳转语句的位置,2010-01-15
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert",
                "<script>alert('对不起,您修改密码失败,原因可能是您输入的原密码不正确或是两次输入的新密码不一致!')</script>");
        }
    }
开发者ID:dalinhuang,项目名称:my-project-step,代码行数:31,代码来源:Change_Admin_Password.aspx.cs


示例4: GetAdmin

 public Admin GetAdmin(int id)
 {
     AdminBDO adminBDO = null;
     try
     {
         adminBDO = adminLogic.GetAdmin(id);
     }
     catch (Exception e)
     {
         var msg = e.Message;
         var reason = "GetAdmin exception";
         throw new FaultException<AdminFault>
             (new AdminFault(msg), reason);
     }
     if (adminBDO == null)
     {
         var msg =
             string.Format("No admin found for id {0}",
             id);
         var reason = "GetAdmin empty";
         throw new FaultException<AdminFault>
             (new AdminFault(msg), reason);
     }
     var admin = new Admin();
     TranslateAdminBDOToAdminDTO(adminBDO,
         admin);
     return admin;
 }
开发者ID:handup,项目名称:Public-hospital,代码行数:28,代码来源:AdminService.cs


示例5: Main

        static void Main(string[] args)
        {
            //Base class
            UserController userController = new UserController();
            userController.Login("John.Smith", "secret");
            //userController.SetPermissions("John.Smith");
            //inherits from userController so gets its methods
            AdminController adminController = new AdminController();
            adminController.Login("Jane.Doe", "pass123");
            adminController.SetPermissions("Jane.Doe");
            //inherits from adminController so get its methods and all the methods inherited from userController
            AdminController superAdminController = new SuperAdminController();
            superAdminController.Login("Joe.Bloggs", "password");
            superAdminController.SetPermissions("Joe.Bloggs");

            Admin admin = new Admin();
            admin.name = "Jane.Doe";
            admin.role = "admin";
            Seller seller = new Seller();
            seller.name = "John.Smith";
            seller.role = "Seller";
            //AbstractUser user = new AbstractUser(); // Oooops, no can do!

            //IDatabaseConnection connection1 = new IDatabaseConnection(); // Not possible!
            IDatabaseConnection connection2 = new MicrosoftDbConnection();

            Console.ReadLine();
        }
开发者ID:amcginlay,项目名称:L-16-OOD-01-NET,代码行数:28,代码来源:Program.cs


示例6: DoRequest

 public string DoRequest(Admin.Model.DesList dmodel)
 {
     try
     {
         HttpWebRequest request = null;
         //ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
         string url = "http://interface.angeletsoft.cn/interface_ent.php";
         request = WebRequest.Create(url) as HttpWebRequest;
         //request.ProtocolVersion = HttpVersion.Version10;
         request.ContentType = "application/json";
         request.Method = "POST";
         request.UserAgent = DefaultUserAgent;
         //string form = "{\"FunctionCode\":\"GET_STATUS_BYID\",\"ID\":\"1\"}";
         string form = "{\"FunctionCode\":\"EXEUTE_ORDER\",\"Body\":{\"Sender\":\"" + dmodel.Sender + "\",\"Receiver\":\"" + dmodel.Receiver + "\",\"CmdOrder\":\"DEL\",\"OrderCotent\":\"D\",\"STATUS\":\"0\",\"IsValid\":\"1\"}}";
         byte[] data = Encoding.UTF8.GetBytes(form);
         request.ContentLength = data.Length;
         using (Stream stream = request.GetRequestStream())
         {
             stream.Write(data, 0, data.Length);
             stream.Close();
         }
         HttpWebResponse wr = request.GetResponse() as HttpWebResponse;
         string cs = wr.CharacterSet;
         StreamReader reader = new StreamReader(wr.GetResponseStream(), Encoding.GetEncoding(cs));
         return reader.ReadToEnd();
     }
     catch (Exception)
     {
         return "";
     }
 }
开发者ID:harvey-chennnnn,项目名称:Customs-,代码行数:31,代码来源:DesData.aspx.cs


示例7: AssignNewJob

 public AssignNewJob(Admin obj)
 {
     InitializeComponent();
     assignnewjobbyadminidtext.Text = obj.adminId;
     assignnewjobbyadminidtext.ReadOnly = true;
      
 }
开发者ID:namespaceahr,项目名称:SFdevHRMS,代码行数:7,代码来源:AssignNewJob.cs


示例8: AssociateController

 public AssociateController(
     IMembershipService membershipService,
     IMembershipService associateMembershipService,
     IAssociateService associateService,
     IDocumentService documentService,
     IReferenceService referenceService,
     IEmployeeService employeeService,
     IProspectService prospectService,
     IPrincipal user,
     IClientProjectSharedService clientProjectSharedService,
     IIndividualService individualService,
     IRoleService roleService,
     Admin.Services.IEmailService emailService)
     : base(membershipService, associateService, user)
 {
     this.associateService = associateService;
     this.documentService = documentService;
     this.referenceService = referenceService;
     this.employeeService = employeeService;
     this.prospectService = prospectService;
     this.associateMembershipService = associateMembershipService;
     this.clientProjectSharedService = clientProjectSharedService;
     this.individualService = individualService;
     this.roleService = roleService;
     this.emailService = emailService;
 }
开发者ID:itvijaykumar,项目名称:MRTest,代码行数:26,代码来源:Sample1_Controller.cs


示例9: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            IEntityAccessor accessor = EntityAccessorFactory.Create(EntityAccessorTypes.WebForm);

            Admin admin = Admin.FindAll()[0];

            accessor
                .SetConfig(EntityAccessorOptions.AllFields, true)
                .SetConfig(EntityAccessorOptions.ItemPrefix, "field")
                .SetConfig(EntityAccessorOptions.Container, this)
                .Write(admin, null);


            Admin admin2 = new Admin();
            accessor.Read(admin2, null);


            Debug.Assert(admin.ID == admin2.ID);
            Debug.Assert(admin.Name == admin2.Name);
            Debug.Assert(admin2.DisplayName == null); // Label只能写不能读
            Debug.Assert(admin2.FriendName == admin2.FriendName);
            Debug.Assert(admin.Logins == admin2.Logins);
            Debug.Assert(admin.IsEnable == admin2.IsEnable);
            Debug.Assert(Math.Abs((admin.LastLogin - admin2.LastLogin).Ticks) < TimeSpan.FromSeconds(1).Ticks);
            Debug.Assert(admin.RoleID == admin2.RoleID);
            Debug.Assert(admin.RoleName == admin2.RoleName);
            Debug.Assert(admin.SSOUserID == admin2.SSOUserID);
        }
    }
开发者ID:windygu,项目名称:asxinyunet,代码行数:31,代码来源:WebFormEntityAccessorTest.aspx.cs


示例10: btnAlta_Click

 protected void btnAlta_Click(object sender, EventArgs e)
 {
     bool est = false;
     if (chkPuede.Checked == true)
     {
         est = true;
     }
     try
     {
         cargarWCF();
         unAdmin = new Admin();
         unAdmin.CI = Convert.ToInt32(txtCi.Text.Trim());
         unAdmin.NOM_COMPLETO = txtNombre.Text.Trim();
         unAdmin.USUARIO = txtUsuario.Text.Trim();
         unAdmin.PASS = txtPass.Text.Trim();
         unAdmin.ESTADISTICAS = est;
         trivias.AltaUsuario((Usuarios)unAdmin);
         Response.Write("<div id=\"exito\" class=\"alert alert-success\">EXITO AL REGISTRAR ADMINISTRADOR</div>"
             + "<script type=\"text/javascript\">window.onload=function(){alertBootstrap();};</script>");
         trivias.Close();
         Limpiar();
     }
     catch (Exception ex)
     {
         Response.Write("<div id=\"error\" class=\"alert alert-danger\">" + ex.Message + "</div>" +
         "<script type=\"text/javascript\">window.onload=function(){alertBootstrap();};</script>");
     }
 }
开发者ID:maxijoga10,项目名称:Trivias,代码行数:28,代码来源:abmAdmins.aspx.cs


示例11: GetAll_DataByEmail

    public static Admin GetAll_DataByEmail(string email)
    {
        Connection con = new Connection();
        string strConnString = con.GetConnString();
        using(SqlConnection SqlCon = new SqlConnection(strConnString))
        {
            SqlCommand SqlComm = new SqlCommand("", SqlCon);
            SqlCon.Open();

            string query = string.Format("SELECT id, name, email, password FROM admin WHERE email='"+ email +"'");
            SqlComm.CommandText = query;
            SqlDataReader reader = SqlComm.ExecuteReader();
            Admin adminDataByEmail = null;

            while(reader.Read())
            {
                int Id = reader.GetInt32(0);
                string Name = reader.GetString(1);
                string Email = reader.GetString(2);
                string Pass = reader.GetString(3);

                adminDataByEmail = new Admin(Id, Name, Email, Pass);
            }
            return adminDataByEmail;
        }
    }
开发者ID:rkchauhan,项目名称:Net-Banking-in-DotNet-LW,代码行数:26,代码来源:Admin.cs


示例12: CreateAdmin

        public ActionResult CreateAdmin(Admin admin)
        {
            if (!Application.IsAuthenticated && Application.AdminType != 1) {
                ViewBag.Header = "Authorization Level Too Low";
                ViewBag.Message = "Your authorization is not valid for this type of operation";
                return View("Message", "_LayoutGuest");
            }

            if (!admin.Email.IsEmail()) {
                ViewBag.Header = "Inputs were incorrect";
                ViewBag.Message = "Please go back to the form and input the correct data";
                return View("Message", "_LayoutAdmin");
            }

            //Airah's Code
            using (KnowledgeChannelEntities context = new KnowledgeChannelEntities()) {

                if (ModelState.IsValid) {
                    admin.Password = Encrypt.ComputeHash(admin.Password, "SHA512", null);
                    admin.DateCreated = DateTime.Now;
                    context.AddToAdmins(admin);
                    context.SaveChanges();
                    return RedirectToAction("ViewAdmins");
                }
            }

            return View();
        }
开发者ID:haroldocampo,项目名称:KChOTS_OnlineTrainingSystem,代码行数:28,代码来源:AdminController.cs


示例13: EvaluatePerformance

        public EvaluatePerformance(Admin obj)
        {
            InitializeComponent();
            evaluatebyadmintext.Text = obj.adminId;
            evaluatebyadmintext.ReadOnly = true;

        }
开发者ID:namespaceahr,项目名称:SFdevHRMS,代码行数:7,代码来源:EvaluatePerformance.cs


示例14: Create

        public Admin Create(Admin admin)
        {
            Context.Admins.Add(admin);
            Context.SaveChanges();

            return admin;
        }
开发者ID:Wijithapaw,项目名称:BlankProject,代码行数:7,代码来源:AdminService.cs


示例15: Bt_Update_Click

    protected void Bt_Update_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            Admin admin = new Admin();
            admin.LoadInfo(Request.Cookies["userID"].Value.ToString());
            if (txtPwdold.Text == admin.adminPwd)
            {
                string xwhere = "where adminID=" + SQLString.GetQuotedString(Request.Cookies["userID"].Value.ToString());
                Hashtable ht = new Hashtable();
                ht.Add("adminPwd", SQLString.GetQuotedString(txtPwdnew.Text));
                if (admin.Update(ht, xwhere))
                {
                    Response.Write("<Script Language=JavaScript>alert(\"密码修改成功!\")</Script>");

                }
                else
                {
                    Response.Write("<Script Language=JavaScript>alert(\"密码修改失败!\")</Script>");
                }

            }
            else
            {
                Response.Write("<Script Language=JavaScript>alert(\"旧密码错误!\")</Script>");

            }
        }
    }
开发者ID:huaminglee,项目名称:OnlinePublish,代码行数:29,代码来源:modifypwd.aspx.cs


示例16: PutAdmin

        public IHttpActionResult PutAdmin(int id, Admin admin)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != admin.AdminId)
            {
                return BadRequest();
            }

            db.Entry(admin).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AdminExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:horoblast,项目名称:WebApps_App,代码行数:32,代码来源:AdminsController.cs


示例17: updateAdmin

        public bool updateAdmin(Admin obj)
        {
            string insertCommand = "update admin set adminName= @adminName,adminPassword = @adminPassword " +
                                   "where adminid= @adminid ";
            SqlCommand command = new SqlCommand(insertCommand);
            SqlParameter idParameter = new SqlParameter("@adminid", SqlDbType.NVarChar, 50);
            idParameter.Value = obj.adminId;
            SqlParameter nameParameter = new SqlParameter("@adminName", SqlDbType.NVarChar, 50);
            nameParameter.Value = obj.adminName;
            SqlParameter passwordParameter = new SqlParameter("@adminPassword", SqlDbType.NVarChar, 50);
            passwordParameter.Value = obj.adminPassword;

            command.Parameters.Add(idParameter);
            command.Parameters.Add(nameParameter);
            command.Parameters.Add(passwordParameter);
            if (da.Execution(command))
            {
                return true;
            }
            else
            {
                return false;
            }
            
        }
开发者ID:namespaceahr,项目名称:SFdevHRMS,代码行数:25,代码来源:AdminData.cs


示例18: btConfirm_Click

    protected void btConfirm_Click(object sender, EventArgs e)
    {
        Admin admin = new Admin ();
        Search search = new Search();

        TeacherInfo thisTeacher = new TeacherInfo();
        thisTeacher.StrUserName=tbxUserName.Text;
        thisTeacher.StrTeacherName=tbxName.Text;
        thisTeacher.StrIdentityId=tbxIdentityNO.Text;

        MD5CryptoServiceProvider HashMD5 = new MD5CryptoServiceProvider();
        thisTeacher.StrPassword=ASCIIEncoding.ASCII.GetString(HashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes("888888")));

        string s = tbxUserName.Text;
        string last4userName = s.Substring(s.Length - 4, 4);
        string p = tbxIdentityNO.Text;
        string last4IdentityNO = p.Substring(p.Length - 4, 4);
        if (last4userName!=last4IdentityNO)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert",
                "<script>alert('请确认用户名末四位与身份证号末四位相同')</script>");
        }
        //else if (thisTeacher.StrIdentityId==search.GetTeacherByUsername(s).StrIdentityId)
        else if (thisTeacher.StrIdentityId == search.GetTeacherByIdentityID(p).StrIdentityId)// 武剑洁修改,2009-9-11
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert",
               "<script>alert('身份证号重复,已存在该老师')</script>");
            tbxIdentityNO.Text = "";
        }
        else if (search.GetTeacherIdByUsername(thisTeacher.StrUserName) > 0)// 尚书修改,2012-8-5
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert",
               "<script>alert('该用户名已存在,请更换')</script>");
            tbxUserName.Text = "";
        }
        else if (search.GetTeacherIdByName(thisTeacher.StrTeacherName) > 0)// 武剑洁修改,2012-8-5
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert",
               "<script>alert('老师姓名重复,请修改姓名以区分两位老师')</script>");
            tbxName.Text = "";
        }
        else
        {
            if (admin.AddTeacher(thisTeacher))
            {
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert",
                //    "<script>alert('添加成功!')</script>");
                // 武剑洁修改,添加页面跳转,2009-9-10
                Response.Write("<script>alert('添加成功!');window.location='./Teacher_Manage.aspx'</script>");
            }
            else
            {
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert",
                //    "<script>alert('添加失败!')</script>");
                // 武剑洁修改,添加页面跳转,2009-9-10
                Response.Write("<script>alert('添加失败!');window.location='./Teacher_Manage.aspx'</script>");
            }
        }
    }
开发者ID:dalinhuang,项目名称:my-project-step,代码行数:59,代码来源:Teacher_Add.aspx.cs


示例19: NoChangesUsingSnapshotter

        public void NoChangesUsingSnapshotter()
        {
            var user = new Admin { UserId = 1 };
            var snap = _database.StartSnapshot(user);

            Assert.AreEqual(0, snap.Changes().Count);
            Assert.AreEqual(0, snap.UpdatedColumns().Count);
        }
开发者ID:robertmilne,项目名称:NPoco,代码行数:8,代码来源:SnapshotterTests.cs


示例20: ProductView

 public ProductView(Admin.ReadModels.Client.IProductsView adminProductView)
 {
     adminProducts = adminProductView;
     if (products.Count == 0)
     {
         InitialiseProducts();
     }
 }
开发者ID:rbanks54,项目名称:microcafe,代码行数:8,代码来源:ProductView.cs



注:本文中的Admin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AdminController类代码示例发布时间:2022-05-24
下一篇:
C# AdjacencyGraph类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap