Exemplo n.º 1
0
 private void ShowInfo(int pic_ID)
 {
     WalleProject.BLL.t_picture   bll   = new WalleProject.BLL.t_picture();
     WalleProject.Model.t_picture model = bll.GetModel(pic_ID);
     this.lblpic_cate_ID.Text = model.pic_cate_ID.ToString();
     this.lblpic_ID.Text      = model.pic_ID.ToString();
     this.lblpic_date.Text    = model.pic_date.ToString();
     this.lblpic_name.Text    = model.pic_name;
     this.lblpic_valid.Text   = model.pic_valid;
 }
Exemplo n.º 2
0
        private void ShowInfo(int pic_ID)
        {
            WalleProject.BLL.t_picture   bll   = new WalleProject.BLL.t_picture();
            WalleProject.Model.t_picture model = bll.GetPicturModel(pic_ID);
            this.lblpic_cate_ID.Text = model.picturecategory.picca_name;
            this.lblpic_ID.Text      = model.pic_ID.ToString();
            this.lblpic_date.Text    = model.pic_date.ToString();
            this.lblpic_name.Text    = model.pic_name;
            this.lblpic_valid.Text   = model.pic_valid;

            this.ddl_edit.SelectedValue = model.pic_cate_ID.ToString();
            this.edit_date.Text         = model.pic_date.ToString();
            this.edit_name.Text         = model.pic_name;
            this.edit_path.Text         = model.pic_valid;
            img.Src = model.pic_valid;
        }
Exemplo n.º 3
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtpic_cate_ID.Text))
            {
                strErr += "pic_cate_ID格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtpic_date.Text))
            {
                strErr += "pic_date格式错误!\\n";
            }
            if (this.txtpic_name.Text.Trim().Length == 0)
            {
                strErr += "pic_name不能为空!\\n";
            }
            if (this.txtpic_valid.Text.Trim().Length == 0)
            {
                strErr += "pic_valid不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      pic_cate_ID = int.Parse(this.txtpic_cate_ID.Text);
            int      pic_ID      = int.Parse(this.lblpic_ID.Text);
            DateTime pic_date    = DateTime.Parse(this.txtpic_date.Text);
            string   pic_name    = this.txtpic_name.Text;
            string   pic_valid   = this.txtpic_valid.Text;


            WalleProject.Model.t_picture model = new WalleProject.Model.t_picture();
            model.pic_cate_ID = pic_cate_ID;
            model.pic_ID      = pic_ID;
            model.pic_date    = pic_date;
            model.pic_name    = pic_name;
            model.pic_valid   = pic_valid;

            WalleProject.BLL.t_picture bll = new WalleProject.BLL.t_picture();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Exemplo n.º 4
0
        protected void edit_save_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(ddl_edit.SelectedValue))
            {
                strErr += "格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(edit_date.Text))
            {
                strErr += "时间格式错误!\\n";
            }
            if (this.edit_name.Text.Trim().Length == 0)
            {
                strErr += " 不能为空!\\n";
            }
            if (this.edit_path.Text.Trim().Length == 0)
            {
                strErr += " 不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      pic_cate_ID = int.Parse(this.ddl_edit.SelectedValue);
            DateTime pic_date    = DateTime.Parse(this.edit_date.Text);
            string   pic_name    = this.edit_name.Text;
            string   pic_valid   = this.edit_path.Text;

            WalleProject.Model.t_picture model = new WalleProject.Model.t_picture();
            model.pic_cate_ID = pic_cate_ID;

            model.pic_date  = pic_date;
            model.pic_name  = pic_name;
            model.pic_valid = pic_valid;
            model.pic_ID    = Convert.ToInt32(Request.Params["id"]);
            WalleProject.BLL.t_picture bll = new WalleProject.BLL.t_picture();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "ImageView.aspx");
        }