public async Task <ActionResult> DeleteConfirmed(int id) { OutM outM = await db.OutM.FindAsync(id); db.OutM.Remove(outM); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "id,日期,貨品,紙箱,板費,快遞,輔料,其他")] OutM outM) { if (ModelState.IsValid) { db.Entry(outM).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(outM)); }
public async Task <ActionResult> Create([Bind(Include = "id,日期,貨品,紙箱,板費,快遞,輔料,其他")] OutM outM) { if (ModelState.IsValid) { db.OutM.Add(outM); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(outM)); }
// GET: OutMs/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OutM outM = await db.OutM.FindAsync(id); if (outM == null) { return(HttpNotFound()); } return(View(outM)); }
protected void btnSave_Click(object sender, EventArgs e) { IList <EyouSoft.Model.SystemStructure.SysCityAreaControl> modelList = new List <EyouSoft.Model.SystemStructure.SysCityAreaControl>(); string[] LongVal = Utils.GetFormValues("cbkName_国内长线"); string[] ShortVal = Utils.GetFormValues("cbkName_国内短线"); string[] OutVal = Utils.GetFormValues("cbkName_国际线"); //添加国内长线模块 if (LongVal != null && LongVal.Length > 0) { EyouSoft.Model.SystemStructure.SysCityAreaControl model = null; foreach (string LongM in LongVal) { model = new EyouSoft.Model.SystemStructure.SysCityAreaControl(); string[] strList = LongM.Split('_'); string[] areaInfo = strList[0].Split('|'); model.AreaId = int.Parse(areaInfo[0]); model.AreaName = areaInfo[1]; model.CityId = CityID; model.CityName = ""; if (strList[2] != null) { if (strList[2].ToString() == "1") { model.IsDefaultShow = true; } else { model.IsDefaultShow = false; } } else { model.IsDefaultShow = false; } model.ProvinceId = ProvinceID; model.ProvinceName = ""; model.RouteType = EyouSoft.Model.SystemStructure.AreaType.国内长线; if (strList[1] != null && StringValidate.IsInteger(strList[1].ToString())) { model.SortId = int.Parse(strList[1].ToString()); } else { model.SortId = 0; } model.TourCount = 0; modelList.Add(model); } } //添加国内短线模块 if (ShortVal != null && ShortVal.Length > 0) { EyouSoft.Model.SystemStructure.SysCityAreaControl model = null; foreach (string ShortM in ShortVal) { model = new EyouSoft.Model.SystemStructure.SysCityAreaControl(); string[] strList = ShortM.Split('_'); string[] areaInfo = strList[0].Split('|'); model.AreaId = int.Parse(areaInfo[0]); model.AreaName = areaInfo[1]; model.CityId = CityID; model.CityName = ""; if (strList[2] != null) { if (strList[2].ToString() == "1") { model.IsDefaultShow = true; } else { model.IsDefaultShow = false; } } else { model.IsDefaultShow = false; } model.ProvinceId = ProvinceID; model.ProvinceName = ""; model.RouteType = EyouSoft.Model.SystemStructure.AreaType.国内短线; if (strList[1] != null && StringValidate.IsInteger(strList[1].ToString())) { model.SortId = int.Parse(strList[1].ToString()); } else { model.SortId = 0; } model.TourCount = 0; modelList.Add(model); } } //添加国际线模块 if (OutVal != null && OutVal.Length > 0) { EyouSoft.Model.SystemStructure.SysCityAreaControl model = null; foreach (string OutM in OutVal) { model = new EyouSoft.Model.SystemStructure.SysCityAreaControl(); string[] strList = OutM.Split('_'); string[] areaInfo = strList[0].Split('|'); model.AreaId = int.Parse(areaInfo[0]); model.AreaName = areaInfo[1]; model.CityId = CityID; model.CityName = ""; if (strList[2] != null) { if (strList[2].ToString() == "1") { model.IsDefaultShow = true; } else { model.IsDefaultShow = false; } } else { model.IsDefaultShow = false; } model.ProvinceId = ProvinceID; model.ProvinceName = ""; model.RouteType = EyouSoft.Model.SystemStructure.AreaType.国际线; if (strList[1] != null && StringValidate.IsInteger(strList[1].ToString())) { model.SortId = int.Parse(strList[1].ToString()); } else { model.SortId = 0; } model.TourCount = 0; modelList.Add(model); } } //执行操作 EyouSoft.BLL.SystemStructure.SysCity.CreateInstance().UpdateSysSiteAreaControl(CityID, modelList); //释放资源 modelList = null; MessageBox.ShowAndRedirect(this, "设置线路区域成功!", "ChooseRouteAgency.aspx?CityID=" + CityID); }