Esempio n. 1
0
 private void ShowInfo(int log_id,string user_telphone)
 {
     la.BLL.log bll=new la.BLL.log();
     la.Model.log model=bll.GetModel(log_id,user_telphone);
     this.lbllog_id.Text=model.log_id.ToString();
     this.lbluser_telphone.Text=model.user_telphone;
     this.lbllog_ip.Text=model.log_ip;
     this.lbllog_time.Text=model.log_time.ToString();
     this.lblLAT.Text=model.LAT.ToString();
     this.lblLNG.Text=model.LNG.ToString();
 }
Esempio n. 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(!PageValidate.IsNumber(txtlog_id.Text))
            {
                strErr+="日志编号格式错误!\\n";
            }
            if(this.txtuser_telphone.Text.Trim().Length==0)
            {
                strErr+="用户Phone不能为空!\\n";
            }
            if(this.txtlog_ip.Text.Trim().Length==0)
            {
                strErr+="登录IP不能为空!\\n";
            }
            if(!PageValidate.IsDateTime(txtlog_time.Text))
            {
                strErr+="登录时间格式错误!\\n";
            }
            if(!PageValidate.IsDecimal(txtLAT.Text))
            {
                strErr+="LAT格式错误!\\n";
            }
            if(!PageValidate.IsDecimal(txtLNG.Text))
            {
                strErr+="LNG格式错误!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int log_id=int.Parse(this.txtlog_id.Text);
            string user_telphone=this.txtuser_telphone.Text;
            string log_ip=this.txtlog_ip.Text;
            DateTime log_time=DateTime.Parse(this.txtlog_time.Text);
            decimal LAT=decimal.Parse(this.txtLAT.Text);
            decimal LNG=decimal.Parse(this.txtLNG.Text);

            la.Model.log model=new la.Model.log();
            model.log_id=log_id;
            model.user_telphone=user_telphone;
            model.log_ip=log_ip;
            model.log_time=log_time;
            model.LAT=LAT;
            model.LNG=LNG;

            la.BLL.log bll=new la.BLL.log();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx");
        }