Ejemplo n.º 1
0
    //=============================================================

    /// <summary>
    /// 查询具体的信息
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public void GetView()
    {

        var id = PageRequest.GetInt("ID", 0);
        var dt = new Sys.BLL.NewsType().GetTableModel(id);
        var data = MyDBUtils.DataTable2ArrayList(dt);
        var user = data.Count > 0 ? (Hashtable)data[0] : null;
        var json = PluSoft.Utils.JSON.Encode(user);
        Response.Write(json);
    }
Ejemplo n.º 2
0
    public void GetView()
    {
        int id     = PageRequest.GetInt("id", 0);
        var dt     = new Sys.BLL.Orders().GetOrderByOrderId(id);
        var data   = MyDBUtils.DataTable2ArrayList(dt);
        var htData = data.Count > 0 ? (Hashtable)data[0] : null;
        var json   = PluSoft.Utils.JSON.Encode(htData);

        Response.Write(json);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 查询具体的信息
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public void GetView()
    {
        var id   = PageRequest.GetInt("FlagId", 0);
        var dt   = new Sys.BLL.EquipmentModel().GetEqpModelInfo("e1.ModelId=" + id);
        var data = MyDBUtils.DataTable2ArrayList(dt);
        var user = data.Count > 0 ? (Hashtable)data[0] : null;
        var json = PluSoft.Utils.JSON.Encode(user);

        Response.Write(json);
        Response.End();
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 查询
    /// </summary>
    public void SearchData()
    {
        //查询条件
        var key      = Utils.SqlStringFormat(PageRequest.GetString("key"), 2);
        var userType = PageRequest.GetString("userType");
        //分页
        var pageIndex = PageRequest.GetInt("pageIndex", 1) + 1;
        var pageSize  = PageRequest.GetInt("pageSize", 1);
        //字段排序
        var sortField = PageRequest.GetString("sortField");
        var sortOrder = PageRequest.GetString("sortOrder");
        var order     = "";

        if (String.IsNullOrEmpty(sortField) == false)
        {
            if (sortOrder != "desc")
            {
                sortOrder = "asc";
            }
            order = " u." + sortField + " " + sortOrder;
        }
        else
        {
            order += " u.createtime desc";
        }
        var strWhere = "1=1";

        if (!string.IsNullOrEmpty(userType))
        {
            strWhere += " and  u.RoleId=" + userType;
        }
        if (!string.IsNullOrEmpty(key))
        {
            strWhere += " and  charIndex('" + key + "',u.UserName) > 0";
        }

        if (pageSize == 1)
        {
            pageSize = 100;
        }
        var dt      = new Sys.BLL.UserInfo().GetListForMoreTable(pageSize, pageIndex, strWhere, order);
        var dataAll = MyDBUtils.DataTable2ArrayList(dt);
        var result  = new Hashtable();

        result["data"] = dataAll;
        var total = new Sys.BLL.Common().GetCount("UserInfo u", strWhere);

        result["total"] = total;
        //JSON
        var json = PluSoft.Utils.JSON.Encode(result);

        Response.Write(json);
    }
Ejemplo n.º 5
0
    ///// <summary>
    ///// 更新角色信息
    ///// </summary>
    //public void SaveData()
    //{
    //    var json = Request["data"];
    //    var rows = (ArrayList)PluSoft.Utils.JSON.Decode(json);
    //    var bllContactInfo = new Sys.BLL.ContactInfo();
    //    Sys.Model.ContactInfo model;
    //    foreach (Hashtable row in rows)
    //    {
    //        var id = row["ContactId"] != null ? row["ContactId"].ToString() : "";
    //        //根据记录状态,进行不同的增加、删除、修改操作
    //        var state = row["_state"] != null ? row["_state"].ToString() : "";
    //        if (state == "added" || id == "")           //新增:id为空,或_state为added
    //        {
    //            model = new Sys.Model.ContactInfo();
    //            model.CompanyCode = Loginadmin.CompanyCode;
    //            model.CompanyId = 0;
    //            model.ContactName = row["ContactName"] == null ? "" : row["ContactName"].ToString();
    //            model.PositionName = row["PositionName"] == null ? "" : row["PositionName"].ToString();
    //            model.Remarks = row["Remarks"] == null ? "" : row["Remarks"].ToString();
    //            model.OfficeTel = row["OfficeTel"] == null ? "" : row["OfficeTel"].ToString();
    //            model.CreateIp = PageRequest.GetIP();
    //            model.CreateTime = DateTime.Now;
    //            model.CustomerId = Utils.StrToInt(row["CustomerId"], 0);//关联的客户编号
    //            model.Email = row["Email"] == null ? "" : row["Email"].ToString();
    //            model.IsMain = Utils.StrToInt(row["IsMain"], 0);
    //            bllContactInfo.Add(model);
    //        }
    //        else if (state == "modified" || state == "") //更新:_state为空或modified
    //        {
    //            model = bllContactInfo.GetModel(Utils.StrToInt(row["ContactId"], 0));
    //            if (model != null)
    //            {
    //                model.ContactName = row["ContactName"].ToString();
    //                model.ContactName = row["ContactName"].ToString();
    //                model.Email = row["Email"].ToString();
    //                model.Mobile = row["Mobile"].ToString();
    //                model.OfficeTel = row["OfficeTel"].ToString();
    //                model.PositionName = row["PositionName"].ToString();
    //                model.Remarks = row["Remarks"].ToString();
    //                bllContactInfo.Update(model);
    //            }

    //        }
    //    }

    //}


    /// <summary>
    /// 查询公司编码相关的角色数据
    /// </summary>
    public void SearchSelRole()
    {
        var strWhere = "";
        var dt       = new AdminRole().GetTable(-1, -1, strWhere, " createtime desc");
        var dataAll  = MyDBUtils.DataTable2ArrayList(dt);
        var result   = new Hashtable();

        result["data"] = dataAll;
        var json = PluSoft.Utils.JSON.Encode(dataAll);

        Response.Write(json);
    }
Ejemplo n.º 6
0
    /// <summary>
    /// 查询
    /// </summary>
    ///
    public void SearchData()
    {
        //查询条件
        var key     = Utils.SqlStringFormat(PageRequest.GetString("key"), 2);
        var begtime = Utils.SqlStringFormat(PageRequest.GetString("begtime"), 2);

        //分页
        var pageIndex = PageRequest.GetInt("pageIndex", 1);
        var pageSize  = PageRequest.GetInt("pageSize", 1);
        //字段排序
        var sortField = PageRequest.GetString("sortField");
        var sortOrder = PageRequest.GetString("sortOrder");
        var order     = "";

        if (String.IsNullOrEmpty(sortField) == false)
        {
            if (sortOrder != "desc")
            {
                sortOrder = "asc";
            }
            order = " " + sortField + " " + sortOrder;
        }
        else
        {
            order += " createtime desc";
        }
        var strWhere = "1=1";

        if (key != "")
        {
            strWhere += " and charIndex('" + key + "',NewsTitle) > 0";
        }


        if (begtime.Length > 0)
        {
            strWhere += " and DATEDIFF(day,'" + DateTime.Parse(begtime) + "',createtime)=0";
        }
        var dt      = BllNews.GetTable(pageSize, pageIndex, strWhere, order);
        var dataAll = MyDBUtils.DataTable2ArrayList(dt);
        var result  = new Hashtable();

        result["data"] = dataAll;

        var total = new Common().GetCount("News", strWhere);

        result["total"] = total;
        var json = PluSoft.Utils.JSON.Encode(dataAll);

        Response.Write(json);
    }
Ejemplo n.º 7
0
    /// <summary>
    /// 查询
    /// </summary>
    public void SearchData()
    {
        //查询条件
        var key = Utils.SqlStringFormat(PageRequest.GetString("key"), 2);
        //分页
        var pageIndex = PageRequest.GetInt("pageIndex", 1);
        var pageSize  = PageRequest.GetInt("pageSize", 1);
        //字段排序
        var sortField = PageRequest.GetString("sortField");
        var sortOrder = PageRequest.GetString("sortOrder");
        var order     = "";

        if (String.IsNullOrEmpty(sortField) == false)
        {
            if (sortOrder != "desc")
            {
                sortOrder = "asc";
            }
            order = " " + sortField + " " + sortOrder;
        }
        else
        {
            order += " createtime desc";
        }
        var strWhere = "";

        if (key != "")
        {
            strWhere += "charIndex('" + key + "',FlagName) > 0";
        }


        if (pageSize == 1)
        {
            pageSize = 1000;
        }
        var dt      = new Sys.BLL.AdminFlag().GetTable(-1, -1, strWhere, order);
        var dataAll = MyDBUtils.DataTable2ArrayList(dt);
        var result  = new Hashtable();

        result["data"] = dataAll;
        //var total = new Sys.BLL.Common().GetCount("Sys_Flag", strWhere);
        //result["total"] = total;
        //JSON
        var json = PluSoft.Utils.JSON.Encode(dataAll);

        Response.Write(json);

        //var tempstring = "[{\"FlagId\": \"1\",\"FlagName\": \"项目范围规划\",\"Duration\": 8,\"Start\": \"2007-01-01T00:00:00\",\"Finish\": \"2007-01-10T00:00:00\",\"PercentComplete\": 0,\"Summary\": 1,\"Critical\": 0,\"Milestone\": 0,\"PredecessorLink\": [],\"ParentId\": -1},{\"FlagId\": \"2\",\"FlagName\": \"确定项目范围\",\"Duration\": 1,\"Start\": \"2007-01-01T00:00:00\",\"Finish\": \"2007-01-01T23:23:59\",\"PercentComplete\": 30,\"Summary\": 0,\"Critical\": 0,\"Milestone\": 0,\"PredecessorLink\": [],\"ParentId\": \"1\"}]";
        //Response.Write(tempstring);
    }
Ejemplo n.º 8
0
    /// <summary>
    /// 订单分配查询,
    /// </summary>
    ///
    public void SearchDataDistrbution()
    {
        Loginadmin = BllAdmin.GetModel(Account.GetLoginUserID());
        if (Loginadmin == null)
        {
            return;
        }

        //查询条件
        var key = Utils.SqlStringFormat(PageRequest.GetString("key"), 2);
        //分页
        var pageIndex = PageRequest.GetInt("pageIndex", 1);
        var pageSize  = PageRequest.GetInt("pageSize", 1);
        //字段排序
        var sortField = PageRequest.GetString("sortField");
        var sortOrder = PageRequest.GetString("sortOrder");
        var order     = "";

        if (String.IsNullOrEmpty(sortField) == false)
        {
            if (sortOrder != "desc")
            {
                sortOrder = "asc";
            }
            order = " " + sortField + " " + sortOrder;
        }
        else
        {
            order += " createtime desc";
        }
        var strWhere = "1=1";

        if (key != "")
        {
            strWhere += " and charIndex('" + key + "',UserName) > 0";
        }

        // strWhere += "  and charIndex('" + Loginadmin.UserId + "',parentUserIDs) > 0  or UserId=" + Loginadmin.UserId + "";
        strWhere += " and RoleIDs='89'";

        var dt      = new Admin().GetTable(-1, -1, strWhere, order);
        var dataAll = MyDBUtils.DataTable2ArrayList(dt);
        var result  = new Hashtable();

        result["data"] = dataAll;
        var json = PluSoft.Utils.JSON.Encode(dataAll);

        Response.Write(json);
    }
Ejemplo n.º 9
0
    /// <summary>
    /// 查询
    /// </summary>
    public void SearchDatat()
    {
        //查询条件
        var key = Utils.SqlStringFormat(PageRequest.GetString("key"), 2);
        //分页
        var pageIndex = PageRequest.GetInt("pageIndex", 1);
        var pageSize  = PageRequest.GetInt("pageSize", 1);
        //字段排序
        var sortField = PageRequest.GetString("sortField");
        var sortOrder = PageRequest.GetString("sortOrder");
        var order     = "";

        if (String.IsNullOrEmpty(sortField) == false)
        {
            if (sortOrder != "desc")
            {
                sortOrder = "asc";
            }
            order = " " + sortField + " " + sortOrder;
        }
        else
        {
            order += " OrderID";
        }



        const string strWhere = "IsNav=1";
        var          dt       = new AdminFlag().GetTable(-1, -1, strWhere, order);

        var tempDt = dt.Clone();

        foreach (DataRow model in dt.Rows)
        {
            if (ManageHelper.CheckAdminHavePower(model["Flag"].ToString()))
            {
                tempDt.Rows.Add(model.ItemArray);
            }
        }


        var dataAll = MyDBUtils.DataTable2ArrayList(tempDt);
        var result  = new Hashtable();

        result["data"] = dataAll;
        var json = PluSoft.Utils.JSON.Encode(dataAll);

        Response.Write(json);
    }
Ejemplo n.º 10
0
    public void SearchData()
    {
        //查询条件
        int BlockType = PageRequest.GetInt("BlockType", 0);//限制方式 0白名单 1黑名单

        //分页

        var pageIndex = PageRequest.GetInt("pageIndex", 1) + 1;
        var pageSize  = PageRequest.GetInt("pageSize", 1);
        //字段排序
        var sortField = PageRequest.GetString("sortField");
        var sortOrder = PageRequest.GetString("sortOrder");
        var order     = "";

        if (String.IsNullOrEmpty(sortField) == false)
        {
            if (sortOrder != "desc")
            {
                sortOrder = "asc";
            }
            order = " " + sortField + " " + sortOrder;
        }
        else
        {
            order += " createtime desc";
        }
        //业务层:数据库操作

        var strWhere = "1=1";

        strWhere += " and BlockType=" + BlockType;


        var dt      = BllIpBlock.GetTable(pageSize, pageIndex, strWhere, order);
        var dataAll = MyDBUtils.DataTable2ArrayList(dt);
        var result  = new Hashtable();

        result["data"] = dataAll;
        var total = new Common().GetCount("SysIpBlock", strWhere);

        result["total"] = total;

        //JSON
        var json = PluSoft.Utils.JSON.Encode(result);

        Response.Write(json);
    }
Ejemplo n.º 11
0
    /// <summary>
    /// 查询
    /// </summary>
    public void SearchData()
    {
        //查询条件
        var key = Utils.SqlStringFormat(PageRequest.GetString("key"), 2);
        //分页
        var pageIndex = PageRequest.GetInt("pageIndex", 1);
        var pageSize = PageRequest.GetInt("pageSize", 1);
        //字段排序
        var sortField = PageRequest.GetString("sortField");
        var sortOrder = PageRequest.GetString("sortOrder");
        var order = "";
        if (String.IsNullOrEmpty(sortField) == false)
        {
            if (sortOrder != "desc") sortOrder = "asc";
            order = " " + sortField + " " + sortOrder;
        }
        else
        {
            order += " createtime desc";
        }
        var strWhere = "";
        if (key != "")
        {
            strWhere += "charIndex('" + key + "',FlagName) > 0";
        }


        if (pageSize == 1)
        {
            pageSize = 1000;
        }
        var dt = new Sys.BLL.NewsType().GetTable(-1, -1, strWhere, order);
        var dataAll = MyDBUtils.DataTable2ArrayList(dt);
        var result = new Hashtable();
        result["data"] = dataAll;
        //var total = new Sys.BLL.Common().GetCount("Sys_Flag", strWhere);
        //result["total"] = total;
        //JSON
        var json = PluSoft.Utils.JSON.Encode(dataAll);

        Response.Write(json);

    }
Ejemplo n.º 12
0
    /// <summary>
    /// 查询
    /// </summary>
    public void SearchData()
    {
        //查询条件
        var orderStatus = PageRequest.GetString("orderStatus");
        var projectName = PageRequest.GetString("projectName");
        var cmbDate     = PageRequest.GetString("cmbDate");
        //分页
        var pageIndex = PageRequest.GetInt("pageIndex", 1) + 1;
        var pageSize  = PageRequest.GetInt("pageSize", 1);
        //字段排序
        var sortField = PageRequest.GetString("sortField");
        var sortOrder = PageRequest.GetString("sortOrder");
        var order     = "";

        if (String.IsNullOrEmpty(sortField) == false)
        {
            if (sortOrder != "desc")
            {
                sortOrder = "asc";
            }
            order = " u." + sortField + " " + sortOrder;
        }
        else
        {
            order += " CreateDate desc";
        }
        var strWhere = "1=1";

        if (!string.IsNullOrEmpty(orderStatus))
        {
            if (orderStatus.Equals("0"))
            {
                strWhere += " and  OrderStatus is null";
            }
            else
            {
                strWhere += " and  OrderStatus=" + orderStatus;
            }
        }
        if (!string.IsNullOrEmpty(projectName))
        {
            strWhere += string.Format(" and ProjectName like '%{0}%' ", DataSecurity.FilterBadChar(projectName));
        }
        if (!string.IsNullOrEmpty(cmbDate))
        {
            //1day,3day,1week,1month,halfyear,oneyear
            if (cmbDate.Equals("1day"))
            {
                strWhere += " and CreateDate>=DATEADD(DAY,-1,GETDATE())";
            }
            else if (cmbDate.Equals("3day"))
            {
                strWhere += " and CreateDate>=DATEADD(DAY,-3,GETDATE())";
            }
            else if (cmbDate.Equals("1week"))
            {
                strWhere += " and CreateDate>=DATEADD(DAY,-7,GETDATE())";
            }
            else if (cmbDate.Equals("1month"))
            {
                strWhere += " and CreateDate>=DATEADD(DAY,-30,GETDATE())";
            }
            else if (cmbDate.Equals("halfyear"))
            {
                strWhere += " and CreateDate>=DATEADD(DAY,-180,GETDATE())";
            }
            else if (cmbDate.Equals("oneyear"))
            {
                strWhere += " and CreateDate>=DATEADD(DAY,-365,GETDATE())";
            }
        }
        if (pageSize == 1)
        {
            pageSize = 100;
        }
        var dt      = new Sys.BLL.Orders().GetListForMoreTable(pageSize, pageIndex, strWhere, order);
        var dataAll = MyDBUtils.DataTable2ArrayList(dt);
        var result  = new Hashtable();

        result["data"] = dataAll;
        var total = new Sys.BLL.Common().GetCount("Orders o", strWhere);

        result["total"] = total;
        //JSON
        var json = PluSoft.Utils.JSON.Encode(result);

        Response.Write(json);
    }