Ejemplo n.º 1
0
 public ActionResult AddHoleDepthInfo(string holeName)
 {
     if (Request.IsAuthenticated)
     {
         HoleDepthInfoModel model = new HoleDepthInfoModel();
         model.HoleName = holeName;
         return(View(model));
     }
     return(RedirectToAction("Login", "Account"));
 }
Ejemplo n.º 2
0
 public ActionResult EditHoleDepthInfo(HoleDepthInfoModel model)
 {
     if (Request.IsAuthenticated)
     {
         DrilledHoleDbEntities drilledHoleDb = new DrilledHoleDbEntities();
         var depthInfo = drilledHoleDb.Table_HoleDepthInfo.FirstOrDefault(a => a.HoleName == model.HoleName && a.Depth == model.Depth);
         depthInfo.Dip     = model.Dip;
         depthInfo.Azimuth = model.Azimuth;
         drilledHoleDb.SaveChanges();
         return(RedirectToAction("HoleDepthInfoList", new { holeName = model.HoleName }));
     }
     return(RedirectToAction("Login", "Account"));
 }
Ejemplo n.º 3
0
 public ActionResult AddHoleDepthInfo(HoleDepthInfoModel model)
 {
     if (Request.IsAuthenticated)
     {
         DrilledHoleDbEntities drilledHoleDb = new DrilledHoleDbEntities();
         var depthInfo = new Table_HoleDepthInfo();
         depthInfo.HoleName = model.HoleName;
         depthInfo.Depth    = model.Depth;
         depthInfo.Dip      = model.Dip;
         depthInfo.Azimuth  = model.Azimuth;
         drilledHoleDb.Table_HoleDepthInfo.Add(depthInfo);
         drilledHoleDb.SaveChanges();
         return(RedirectToAction("HoleDepthInfoList", new { holeName = model.HoleName }));
     }
     return(RedirectToAction("Login", "Account"));
 }
Ejemplo n.º 4
0
 public ActionResult EditHoleDepthInfo(string holeName, int depth)
 {
     if (Request.IsAuthenticated)
     {
         var drilledHoleDb = new DrilledHoleDbEntities();
         var depthInfo     = drilledHoleDb.Table_HoleDepthInfo.FirstOrDefault(a => a.HoleName == holeName && a.Depth == depth);
         var model         = new HoleDepthInfoModel()
         {
             HoleName = depthInfo.HoleName,
             Depth    = depthInfo.Depth,
             Dip      = depthInfo.Dip,
             Azimuth  = depthInfo.Azimuth
         };
         return(View(model));
     }
     return(RedirectToAction("Login", "Account"));
 }