public ActionResult RequireBidding(String id) { VMRequire Require = new VMRequire(); var list = require.RequireAuditing(id); Require.InsShelftype = list.InsShelftype; Require.InsTonnage = list.InsTonnage; Require.InsTonUnit = list.InsTonUnit; Require.Insplace = list.Insplace; Require.InsStartDate = list.InsStartDate; Require.InsCycle = list.InsCycle; Require.InsCycleUnit = list.InsCycleUnit; Require.InsHeight = list.InsHeight; Require.InsHghUnit = list.InsHghUnit; Require.InsBeamHgh = list.InsBeamHgh; Require.InsStyHghUnit = list.InsStyHghUnit; Require.InsAtticLayer = list.InsAtticLayer; Require.InsForkExtension = list.InsForkExtension; Require.InsStretchCom = list.InsStretchCom; Require.InsMoney = list.InsMoney; Require.InsMoneyCom = list.InsMoneyCom; Require.InsName = list.InsName; Require.InsPhone = list.InsPhone; Require.InsRemark = list.InsRemark; Require.offerlist = JsonConvert.SerializeObject(RequireMapper.Offerlist(require.RequireBidding(id))); Require.count = require.RequiresBidding(id); Require.NowPage = 0; Require.AllPage = Pag.SumPage(Require.count, 10); Require.NewPage = (Require.AllPage == 0) ? 0 : Require.NowPage + 1; return(View(Require)); }
public IHttpActionResult PutPag(int id, Pag pag) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pag.id) { return(BadRequest()); } db.Entry(pag).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PagExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int codp, int annop) { Pag pag = db.Pag.Find(codp, annop); db.Pag.Remove(pag); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Pags/Details/5 public ActionResult Details(int codp, int annop) { Pag pag = db.Pag.Find(codp, annop); if (pag == null) { return(HttpNotFound()); } return(View(pag)); }
public IHttpActionResult GetPag(int id) { Pag pag = db.Pags.Find(id); if (pag == null) { return(NotFound()); } return(Ok(pag)); }
public ActionResult SearchPost(VMRequire search) { VMRequire Require = new VMRequire(); Require.OfferList = RequireMapper.Offerlist(require.RequireBidding(search.InstallID, search.NowPage)); Require.count = require.RequiresBidding(search.InstallID); Require.NowPage = search.NowPage; Require.AllPage = Pag.SumPage(Require.count, 10); Require.NewPage = (Require.AllPage == 0) ? 0 : Require.NowPage + 1; return(Json(Require, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 查询日志列表 /// </summary> /// <param name="filters"></param> /// <param name="start"></param> /// <param name="limit"></param> /// <returns></returns> public Pag <kh_examinesModel> GetMechExamList(List <Filter> filters, int start, int limit, int year, int month) { using (Entities db = new Entities()) { string sql = @"SELECT exams.*, compan.companyname, contra.contractname, IFNULL(SUM(score.deduct),0) sumscore, users.displayname FROM kh_examines exams LEFT JOIN yh_companys compan ON exams.companyid = compan.companyid LEFT JOIN yh_contracts contra ON exams.contractid = contra.contractid LEFT JOIN kh_scores score ON exams.examineid = score.examineid LEFT JOIN base_users users ON exams.createuserid = users.id where YEAR(exams.examinedate)=" + year + " and MONTH(exams.examinedate)=" + month + " GROUP BY exams.examineid"; IEnumerable <kh_examinesModel> queryable = db.Database.SqlQuery <kh_examinesModel>(sql); if (filters != null && filters.Count > 0) { foreach (Filter filter in filters) { string value = filter.value; switch (filter.property) { case "companyname": if (!string.IsNullOrEmpty(value)) { queryable = queryable.Where(t => t.companyname == value); } break; case "starttime": if (!string.IsNullOrEmpty(value)) { DateTime starttime = DateTime.Parse(value); DateTime Etime = starttime.AddDays(1); queryable = queryable.Where(t => t.examinedate >= starttime && t.examinedate < Etime); } break; case "endtime": if (!string.IsNullOrEmpty(value)) { DateTime endtime = DateTime.Parse(value); DateTime Etime = endtime.AddDays(1); queryable = queryable.Where(t => t.examinedate >= endtime && t.examinedate < Etime); } break; case "contractname": if (!string.IsNullOrEmpty(value)) { queryable = queryable.Where(t => t.contractname.Contains(value)); } break; } } } IOrderedEnumerable <kh_examinesModel> temp = queryable.OrderByDescending(a => a.createtime); Pag <kh_examinesModel> rst = PagHelper.CreatPagList(temp, start, limit); return(rst); } }
public IHttpActionResult PostPag(Pag pag) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Pags.Add(pag); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = pag.id }, pag)); }
public Pag <MonitorListModel> GetMonitorTableList(List <Filter> filters, int start, int limit, int unitid, string path) { using (Entities db = new Entities()) { string sql = @"SELECT spe.unitid, unit.unitname, cam.cameraid, cam.cameraname, camt.cameratypename, cam.cameratypeid, spe.seq, unit.path, unit.parentid FROM fi_specialcameras spe left JOIN fi_specialunits unit on spe.unitid=unit.unitid LEFT JOIN fi_cameras cam ON spe.cameraid = cam.cameraid LEFT JOIN fi_cameratypes camt ON cam.cameratypeid = camt.cameratypeid"; string[] pathlist = path.Split('/'); if (pathlist.Length == 3) { if (pathlist[1] == "0") { sql += " where 1=1"; } else { sql += " where unit.parentid=" + pathlist[1]; } } else if (unitid != 0) { sql += " where spe.unitid=" + unitid; } else { sql += " where 1=1"; } IEnumerable <MonitorListModel> queryable = db.Database.SqlQuery <MonitorListModel>(sql); if (filters != null && filters.Count > 0) { foreach (Filter filter in filters) { string value = filter.value; } } IOrderedEnumerable <MonitorListModel> temp = queryable.OrderByDescending(a => a.seq); Pag <MonitorListModel> rst = PagHelper.CreatPagList(temp, start, limit); return(rst); } }
public ActionResult Biding(String OfferID, String InstallID) { VMRequire Result = new VMRequire(); require.RequireBiddingOffer(OfferID, OfferState.Yes); Result.msg = "选择中标单位成功!"; Result.OfferList = RequireMapper.Offerlist(require.RequireBidding(InstallID, 0)); Result.count = require.RequiresBidding(InstallID); Result.NowPage = 0; Result.AllPage = Pag.SumPage(Result.count, 10); Result.NewPage = (Result.AllPage == 0) ? 0 : Result.NowPage + 1; return(Json(Result, JsonRequestBehavior.AllowGet)); }
// GET: Pags/Delete/5 public ActionResult Delete(int?codp, int?annop) { if (codp == null || annop == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pag pag = db.Pag.Find(codp, annop); if (pag == null) { return(HttpNotFound()); } return(View(pag)); }
public IHttpActionResult DeletePag(int id) { Pag pag = db.Pags.Find(id); if (pag == null) { return(NotFound()); } db.Pags.Remove(pag); db.SaveChanges(); return(Ok(pag)); }
public Pag <kh_scoresModel> getScoreList(int examineid, int start, int limit) { using (Entities db = new Entities()) { IEnumerable <kh_scoresModel> queryable = from a in db.kh_scores join b in db.base_users on a.deductuserid equals b.id where a.examineid == examineid select new kh_scoresModel { scoreid = a.scoreid, deail = a.deail, deduct = a.deduct, deductuserid = a.deductuserid, examinetime = a.examinetime, examineid = a.examineid, deductusername = b.displayname, }; IOrderedEnumerable <kh_scoresModel> temp = queryable.OrderByDescending(a => a.examineid); Pag <kh_scoresModel> rst = PagHelper.CreatPagList(temp, start, limit); return(rst); } }
public ActionResult Create([Bind(Include = "CodP,AnnoP,Tiscr,Cat,Pagato,Dovuto,DatPag,DatReg,DatCassa,Tpag,Fuori,Lode,Carica,Sez,Sett,Pos,Ent,CodSocCol")] Pag pag) { if (ModelState.IsValid) { db.Pag.Add(pag); db.SaveChanges(); UpdateDovuto(pag.AnnoP, pag.CodP); return(RedirectToAction("Edit", new { codp = pag.CodP, annop = pag.AnnoP })); } ViewBag.CodP = new SelectList(db.Mem, "Cod", "Cod", pag.Mem.Cod); ViewBag.AnnoP = new SelectList(db.TabCat, "AnnoCat", "AnnoCat", pag.AnnoP); ViewBag.Cat = new SelectList(db.TabCat, "CodCat", "DescrCat", pag.Cat); ViewBag.Carica = new SelectList(db.TabCarica, "CodCarica", "DescrCarica", pag.Carica); ViewBag.Ent = new SelectList(db.TabEnt, "CodEnt", "DescrEnt", pag.Ent); ViewBag.Pos = new SelectList(db.TabPos, "CodPos", "DescrPos", pag.Pos); ViewBag.Sett = new SelectList(db.TabSet, "CodSet", "DescrSet", pag.Sett); ViewBag.Sez = new SelectList(db.TabSez, "CodSez", "DescrSez", pag.Sez); ViewBag.Tiscr = new SelectList(db.TabTIscr, "CodTIscr", "DescrTIscr", pag.Tiscr); ViewBag.Tpag = new SelectList(db.TabTPag, "CodTPag", "DescrTPag", pag.Tpag); return(View(pag)); }
public Pag <basicinfoModel> GetBaseInfoList(List <Filter> filters, int start, int limit) { Pag <basicinfoModel> list = new Pag <basicinfoModel>(); using (Entities db = new Entities()) { string sql = string.Format(@"select * from fi_uvas t where t.isdelete=0"); IEnumerable <basicinfoModel> queryable = db.Database.SqlQuery <basicinfoModel>(sql); if (filters != null && filters.Count > 0) { foreach (Filter filter in filters) { string value = filter.value; switch (filter.property) { case "ovanum": if (!string.IsNullOrEmpty(value)) { queryable = queryable.Where(t => t.ovanum.Contains(value)); } break; case "ovaname": if (!string.IsNullOrEmpty(value)) { queryable = queryable.Where(t => t.ovaname.Contains(value)); } break; } ; } } IOrderedEnumerable <basicinfoModel> temp = queryable.OrderByDescending(a => a.ovaid); list = PagHelper.CreatPagList(temp, start, limit); } return(list); }
public ActionResult Edit([Bind(Include = "CodP,AnnoP,Tiscr,Cat,Pagato,Dovuto,DatPag,DatReg,DatCassa,Tpag,Fuori,Lode,Carica,Sez,Sett,Pos,Ent,CodSocCol")] Pag pag) { if (ModelState.IsValid) { db.Entry(pag).State = EntityState.Modified; db.SaveChanges(); UpdateDovuto(pag.AnnoP, pag.CodP); ViewBag.Cat = new SelectList(db.TabCat.Where(m => m.AnnoCat == pag.AnnoP), "CodCat", "DescrCat", pag.Cat); ViewBag.Carica = new SelectList(db.TabCarica, "CodCarica", "DescrCarica", pag.Carica); ViewBag.Ent = new SelectList(db.TabEnt, "CodEnt", "DescrEnt", pag.Ent); ViewBag.Pos = new SelectList(db.TabPos, "CodPos", "DescrPos", pag.Pos); ViewBag.Sett = new SelectList(db.TabSet, "CodSet", "DescrSet", pag.Sett); ViewBag.Sez = new SelectList(db.TabSez, "CodSez", "DescrSez", pag.Sez); ViewBag.Tiscr = new SelectList(db.TabTIscr, "CodTIscr", "DescrTIscr", pag.Tiscr); ViewBag.Tpag = new SelectList(db.TabTPag, "CodTPag", "DescrTPag", pag.Tpag); TempData["msg-ok"] = "Aggiornamento effettuato"; } else { TempData["msg"] = "Aggiornamento non riuscito"; } return(RedirectToAction("Edit", new { codp = pag.CodP, annop = pag.AnnoP })); }
// GET: Pags/Edit/5 public ActionResult Edit(int?codp, int?annop) { if (codp == null || annop == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pag pag = db.Pag.Find(codp, annop); if (pag == null) { return(HttpNotFound()); } // anni dei pagamenti var anniPag = db.Pag.Where(d => d.CodP == codp && d.AnnoP != annop).Select(d => d.AnnoP.ToString()).ToList(); if (anniPag.Any()) { ViewBag.anniPag = anniPag; } // per le divisioni var divAlreadyPresent = db.Divisioni.Where(d => d.AnnoP == annop && d.CodP == codp).Select(d => d.CodDiv.ToString()).ToList(); var listDiv = db.TabDiv.Where(m => !divAlreadyPresent.Contains(m.CodDiv) && m.AnnoDiv == annop); if (listDiv.Any()) { ViewBag.CodDiv = listDiv.Select(q => new SelectListItem { Value = q.CodDiv, Text = q.DescrDiv }).ToList(); } // per i gruppi var gruAlreadyPresent = db.Gruppi.Where(d => d.AnnoP == annop && d.CodP == codp).Select(d => d.CodGru).ToList(); var listGru = db.TabGru.Where(m => !gruAlreadyPresent.Contains(m.CodGru) && m.AnnoGru == annop); if (listGru.Any()) { ViewBag.CodGru = listGru.Select(q => new SelectListItem { Value = q.CodGru, Text = q.DescrGruppo }).ToList(); } // per le Riviste var rivAlreadyPresent = db.Riviste.Where(d => d.AnnoP == annop && d.CodP == codp).Select(d => d.CodRiv).ToList(); var listRiv = db.TabRiv.Where(m => !rivAlreadyPresent.Contains(m.CodRiv) && m.AnnoRiv == annop); if (listRiv.Any()) { ViewBag.CodRiv = listRiv.Select(q => new SelectListItem { Value = q.CodRiv, Text = q.DescrRiv }).ToList(); } // per le Convenzioni var convAlreadyPresent = db.Convenzioni.Where(d => d.AnnoP == annop && d.CodP == codp).Select(d => d.CodConv).ToList(); var listConv = db.TabConv.Where(m => !convAlreadyPresent.Contains(m.CodConv) && m.AnnoConv == annop); if (listConv.Any()) { ViewBag.CodConv = listConv.Select(q => new SelectListItem { Value = q.CodConv, Text = q.DescrConv }).ToList(); } ViewBag.Cat = new SelectList(db.TabCat.Where(m => m.AnnoCat == annop), "CodCat", "DescrCat", pag.Cat); ViewBag.Carica = new SelectList(db.TabCarica, "CodCarica", "DescrCarica", pag.Carica); ViewBag.Ent = new SelectList(db.TabEnt, "CodEnt", "DescrEnt", pag.Ent); ViewBag.Pos = new SelectList(db.TabPos, "CodPos", "DescrPos", pag.Pos); ViewBag.Sett = new SelectList(db.TabSet, "CodSet", "DescrSet", pag.Sett); ViewBag.Sez = new SelectList(db.TabSez, "CodSez", "DescrSez", pag.Sez); ViewBag.Tiscr = new SelectList(db.TabTIscr, "CodTIscr", "DescrTIscr", pag.Tiscr); ViewBag.Tpag = new SelectList(db.TabTPag, "CodTPag", "DescrTPag", pag.Tpag); return(View(pag)); }
/// <summary> /// 获取行政许可待审批列表 /// </summary> /// <param name="filter"></param> /// <param name="start"></param> /// <param name="limit"></param> /// <returns></returns> public Pag <LicenseModel> GetPendingCaseSourcesList(List <Filter> filters, int start, int limit, int userid) { Pag <LicenseModel> list = new Pag <LicenseModel>(); using (Entities db = new Entities()) { #region linq //IQueryable<LicenseModel> queryable = from a in db.xz_licensings // join b_join in db.xzj_files.Where(t => t.source == 2) on a.licensingid equals b_join.sourceid into btmp // from b in btmp.DefaultIfEmpty() // where a.issh == 0 // orderby a.licensingid descending // select new LicenseModel // { // licensingid = a.licensingid, // sph = a.sph, // xksx = a.xksx, // splx = a.splx, // b_address = a.b_address, // sxmx = a.sxmx, // sqr = a.sqr, // cardtype = a.cardtype, // card = a.card, // contactphone = a.contactphone, // s_address = a.s_address, // processtime_start = a.processtime_start, // processtime_end = a.processtime_end, // processcontent = a.processcontent, // processaddress = a.processaddress, // geography = a.geography, // createuserid = a.createuserid, // createtime = a.createtime, // shresult = a.shresult, // shopinion = a.shopinion, // shuser = a.shuser, // issh = a.issh, // shtime = a.shtime, // firstImgUrl = b.filename, // }; #endregion string sql = string.Format(@"SELECT d.name, lic.*, zds.zd_name AS splxname, file.filepath AS firstImgUrl FROM xz_licensings lic LEFT JOIN (SELECT * FROM xzj_files fi WHERE fi.source = 2 GROUP BY fi.sourceid ) file ON lic.licensingid = file.sourceid LEFT JOIN base_zds zds ON lic.splx = zds.zd_id AND zds.zd_type = 'type_splx' RIGHT JOIN (SELECT b.id, b.usertypeid, c.unitid, e.`name` FROM base_users b RIGHT JOIN (SELECT a.id, a.unitid FROM base_users a WHERE a.id = {0} ) c ON b.unitid = c.unitid AND c.unitid BETWEEN 10 AND 17 LEFT JOIN base_units e ON c.unitid = e.id ) d ON lic.createuserid = d.id WHERE lic.issh = 0", userid); //判断是否是队员 string strsql = string.Format(@"select (case when Find_IN_SET (3,a.roleid)>0 then 1 else null end)mark from (select users.id,users.displayname,GROUP_CONCAT(usroles.roleid) roleid FROM base_users users LEFT JOIN base_userroles usroles ON users.id = usroles.userid WHERE users.id={0}) a; ", userid); IEnumerable <LicenseModel> sqlQueryable = db.Database.SqlQuery <LicenseModel>(sql); List <string> sqltest = db.Database.SqlQuery <string>(strsql).ToList(); if (sqltest.FirstOrDefault() == null) { return(list); } else { foreach (LicenseModel model in sqlQueryable) { if (model != null && model.firstImgUrl != null) { List <string> filelist = new List <string>(); filelist.Add(model.firstImgUrl); model.imgUrl = filelist; } } if (filters != null && filters.Count > 0) { foreach (Filter filter in filters) { string value = filter.value; switch (filter.property) { case "splx": if (!string.IsNullOrEmpty(value)) { sqlQueryable = sqlQueryable.Where(t => t.splx.Contains(value)); } break; case "sqr": if (!string.IsNullOrEmpty(value)) { sqlQueryable = sqlQueryable.Where(t => t.sqr.Contains(value)); } break; case "xksx": if (!string.IsNullOrEmpty(value)) { sqlQueryable = sqlQueryable.Where(t => t.xksx.Contains(value)); } break; case "sph": if (!string.IsNullOrEmpty(value)) { sqlQueryable = sqlQueryable.Where(t => t.sph.ToString().Contains(value)); } break; case "createtime": if (!string.IsNullOrEmpty(value)) { DateTime createtime = Convert.ToDateTime(value); sqlQueryable = sqlQueryable.Where(t => t.createtime == createtime); } break; } } } IOrderedEnumerable <LicenseModel> temp = sqlQueryable.OrderByDescending(a => a.createtime); list = PagHelper.CreatPagList(temp, start, limit); } } return(list); }
public IActionResult Index(string sortOrder, string currentFilter, string searchString, int?page) { ViewData["NombreSortParm"] = String.IsNullOrEmpty(sortOrder) ? "nombre_desc" : ""; ViewData["DescripcionSortParm"] = sortOrder == "descripcion_asc" ? "descripcion_desc" : "descripcion_asc"; if (searchString != null) { page = 1; } else { searchString = currentFilter; } ViewData["CurrentFilter"] = searchString; ViewData["CurrentSort"] = sortOrder; //db = new SQLTransaction(); //data = db.GetData(); //List<QueryOne> listData = new List<QueryOne>(); //foreach (DataRow item in data.Tables[0].Rows) //{ // listData.Add(new QueryOne // { // Pedido =item["Pedido"].ToString(), // Fecha=item["Fecha"].ToString(), // Cliente_Nit= item["Cliente_Nit"].ToString(), // Cliente_Suc= item["Cliente_Suc"].ToString(), // Cliente= item["Cliente"].ToString(), // Co_Id= item["Co_Id"].ToString(), // Centro_Operacion= item["Centro_Operacion"].ToString(), // Bodega_Id = item["Bodega_Id"].ToString(), // Bodega= item["Bodega"].ToString(), // Item_Id = Convert.ToInt32(item["Item_Id"]), // Item = item["Item"].ToString(), // Unidad_Pedida=item["Unidad_Pedida"].ToString(), // Cantidad_Ped = Convert.ToInt32(item["Cantidad_Ped"]), // Estado=item["Estado"].ToString(), // Error = item["Error"].ToString() // }); //} var querys = from s in listData select s; ViewData["Data"] = querys; if (!String.IsNullOrEmpty(searchString)) { querys = querys.Where(s => s.Cliente.Contains(searchString) || s.Cliente_Nit.Contains(searchString) || s.Pedido.Contains(searchString) || s.Fecha.Contains(searchString)); } switch (sortOrder) { case "nombre_desc": querys = querys.OrderByDescending(s => s.Pedido); break; default: querys = querys.OrderBy(s => s.Pedido); break; } var queryfinal = querys.AsQueryable(); int pageSize = 20; return(View(Pag <QueryOne> .CreateAsync(queryfinal, page ?? 1, pageSize))); }