protected void Page_Load(object sender, EventArgs e) { user = new eUser("Manage"); edt = new eForm("a_eke_sysDataViews", user); if (act.Length == 0) { List(); return; } if (act == "copy") { sql = "Insert into a_eke_sysDataViews (ServiceID,MC,SQL,HeaderTemplate,ItemTemplate,SplitTemplate,FooterTemplate,SM,Condition,GroupBy,OrderBy,PageSize,PageNum,PageMode) SELECT ServiceID,MC + ' 复件',SQL,HeaderTemplate,ItemTemplate,SplitTemplate,FooterTemplate,SM,Condition,GroupBy,OrderBy,PageSize,PageNum,PageMode FROM a_eke_sysDataViews where DataViewID='" + id + "'"; eOleDB.Execute(sql); if (Request.ServerVariables["HTTP_REFERER"] == null) { Response.Redirect("DataViews.aspx", true); } else { Response.Redirect(Request.ServerVariables["HTTP_REFERER"].ToString(), true); } Response.End(); return; } #region 信息添加、编辑 /* * foreach (Control control in Controls) * { * if (control is eFormControl) * { * eFormControl ec = control as eFormControl; * Response.Write(ec.Field + "::" + ec.ID + " AA<br>"); * } * if (control is MasterPage) * { * foreach (Control ctrl in control.Controls) * { * if (ctrl is ContentPlaceHolder) * { * foreach (Control ct in ctrl.Controls) * { * if (ct is eFormControl) * { * eFormControl ec = ct as eFormControl; * Response.Write(ec.Field + "::" + ec.ID + " VV<br>"); * } * } * } * } * } * } */ edt.AddControl(eFormControlGroup); edt.onChange += new eFormTableEventHandler(edt_onChange); edt.Handle(); #endregion }
protected void Page_Load(object sender, EventArgs e) { user = new eUser("Manage"); edt = new eForm("a_eke_sysUsers", user); //edt.AutoRedirect = false; if (act.Length == 0) { List(user); return; } if (act == "getrole") { string roleid = eParameters.QueryString("roleid"); DataTable rolePower = eBase.getUserPowerDefault(roleid, "", ""); eJson json = new eJson(rolePower); eBase.Write(json.ToString()); Response.End(); } #region 信息添加、编辑 if (act == "active") //是否显示 { string sql = eParameters.Replace("update a_eke_sysUsers set Active='{querystring:value}' where UserID='{querystring:id}'", null, null); eOleDB.Execute(sql); Response.Redirect(Request.ServerVariables["HTTP_REFERER"] == null ? "Default.aspx" : Request.ServerVariables["HTTP_REFERER"].ToString(), true); eBase.End(); } if (act == "getuser") { sql = "select count(*) from a_eke_sysUsers where yhm='" + eParameters.QueryString("value") + "'"; string temp = eOleDB.getValue(sql); if (temp == "0") { Response.Write("true"); } else { Response.Write("false"); } Response.End(); } if (act == "edit") { f1.Attributes = " readOnly"; } edt.AddControl(eFormControlGroup); eFormControl _roles = new eFormControl("Roles"); _roles.Field = "RoleID"; edt.AddControl(_roles); edt.onChange += new eFormTableEventHandler(edt_onChange); edt.Handle(); #endregion if (act == "add" || act == "edit") { eBase.clearDataCache("a_eke_sysPowers"); LitRoles.Text = getRoles(_roles.Value.ToString()); //edt.Fields["RoleID"].ToString() } }
protected void Action_Actioning(string Actioning) { string sql = ""; eform = new eForm("a_eke_sysModels", user); eform.ModelID = "1"; if (Actioning.ToLower() == "view") { eFormControl uc = new eFormControl("f0"); uc.Field = "Type"; eform.Controls.Add("f0", uc); } if (Actioning.ToLower() == "setsort") { string ParentID = eParameters.QueryString("pid").Replace("NULL", ""); int index = Convert.ToInt32(eParameters.QueryString("index")); DataRow dr = eOleDB.getDataTable("SELECT * FROM a_eke_sysModels where ModelID='" + id + "'").Select()[0]; string oldpid = dr["ParentID"].ToString(); int oldindex = Convert.ToInt32(dr["px"]); if (ParentID == oldpid) //父级不变 { if (oldindex < index) //小变大 { sql = "update a_eke_sysModels set PX=PX-1 where delTag=0 " + (ParentID.Length == 0 ? " and ParentID IS NULL" : " and ParentID='" + ParentID + "'") + " and PX>" + oldindex.ToString() + " and PX<=" + index.ToString(); eOleDB.Execute(sql); } else //大变小 { sql = "update a_eke_sysModels set PX=PX+1 where delTag=0 " + (ParentID.Length == 0 ? " and ParentID IS NULL" : " and ParentID='" + ParentID + "'") + " and PX>=" + index.ToString() + " and PX<" + oldindex.ToString(); eOleDB.Execute(sql); } sql = "update a_eke_sysModels set PX='" + index.ToString() + "' where ModelID='" + id + "'"; eOleDB.Execute(sql); } else { sql = "update a_eke_sysModels set PX=PX-1 where delTag=0 " + (oldpid.Length == 0 ? " and ParentID IS NULL" : " and ParentID='" + oldpid + "'") + " and PX>" + oldindex.ToString(); eOleDB.Execute(sql); sql = "update a_eke_sysModels set PX=PX+1 where delTag=0 " + (ParentID.Length == 0 ? " and ParentID IS NULL" : " and ParentID='" + ParentID + "'") + " and PX>=" + index.ToString(); eOleDB.Execute(sql); sql = "update a_eke_sysModels set PX='" + index.ToString() + "',ParentID=" + (ParentID.Length == 0 ? "NULL" : "'" + ParentID + "'") + " where ModelID='" + id + "'"; eOleDB.Execute(sql); } eBase.clearDataCache("a_eke_sysModels"); eBase.End(); } if (Actioning.Length > 0) { eform.onChange += new eFormTableEventHandler(eform_onChange); eform.AddControl(eFormControlGroup); eform.Handle(); } }
protected void Page_Load(object sender, EventArgs e) { user = new eUser("Manage"); user.Check(); Action = new eAction(); edt = new eForm("a_eke_sysModels", user); //edt.AutoRedirect = false; edt.AddControl(f1); //名称 f2.Field = "Code"; edt.AddControl(f2); //编码 edt.AddControl(f3); //简介 edt.AddControl(f4); //文件 edt.AddControl(f5); //自动 edt.AddControl(f6); //类名 f7.Field = "ParentID"; f7.FieldType = "uniqueidentifier"; edt.AddControl(f7); //上级 edt.AddControl(f8); //关系 edt.AddControl(f9); //类型 if (Action.Value == "del") { string id = eParameters.QueryString("id"); eOleDB.Execute("delete from a_eke_sysModels where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysModelItems where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysModelConditions where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysModelConditionItems where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysConditions where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysPowers where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysActions where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysModelTabs where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysModelPanels where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysUserCustoms where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysUserColumns where ModelID='" + id + "'"); eOleDB.Execute("delete from a_eke_sysCheckUps where ModelID='" + id + "'"); if (Request.ServerVariables["HTTP_REFERER"] == null) { Response.Redirect("ClearModel.aspx", true); } else { Response.Redirect(Request.ServerVariables["HTTP_REFERER"].ToString(), true); } Response.End(); //Response.Redirect(Request.UrlReferrer.PathAndQuery, true); } edt.onChange += new eFormTableEventHandler(edt_onChange); edt.Handle(); Action.Actioning += new eActionHandler(Action_Actioning); Action.Listen(); }
protected void action_Actioning(string Action) { eform = new eForm("Demo_Persons"); if (Action.Length == 0) { List(); } else { eform.AddControl(eFormControlGroup); eform.Handle(); } }
protected void Page_Load(object sender, EventArgs e) { user = new eUser("Manage"); edt = new eForm("a_eke_sysAllowDomain", user); //edt.AutoRedirect = false; if (act.Length == 0) { List(); return; } edt.AddControl(eFormControlGroup); edt.onChange += new eFormTableEventHandler(edt_onChange); edt.Handle(); }
protected void action_Actioning(string Action) { eform = new eForm("Demo_Persons"); eform.AutoRedirect = false;//关闭自动跳转 eform.onChange += eform_onChange; if (Action.Length == 0) { List(); } else { eform.AddControl(eFormControlGroup);//一次添加 eform.Handle(); } }
protected void Action_Actioning(string Actioning) { eform = new eForm("Demo_Persons", user); eform.ModelID = ModelID.Replace("-", "_"); switch (Actioning) { case "": List(); break; default: eform.AddControl(eFormControlGroup); eform.Handle(); break; } }
protected void Page_Load(object sender, EventArgs e) { user = new eUser("Manage"); edt = new eForm("a_eke_sysDataContents", user); if (act.Length == 0) { List(); return; } #region 信息添加、编辑 edt.AddControl(f1); edt.AddControl(f2); edt.AddControl(f3); edt.onChange += new eFormTableEventHandler(edt_onChange); edt.Handle(); #endregion }
protected void Action_Actioning(string Actioning) { switch (Actioning) { case "": eList elist = new eList("ProductConfigs"); elist.Where.Add("delTag=0"); elist.OrderBy.Default = "addTime"; //默认排序 elist.Bind(eDataTable, ePageControl1); break; default: edt.onChange += new eFormTableEventHandler(edt_onChange); edt.Handle(); break; } //Response.Write(Actioning + "A"); }
protected void Action_Actioning(string Actioning) { switch (Actioning) { case "": eList elist = new eList("a_eke_sysRoles"); elist.Fields.Add("RoleID,MC,SM,addTime"); elist.Where.Add("delTag=0"); elist.Where.Add("ServiceID" + (user["ServiceID"].Length == 0 ? " is null" : "='" + user["ServiceID"] + "'")); elist.OrderBy.Default = "addTime"; //默认排序 elist.Bind(eDataTable, ePageControl1); break; default: edt.Handle(); break; } //Response.Write(Actioning + "A"); }
protected void Action_Actioning(string Actioning) { //cform = new eForm("Demo_Persons", user); eform = new eForm("Demo_Persons"); eform.ModelID = "2"; if (Actioning.Length == 0) { List(); } else { if (Actioning.ToLower() == "show") //是否显示 { //string sql = eParameters.replaceParameters("update Demo_Persons set show='{querystring:value}' where ID='{querystring:id}'"); string sql = eParameters.Replace("update Demo_Persons set show='{querystring:value}' where ID='{querystring:id}'", null, null); eOleDB.Execute(sql); Response.Redirect(Request.ServerVariables["HTTP_REFERER"] == null ? "Default.aspx" : Request.ServerVariables["HTTP_REFERER"].ToString(), true); eBase.End(); } eform.AddControl(eFormControlGroup); eform.Handle(); } }
protected void Action_Actioning(string Actioning) { eform = new eForm("Demo_Persons", user); eform.ModelID = ModelID.Replace("-", "_"); eJson js; switch (Actioning) { case "": List(); break; case "show": //是否显示 if (!Convert.ToBoolean(model.Power["show"])) { eBase.Write("<script>alert('没有权限!');history.back();</script>"); eBase.End(); } string sql = eParameters.Replace("update Demo_Persons set show='{querystring:value}' where ID='{querystring:id}'", null, null); eOleDB.Execute(sql); Response.Redirect(Request.ServerVariables["HTTP_REFERER"] == null ? "Default.aspx" : Request.ServerVariables["HTTP_REFERER"].ToString(), true); eBase.End(); break; case "removesearch": #region 除搜索条件 sql = "delete from a_eke_sysUserCustoms where UserCustomID='" + eParameters.QueryString("removeid") + "'"; eOleDB.Execute(sql); eBase.clearDataCache("a_eke_sysUserCustoms"); js = new eJson(); js.Add("success", "1"); js.Add("message", "删除成功!"); js.Add("html", eBase.encode(model.getSearchFilter())); HttpContext.Current.Response.Clear(); eBase.Write(js.ToString()); eBase.End(); #endregion break; case "setsearch": #region 保存搜索条件 string ApplicationID = eParameters.QueryString("appid"); sql = "if exists (select * from a_eke_sysUserCustoms Where " + (ApplicationID.Length == 0 ? "ApplicationID is null" : "ApplicationID='" + ApplicationID + "'") + " and ModelID='" + ModelID + "' and UserID='" + user.ID + "' and MC='" + eParameters.QueryString("mc") + "' and parName='search')"; sql += "update a_eke_sysUserCustoms set parValue='" + eParameters.QueryString("value") + "' where " + (ApplicationID.Length == 0 ? "ApplicationID is null" : "ApplicationID='" + ApplicationID + "'") + " and ModelID='" + ModelID + "' and UserID='" + user.ID + "' and MC='" + eParameters.QueryString("mc") + "'"; sql += " else "; sql += "insert into a_eke_sysUserCustoms (ApplicationID,ModelID,UserID,parName,MC,parValue) "; sql += " values (" + (ApplicationID.Length == 0 ? "NULL" : "'" + ApplicationID + "'") + ",'" + ModelID + "','" + user.ID + "','search','" + eParameters.QueryString("mc") + "','" + eParameters.QueryString("value") + "')"; eOleDB.Execute(sql); eBase.clearDataCache("a_eke_sysUserCustoms"); js = new eJson(); js.Add("success", "1"); js.Add("message", "保存成功!"); js.Add("html", eBase.encode(model.getSearchFilter())); HttpContext.Current.Response.Clear(); eBase.Write(js.ToString()); eBase.End(); #endregion break; default: eform.AddControl(eFormControlGroup); eform.Handle(); break; } }
protected void Action_Actioning(string Actioning) { eform = new eForm("Organizationals", user); eform.ModelID = "1"; if (Actioning.ToLower() == "gethtml") { //Response.AddHeader("Content-Type", "application/json; charset=UTF-8"); Response.Write(getTree(eParameters.QueryString("pid"))); Response.End(); return; } if (Actioning.ToLower() == "setsort") { #region 位置 string ParentID = eParameters.QueryString("pid").Replace("NULL", ""); int index = Convert.ToInt32(eParameters.QueryString("index")); DataRow dr = eOleDB.getDataTable("SELECT * FROM Organizationals where OrganizationalID='" + id + "'").Select()[0]; string oldpid = dr["ParentID"].ToString(); int oldindex = Convert.ToInt32(dr["px"]); if (ParentID == oldpid) //父级不变 { if (oldindex < index) //小变大 { sql = "update Organizationals set PX=PX-1 where delTag=0 " + (ParentID.Length == 0 ? " and ParentID IS NULL" : " and ParentID='" + ParentID + "'") + " and PX>" + oldindex.ToString() + " and PX<=" + index.ToString(); eOleDB.Execute(sql); } else //大变小 { sql = "update Organizationals set PX=PX+1 where delTag=0 " + (ParentID.Length == 0 ? " and ParentID IS NULL" : " and ParentID='" + ParentID + "'") + " and PX>=" + index.ToString() + " and PX<" + oldindex.ToString(); eOleDB.Execute(sql); } sql = "update Organizationals set PX='" + index.ToString() + "' where OrganizationalID='" + id + "'"; eOleDB.Execute(sql); } else { sql = "update Organizationals set PX=PX-1 where delTag=0 " + (oldpid.Length == 0 ? " and ParentID IS NULL" : " and ParentID='" + oldpid + "'") + " and PX>" + oldindex.ToString(); eOleDB.Execute(sql); sql = "update Organizationals set PX=PX+1 where delTag=0 " + (ParentID.Length == 0 ? " and ParentID IS NULL" : " and ParentID='" + ParentID + "'") + " and PX>=" + index.ToString(); eOleDB.Execute(sql); sql = "update Organizationals set PX='" + index.ToString() + "',ParentID=" + (ParentID.Length == 0 ? "NULL" : "'" + ParentID + "'") + " where OrganizationalID='" + id + "'"; eOleDB.Execute(sql); } eBase.End(); #endregion } if (Actioning.Length > 0) { eform.onChange += new eFormTableEventHandler(eform_onChange); eform.AddControl(eFormControlGroup); if (Actioning == "add" && pid.Length > 0) { M1_F2.Value = pid; } eform.Handle(); } else { eTree = getTree(""); if (Request.QueryString["ajax"] != null) { Response.Clear(); eJson json = new eJson(); json.Add("body", eBase.encode(eTree)); HttpContext.Current.Response.Write(json.ToString()); HttpContext.Current.Response.End(); } } }