Exemple #1
0
        /// <summary>
        /// 点击确定按钮执行的方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.education_Document education_Document_bll = new Maticsoft.BLL.education_Document();
            Maticsoft.Model.education_Document education_Document_model = education_Document_bll.GetModel(DocumentID);
            if (education_Document_model == null)
            {
                education_Document_model = new Maticsoft.Model.education_Document();
            }

            education_Document_model.D_Name = D_Name.Text;
            education_Document_model.D_UserID = UserData.GetUserDate.UserID;
            education_Document_model.D_DateTime = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            education_Document_model.D_Committee = UserData.GetUserDate.U_GroupID;

            switch (CMD)
            {
                case "New":
                    CMD_Txt = "增加";
                    FileUpLoadCommon fc = new FileUpLoadCommon(Common.UpLoadDir + "Document/", false);
                    bool flag = fc.SaveFile(D_Url, false);
                    if (flag)
                    {
                        education_Document_model.D_Url = fc.newFileName;
                        education_Document_model.DocumentID = education_Document_bll.Add(education_Document_model);
                    }
                    else
                    {
                        EventMessage.MessageBox(1, "操作失败", fc.errorMsg, Icon_Type.Error, Common.GetHomeBaseUrl("InfoManager.aspx?CMD=New"));
                    }
                    break;
                case "Edit":
                    CMD_Txt = "修改";
                    education_Document_bll.Update(education_Document_model);
                    break;
            }
            All_Title_Txt = CMD_Txt + App_Txt;
            EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", education_Document_model.DocumentID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));
        }
 private string UpPhoto()
 {
     FileUpLoadCommon fc = new FileUpLoadCommon(Common.UpLoadDir + "UserPhoto/", false);
     fc.SaveFile(U_PhotoUrl, true);
     return fc.newFileName;
 }
Exemple #3
0
        /************************************************************************/
        /* 上传新闻图片                                                         */
        /************************************************************************/
        private string UploadPic(FileUpload fileUpload)
        {
            FileUpLoadCommon fc = new FileUpLoadCommon(ImagePath, false);

            // 如果图片上传成功
            fc.SaveFile(fileUpload, true);
            return fc.newFileName;
        }
Exemple #4
0
        /************************************************************************/
        /* 上传新闻图片                                                         */
        /************************************************************************/
        private string UploadPic(app_NewsEntity ut)
        {
            FileUpLoadCommon fc = new FileUpLoadCommon(Common.UpLoadDir + "NewsImages/", false);

            // 如果图片上传成功
            if(fc.SaveFile(ImageUpload, true))
            {
                //删除原有图片
                removeImge(ut);
            }
            return fc.newFileName;
        }
 private string UpSignPicture()
 {
     FileUpLoadCommon fc = new FileUpLoadCommon(Common.UpLoadDir + "SignPictures/", false);
     fc.SaveFile(FileUpload_SignPicture, true);
     return fc.newFileName;
 }