Exemplo n.º 1
0
 private void ShowInfo()
 {
     NoName.NetShop.BLL.PagesModelBll bll=new NoName.NetShop.BLL.PagesModelBll();
     NoName.NetShop.Model.PagesModel model=bll.GetModel();
     this.lblPageId.Text=model.PageId.ToString();
     this.lblTemplateFile.Text=model.TemplateFile;
     this.lblPageUrl.Text=model.PageUrl;
     this.lblPagePhyPath.Text=model.PagePhyPath;
     this.lblStatus.Text=model.Status.ToString();
     this.lblLastPubTime.Text=model.LastPubTime.ToString();
 }
 private void ShowInfo()
 {
     NoName.NetShop.BLL.PagesModelBll bll   = new NoName.NetShop.BLL.PagesModelBll();
     NoName.NetShop.Model.PagesModel  model = bll.GetModel();
     this.txtPageId.Text       = model.PageId.ToString();
     this.txtTemplateFile.Text = model.TemplateFile;
     this.txtPageUrl.Text      = model.PageUrl;
     this.txtPagePhyPath.Text  = model.PagePhyPath;
     this.txtStatus.Text       = model.Status.ToString();
     this.txtLastPubTime.Text  = model.LastPubTime.ToString();
 }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtPageId.Text))
            {
                strErr += "PageId不是数字!\\n";
            }
            if (this.txtTemplateFile.Text == "")
            {
                strErr += "TemplateFile不能为空!\\n";
            }
            if (this.txtPageUrl.Text == "")
            {
                strErr += "PageUrl不能为空!\\n";
            }
            if (this.txtPagePhyPath.Text == "")
            {
                strErr += "PagePhyPath不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtStatus.Text))
            {
                strErr += "Status不是数字!\\n";
            }
            if (!PageValidate.IsDateTime(txtLastPubTime.Text))
            {
                strErr += "LastPubTime不是时间格式!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      PageId       = int.Parse(this.txtPageId.Text);
            string   TemplateFile = this.txtTemplateFile.Text;
            string   PageUrl      = this.txtPageUrl.Text;
            string   PagePhyPath  = this.txtPagePhyPath.Text;
            int      Status       = int.Parse(this.txtStatus.Text);
            DateTime LastPubTime  = DateTime.Parse(this.txtLastPubTime.Text);


            NoName.NetShop.Model.PagesModel model = new NoName.NetShop.Model.PagesModel();
            model.PageId       = PageId;
            model.TemplateFile = TemplateFile;
            model.PageUrl      = PageUrl;
            model.PagePhyPath  = PagePhyPath;
            model.Status       = Status;
            model.LastPubTime  = LastPubTime;

            NoName.NetShop.BLL.PagesModelBll bll = new NoName.NetShop.BLL.PagesModelBll();
            bll.Update(model);
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(!PageValidate.IsNumber(txtPageId.Text))
            {
            strErr+="PageId�������֣�\\n";
            }
            if(this.txtTemplateFile.Text =="")
            {
            strErr+="TemplateFile����Ϊ�գ�\\n";
            }
            if(this.txtPageUrl.Text =="")
            {
            strErr+="PageUrl����Ϊ�գ�\\n";
            }
            if(this.txtPagePhyPath.Text =="")
            {
            strErr+="PagePhyPath����Ϊ�գ�\\n";
            }
            if(!PageValidate.IsNumber(txtStatus.Text))
            {
            strErr+="Status�������֣�\\n";
            }
            if(!PageValidate.IsDateTime(txtLastPubTime.Text))
            {
            strErr+="LastPubTime����ʱ���ʽ��\\n";
            }

            if(strErr!="")
            {
            MessageBox.Show(this,strErr);
            return;
            }
            int PageId=int.Parse(this.txtPageId.Text);
            string TemplateFile=this.txtTemplateFile.Text;
            string PageUrl=this.txtPageUrl.Text;
            string PagePhyPath=this.txtPagePhyPath.Text;
            int Status=int.Parse(this.txtStatus.Text);
            DateTime LastPubTime=DateTime.Parse(this.txtLastPubTime.Text);

            NoName.NetShop.Model.PagesModel model=new NoName.NetShop.Model.PagesModel();
            model.PageId=PageId;
            model.TemplateFile=TemplateFile;
            model.PageUrl=PageUrl;
            model.PagePhyPath=PagePhyPath;
            model.Status=Status;
            model.LastPubTime=LastPubTime;

            NoName.NetShop.BLL.PagesModelBll bll=new NoName.NetShop.BLL.PagesModelBll();
            bll.Update(model);
        }