コード例 #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(!PageValidate.IsDateTime(txtLoginTime.Text))
            {
            strErr+="LoginTime����ʱ���ʽ��\\n";
            }
            if(this.txtIP.Text =="")
            {
            strErr+="IP����Ϊ�գ�\\n";
            }

            if(strErr!="")
            {
            MessageBox.Show(this,strErr);
            return;
            }
            DateTime LoginTime=DateTime.Parse(this.txtLoginTime.Text);
            string IP=this.txtIP.Text;

            NoName.NetShop.Model.LoginLogModel model=new NoName.NetShop.Model.LoginLogModel();
            model.LoginTime=LoginTime;
            model.IP=IP;

            NoName.NetShop.BLL.LoginLogModelBll bll=new NoName.NetShop.BLL.LoginLogModelBll();
            bll.Update(model);
        }
コード例 #2
0
 private void ShowInfo(int UserId)
 {
     NoName.NetShop.BLL.LoginLogModelBll bll=new NoName.NetShop.BLL.LoginLogModelBll();
     NoName.NetShop.Model.LoginLogModel model=bll.GetModel(UserId);
     this.lblUserId.Text=model.UserId.ToString();
     this.txtLoginTime.Text=model.LoginTime.ToString();
     this.txtIP.Text=model.IP;
 }