//保存 protected void saveBtn_Click(object sender, EventArgs e) { if (DataConverter.CLng(BindUser_Hid.Value) == 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('用户不存在!!');", true); } else { string filePath = OAConfig.SignPath + "/" + BindUser_T.Text + "/"; if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } SFile_Up.SaveUrl = filePath; signMod.VPath = SFile_Up.SaveFile(); signMod.SignName = signNameT.Text.Trim(); signMod.SignPwd = SignPwd_T.Text; signMod.SignKey = function.GetRandomString(12); signMod.OwnUserID = DataConverter.CLng(BindUser_Hid.Value); signMod.Status = statusChk.Checked ? 1 : 0; signMod.CreateMan = badmin.GetAdminLogin().AdminId; signMod.CreateTime = DateTime.Now; signMod.Remind = remindT.Text.Trim(); signBll.Insert(signMod); function.WriteSuccessMsg("添加成功", "SignManage.aspx"); } }
//修改 protected void editBtn_Click(object sender, EventArgs e) { signMod = signBll.SelReturnModel(Mid); int userid = DataConverter.CLng(BindUser_Hid.Value); if (userid == 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('用户不存在!!');", true); } else { signMod.SignName = signNameT.Text.Trim(); signMod.SignPwd = SignPwd_T.Text; signMod.OwnUserID = userid; signMod.Status = statusChk.Checked ? 1 : 0; signMod.CreateMan = badmin.GetAdminLogin().AdminId; signMod.CreateTime = DateTime.Now; signMod.Remind = remindT.Text.Trim(); string filePath = OAConfig.SignPath + "/" + BindUser_T.Text + "/"; if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } SFile_Up.SaveUrl = filePath; signMod.VPath = SFile_Up.SaveFile(); signBll.UpdateByID(signMod); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('修改成功!!');window.location.href='SignManage.aspx';", true); signBll.UpdateByID(signMod); function.WriteSuccessMsg("修改成功", "SignManage.aspx"); } }
protected void Add_B_Click(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); M_Design_Page pageMod = new M_Design_Page(); if (!string.IsNullOrEmpty(Guid)) { pageMod = pptBll.SelModelByGuid(Guid); } pageMod.Title = Title_T.Text; pageMod.AccessPwd = AccessPwd_T.Text.Trim(); SFile_Up.SaveUrl = SiteConfig.SiteOption.UploadDir + "User/" + mu.UserName + mu.UserID + "/"; pageMod.PreviewImg = SFile_Up.SaveFile(); if (pageMod.ID > 0) { pptBll.UpdateByID(pageMod); function.Script(this, "top.CloseDiag();"); } else { pageMod.guid = System.Guid.NewGuid().ToString(); pageMod.CUser = mu.UserID; pageMod.UserID = mu.UserID; pageMod.UserName = mu.UserName; pageMod.ZType = 0; //初始化场景数据 InitPage(pageMod); pptBll.Insert(pageMod); function.Script(this, "top.CloseDiag();top.location='/design/ppt/default.aspx?id=" + pageMod.guid + "';"); } }
protected void Edit_B_Click(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); M_Design_Page pageMod = pageBll.SelModelByGuid(Guid); pageMod.Title = Title_T.Text; SFile_Up.SaveUrl = SiteConfig.SiteOption.UploadDir + "User/" + mu.UserName + mu.UserID + "/"; pageMod.PreviewImg = SFile_Up.SaveFile(); pageBll.UpdateByID(pageMod); function.Script(this, "parent.refresh('" + pageMod.Title + "-来自[" + mu.TrueName + "]的手机创作','" + pageMod.PreviewImg + "');"); }
public string getFilePath() { string upload; upload = SiteConfig.SiteOption.UploadDir; string filepath = Server.MapPath("/" + upload + "/Teacher/"); FileSystemObject.CreateFileFolder(filepath, HttpContext.Current); SFile_Up.SaveUrl = function.PToV(filepath); return(SFile_Up.SaveFile()); }
protected void BtUpImage_Click(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); string vpath = SiteConfig.SiteOption.UploadDir + "User/" + mu.UserName + mu.UserID + "/"; SFile_Up.SaveUrl = vpath; string imgurl = SFile_Up.SaveFile(); UserFace_Img.ImageUrl = imgurl; UserFace_Hid.Value = Path.GetFileName(imgurl); tbUserFace.Text = imgurl; }
protected void Save_Btn_Click(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); mu.HoneyName = TrueName_T2.Text; mu.UserFace = SFile_Up.SaveFile(); userMod = userBll.SelReturnModel(mu.UserID); userMod.Mobile = Mobile_T2.Text; userMod.Post = Post_T2.Text; userBll.UpdateByID(userMod); buser.UpdateByID(mu); function.WriteSuccessMsg("操作成功"); }
protected void Button1_Click(object sender, EventArgs e) { string adminname = badmin.GetAdminLogin().AdminName; M_Manufacturers CData = new M_Manufacturers(); if (Mid > 0) { CData = bll.SelReturnModel(Mid); } CData.Producername = this.Producername.Text; CData.Smallname = this.Smallname.Text; CData.CreateTime = DataConverter.CDate(this.CreateTime.Text); CData.Coadd = Coadd.Text; CData.Telpho = Telpho.Text; CData.FaxCode = FaxCode.Text; CData.PostCode = this.PostCode.Text; CData.CoWebsite = this.CoWebsite.Text; CData.Email = this.Email.Text; CData.CoClass = this.CoClass.Text; string vpath = SiteConfig.SiteOption.UploadDir + "Image/" + DateTime.Now.ToString("yyyyMMdd") + "/"; SFile_Up.SaveUrl = vpath; string imgurl = CData.CoPhoto = SFile_Up.SaveFile(); CData.Content = Content.Value; if (Mid > 0) { bll.Update(CData); Response.Write("<Script language=javascript>alert('修改成功!');location.href='ProducerManage.aspx';</Script>"); } else { CData.Istop = 0; CData.Disable = 0; CData.Isbest = 0; bll.Add(CData); Response.Write("<Script language=javascript>alert('添加成功!');location.href='ProducerManage.aspx';</Script>"); } }
//string path = @"~/User/Command/SystemData.xml"; protected void BtUpImage_Click(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); string vpath = SiteConfig.SiteOption.UploadDir + "User/" + mu.UserName + mu.UserID + "/"; SFile_Up.SaveUrl = vpath; string imgurl = SFile_Up.SaveFile(); face.ImageUrl = imgurl; UserFace_Hid.Value = Path.GetFileName(imgurl); tbUserFace.Text = imgurl; //if (HeaderUpImage.PostedFile.ContentLength > 0) //{ // string fname = function.GetRandomString(8)+ Path.GetExtension(HeaderUpImage.PostedFile.FileName); // SafeSC.SaveFile(vpath, HeaderUpImage.PostedFile, fname); // face.ImageUrl = vpath + fname; // tbUserFace.Text = vpath + fname; //} }
protected void Add_B_Click(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); M_Design_Page pageMod = new M_Design_Page(); if (!string.IsNullOrEmpty(Guid)) { pageMod = pageBll.SelModelByGuid(Guid); pageMod.Title = Title_T.Text; SFile_Up.SaveUrl = SiteConfig.SiteOption.UploadDir + "User/" + mu.UserName + mu.UserID + "/"; pageMod.PreviewImg = SFile_Up.SaveFile(); pageBll.UpdateByID(pageMod); Response.Redirect("/design/user/default2.aspx"); } else { pageMod.guid = System.Guid.NewGuid().ToString(); pageMod.Title = Title_T.Text; pageMod.CUser = mu.UserID; pageMod.UserID = mu.UserID; pageMod.UserName = mu.UserName; pageMod.ZType = 0; //预览图 SFile_Up.SaveUrl = SiteConfig.SiteOption.UploadDir + "User/" + mu.UserName + mu.UserID + "/"; pageMod.PreviewImg = SFile_Up.SaveFile(); //初始化场景数据 InitPage(pageMod); pageBll.Insert(pageMod); if (Device.Equals("pc")) { function.Script(this, "top.CloseDiag();top.location='/design/h5/default.aspx?id=" + pageMod.guid + "';"); } else { Response.Redirect("/design/mbh5/default.aspx?id=" + pageMod.guid); } } }
protected void btnTemplateUpLoad_Click(object sender, EventArgs e) { SFile_Up.SaveUrl = CurDirPath; SFile_Up.SaveFile(); Response.Redirect(Request.RawUrl); }