protected void Button1_Click(object sender, EventArgs e) { Daxu.Entity.Dyimg Dyimfinfo = new Daxu.Entity.Dyimg(); Dyimfinfo.conter = FCKeditor1.Value; Dyimfinfo.id = 2; Daxu.BLL.DyimgBLL.UpdateIDyimg(Dyimfinfo); }
protected void Calculate() { List<Daxu.Entity.Dyimg> DyimgList = Daxu.BLL.DyimgBLL.GetIDyimgData("select * from Dyimg where id!=2 and id!=3 ") as List<Daxu.Entity.Dyimg>; foreach (Daxu.Entity.Dyimg Dyimginfo in DyimgList) { TimeSpan time = Convert.ToDateTime(Dyimginfo.datetimeFb).AddDays(30).Date - DateTime.Now.Date; Daxu.Entity.Dyimg Dyimg = new Daxu.Entity.Dyimg(); Dyimg.days = (time.Days).ToString(); Dyimg.id = Convert.ToInt32(Dyimginfo.id); if (Convert.ToInt32(Dyimg.days) > 0) { Daxu.BLL.DyimgBLL.UpdateIDyimg(Dyimg); } else if (Convert.ToInt32(Dyimg.days) < 0) { Daxu.BLL.DyimgBLL.DeleteIDyimg(Convert.ToInt32(Dyimginfo.id)); } } }
protected void Button1_Click(object sender, EventArgs e) { UserHandle.UserHandle.InitModules_Admin("FMYGL"); if (UserHandle.UserHandle.ValidationHandle_Admin(RoleTag.Edit)) { Daxu.Entity.Dyimg Dyimfinfo = new Daxu.Entity.Dyimg(); Dyimfinfo.conter = FCKeditor1.Value; Dyimfinfo.datetimeFb = DateTime.Now; Dyimfinfo.areaid = _fenlei.SelectedValue; // 判断是否存在,若存在栏目就修改,否则增加 // Daxu.BLL.DyimgBLL.GetIDyimgFirstColumn("select top 1 * from "); Dyimfinfo.id = Convert.ToInt32(_fenlei.SelectedValue); Daxu.BLL.DyimgBLL.UpdateIDyimg( Dyimfinfo); Response.Redirect("index.aspx"); } else { Response.Write("<script>alert(\"对不起权限不足!\");location.href='../baseinfo/info.aspx';</script>"); } }
protected void SAVE_Click(object sender, EventArgs e) { if (UpdateId.Value != "0") { if (LanMDrlist.SelectedValue == UpdateId1.Value) { Daxu.Entity.nav navinfo = new Daxu.Entity.nav(); navinfo.navname = Convert.ToString(TxtName.Text); navinfo.px = Convert.ToInt32(SZPX.Text); navinfo.mbname = Convert.ToString(MBLX.Value); navinfo.Lmlx = LMLX.SelectedValue; navinfo.LmImg = LanMuPic.Value; navinfo.url = _url.Text; string fileth = "~/upload/images/" + Daxu.BLL.navBll.getInavModel("select * from nav where id='" + Convert.ToInt32(UpdateId.Value) + "'").LmImg; FileInfo filee = new FileInfo(Server.MapPath(fileth)); if (filee.Exists) { filee.Delete(); } navinfo.id = Convert.ToInt32(UpdateId.Value); Daxu.BLL.navBll.UpdateInav(navinfo); Bind(); loadDrList(Convert.ToString(IDSc.Value).Trim()); Response.Write("<script>alert(\"提示:修改成功!\");window.location='" + Request.RawUrl + "';</script>"); } else //移动操作 { //执行增加-或者-移动 Daxu.Entity.nav NavEd = Daxu.BLL.navBll.getInavModel("select * from nav where id=" + UpdateId1.Value + ""); //是否移动根目录 int i = Daxu.BLL.navBll.GetInavZDYLMYD(Convert.ToString(IDSc.Value).Trim(), UpdateId1.Value, NavEd.rootpart); if (i > 0) { Response.Write("<script>alert(\"移动成功!!\");window.location='" + Request.RawUrl + "';</script>"); } else { Response.Write("<script>alert(\"移动失败!!\");window.location='" + Request.RawUrl + "';</script>"); } Bind(); } } else { Daxu.Entity.nav navinfo = new Daxu.Entity.nav(); navinfo.navname = Convert.ToString(TxtName.Text);//栏目名称 navinfo.px = Convert.ToInt32(SZPX.Text);//排序 navinfo.mbname = Convert.ToString(MBLX.Value);//模板名称 if (LanMDrlist.SelectedValue == YDDrList.SelectedValue) { //执行增加 navinfo.rootpart = Convert.ToString(Request.QueryString["id"]); navinfo.fid = LanMDrlist.SelectedValue; Daxu.Entity.nav EntitNav = Daxu.BLL.navBll.getInavModel("select top 1 * from nav where id='" + Convert.ToInt32(Request.QueryString["id"]) + "'"); //如果父级栏目设置子栏目同步,并且没有选在栏目类型的情况下 if ((EntitNav.Zlmtb == "1") && (LMLX.SelectedValue == "-1")) { navinfo.Lmlx = EntitNav.Lmlx;//栏目类型同步到下一级 } else { navinfo.Lmlx = LMLX.SelectedValue; } navinfo.url = _url.Text; navinfo.LmImg = LanMuPic.Value; //Daxu.BLL.navBll.InsertInav(navinfo); //单页图文类型新增后 try { int id = Daxu.BLL.navBll.InsertEntity<nav>(navinfo); Dyimg dyimg = new Dyimg(); dyimg.id = id; Daxu.BLL.DyimgBLL.InsertEntity<Dyimg>(dyimg); } catch (Exception ex) { Response.Write("<script>alert(\"" + ex.Message + "!\");</script>"); } Bind(); Response.Write("<script>alert(\"增加成功!\");</script>"); } } }