Exemple #1
0
        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()
            }
        }
Exemple #2
0
        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();
        }
Exemple #3
0
        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_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 Page_Load(object sender, EventArgs e)
 {
     user = new eUser("Manage");
     edt  = new eForm("ProductConfigs", user);
     edt.AddControl(eFormControlGroup);
     Action            = new eAction();
     Action.Actioning += new eActionHandler(Action_Actioning);
     Action.Listen();
 }
Exemple #6
0
        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 action_Actioning(string Action)
 {
     eform = new eForm("Demo_Persons");
     if (Action.Length == 0)
     {
         List();
     }
     else
     {
         eform.AddControl(eFormControlGroup);
         eform.Handle();
     }
 }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = eParameters.QueryString("id");

            eform = new eForm("Demo_Persons");

            eform.AddControl(eFormControlGroup);
            //eform.Action = "view";
            //eform.ID = id;
            //eform.Handle();

            eform.LoadAction("view", id);
        }
Exemple #9
0
 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();
 }
Exemple #10
0
 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;
            }
        }
Exemple #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            user = new eUser("Manage");
            edt  = new eForm("a_eke_sysRoles", user);
            //edt.AutoRedirect = false;
            edt.AddControl(eFormControlGroup);
            edt.onChange += new eFormTableEventHandler(edt_onChange);

            Action            = new eAction();
            Action.Actioning += new eActionHandler(Action_Actioning);
            Action.Listen();
            if (act == "add" || act == "edit" || act == "copy")
            {
                eBase.clearDataCache("a_eke_sysPowers");
                LitApps.Text = getApps();
            }
        }
 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 Page_Load(object sender, EventArgs e)
        {
            Type type = HttpContext.Current.Handler.GetType();//CurrentHandler

            System.Reflection.FieldInfo fi = type.GetField("UserArea");
            if (fi != null)
            {
                UserArea = fi.GetValue(Activator.CreateInstance(type)).ToString();
            }

            act = eParameters.QueryString("act");
            if (act.Length == 0)
            {
                act = eParameters.Request("act").ToLower();
            }
            if (act.Length == 0)
            {
                return;
            }
            parentID = eParameters.QueryString("id");

            eUser user = new eUser(UserArea);

            eform = new eForm("Demo_Accessorys", user);
            eform.AutoRedirect = false; //子模块,记得要关闭自动跳转
            eform.AddControl(eFormControlGroup);
            switch (act)
            {
            case "save":
                #region 保存
                string json   = eParameters.Form("eformdata_" + parentModelID);
                eJson  jmodel = new eJson(json);
                jmodel.Convert = true;
                jmodel         = jmodel.GetCollection("eformdata_" + parentModelID);
                eJson jrow = jmodel.Collection[0];

                string tmp = jrow.GetValue("id");
                if (tmp.Length > 0)
                {
                    parentID = tmp;
                }
                string id = eOleDB.getValue("select AccessoryID from Demo_Accessorys where DemoID='" + parentID + "' and delTag=0");
                if (id.Length > 0)
                {
                    eform.ID = id;
                }

                ma_f1.Value = jrow.GetValue("ma_f1");
                ma_f2.Value = jrow.GetValue("ma_f2");
                ma_f3.Value = jrow.GetValue("ma_f3");

                if (id.Length == 0)
                {
                    eform.Fields.Add("DemoID", parentID);
                    eform.Add();
                }
                else
                {
                    eform.Update();
                }
                #endregion
                break;

            case "del":
                eTable etb = new eTable("Demo_Accessorys", user);
                etb.Where.Add("DemoID='" + parentID + "'");
                etb.Delete();
                break;

            default:
                #region 读取Json
                string    accUrl      = eConfig.getString("AccessorysURL");
                string    virtualPath = eBase.getVirtualPath();
                DataTable dt          = eOleDB.getDataTable("select sfz,fkb,byz from Demo_Accessorys where DemoID='" + parentID + "' and delTag=0");
                if (dt.Rows.Count > 0)
                {
                    string basepath = accUrl.Length > 0 ? accUrl : virtualPath;

                    if (act == "view" && dt.Rows[0]["sfz"].ToString().Length > 0)
                    {
                        dt.Rows[0]["sfz"] = basepath + dt.Rows[0]["sfz"].ToString();
                    }
                    if (act == "view" && dt.Rows[0]["fkb"].ToString().Length > 0)
                    {
                        dt.Rows[0]["fkb"] = basepath + dt.Rows[0]["fkb"].ToString();
                    }
                    if (act == "view" && dt.Rows[0]["byz"].ToString().Length > 0)
                    {
                        dt.Rows[0]["byz"] = basepath + dt.Rows[0]["byz"].ToString();
                    }

                    eform.Data = dt.Rows[0];


                    ma_f1.Value = dt.Rows[0]["sfz"].ToString();
                    ma_f2.Value = dt.Rows[0]["fkb"].ToString();
                    ma_f3.Value = dt.Rows[0]["byz"].ToString();

                    sfz = basepath + dt.Rows[0]["sfz"].ToString();
                    fkb = basepath + dt.Rows[0]["fkb"].ToString();
                    byz = basepath + dt.Rows[0]["byz"].ToString();
                }
                #endregion
                break;
            }
        }
        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();
                }
            }
        }