public int UPDATE(LanData info) { try { U_landata temp = new U_landata(); Table <U_landata> table = db.GetTable <U_landata>(); temp = (from row in db.U_landata where row.id == info.ID select row).First(); //temp.id = info.ID; temp.areaid = info.AreaData; temp.lng = info.Lng; temp.lat = info.Lat; temp.building = info.Building; temp.address = info.Address; temp.ptid = info.Ptid; temp.mtid = info.Mtid;; temp.isused = info.Isused; temp.cate = info.Cate; temp.type = info.Type; temp.manager = info.Manager; temp.HOST_CODE = info.HOST_CODE; temp.PASSWD = info.PASSWD; temp.ACTIVE = info.ACTIVE; db.SubmitChanges(); return(temp.id); } catch { return(-2); } }
public int INSERT(LanData info) { try { U_landata temp = new U_landata(); //temp.id = info.ID; temp.areaid = info.AreaData; temp.lng = info.Lng; temp.lat = info.Lat; temp.building = info.Building; temp.address = info.Address; temp.ptid = info.Ptid; temp.mtid = info.Mtid; temp.isused = info.Isused; temp.cate = info.Cate; temp.type = info.Type; temp.manager = info.Manager; temp.HOST_CODE = info.HOST_CODE; temp.PASSWD = info.PASSWD; temp.ACTIVE = info.ACTIVE; Table <U_landata> table = db.GetTable <U_landata>(); table.InsertOnSubmit(temp); db.SubmitChanges(); return(temp.id); } catch { return(-2); } }
public LanData SELECT_BY_NAME(string name) { try { LanData rd = new LanData(); U_landata temp = (from row in db.U_landata where row.building == name && row.isused == true select row).First(); rd.ID = temp.id; rd.AreaData = temp.areaid; rd.Lng = temp.lng; rd.Lat = temp.lat; rd.Building = temp.building; rd.Address = temp.address; rd.Ptid = temp.ptid; rd.Mtid = temp.mtid; rd.Isused = temp.isused; rd.Cate = temp.cate; rd.Type = temp.type; rd.Manager = temp.manager; rd.HOST_CODE = temp.HOST_CODE; rd.PASSWD = temp.PASSWD; rd.ACTIVE = temp.ACTIVE; return(rd); } catch { return(null); } }
partial void DeleteU_landata(U_landata instance);
partial void UpdateU_landata(U_landata instance);
partial void InsertU_landata(U_landata instance);