Exemplo n.º 1
0
        public ActionResult GridGPump_Insert(JArray GridGPump_fields, int gridIndex, int gridPageSize, int groupId, string idList)
        {
            string[]       id   = idList.Split(',');
            Panda_PumpFG_P pump = new Panda_PumpFG_P();

            pump.GroupID = groupId;
            for (int i = 0; i < id.Length; i++)
            {
                pump.PumpID = id[i];
                db.Panda_PumpFG_P.Add(pump);
                db.SaveChanges();
            }

            var    grid1 = UIHelper.Grid("GridGPump");
            string sql   = string.Empty;

            sql = sql + " and a.GroupID = " + groupId;
            Hashtable has = Panda_PumpFGDal.SearchGroupPump(gridIndex, gridPageSize, "b.FCreateDate", "asc", sql);

            grid1.DataSource(has["data"], GridGPump_fields);
            grid1.RecordCount(Int32.Parse(has["total"].ToString()));
            return(UIHelper.Result());
        }
Exemplo n.º 2
0
        private void BindGridGPump(int pageIndex, int pageSize, string selectTest, int groupId, out DataTable table, out int count)
        {
            string sql = string.Empty;

            sql = sql + " and a.GroupID=" + groupId;
            if (!selectTest.Equals(""))
            {
                sql = sql + " and (b.PName like '%" + selectTest + "%' or b.PCustomPName like '%" + selectTest + "%')";
            }

            if (GetUserType().Equals("2"))
            {
                sql = sql + " and b.PCompanyNumber='" + GetUserCompanyNumber() + "'";
            }
            else if (GetUserType().Equals("3"))
            {
                sql = sql + " and b.FCustomerID=" + GetUserCustomer();
            }

            Hashtable has = Panda_PumpFGDal.SearchGroupPump(pageIndex, pageSize, "b.FCreateDate", "asc", sql);

            count = Int32.Parse(has["total"].ToString());
            table = (DataTable)has["data"];
        }