public ActionResult DeleteConfirmed(int id)
        {
            dtiDbConnection db = new dtiDbConnection();

            Core.Model.WeighmentModel personalDetail = db.tblWeighment.Find(id);
            db.tblWeighment.Remove(personalDetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult InsertWeighmentIn(Core.Model.WeighmentModel res)
 {
     ModelState.AddModelError(string.Empty, "Please write first name.");
     if (res != null)
     {
         Web.Controllers.WebApiController.WebApiController webapi = new Web.Controllers.WebApiController.WebApiController();
         webapi.CreateWebAPIWeighmentIn(res);
     }
     return(RedirectToAction("WeighmentIn"));
 }
        public ActionResult GetWeighmentInforEdit(int?id)
        {
            Web.Controllers.WebApiController.WebApiController webapi = new Web.Controllers.WebApiController.WebApiController();
            List <Core.Model.WeighmentModel> obj = new List <Core.Model.WeighmentModel>();

            obj = webapi.GetWeighmentInforEdit(id);

            Core.Model.WeighmentModel result = new Core.Model.WeighmentModel();
            result.GrossWeight = obj[0].GrossWeight;
            result.ProductType = obj[0].ProductType;
            result.RefNo       = obj[0].RefNo;
            result.Slno        = obj[0].Slno;
            result.VendorName  = obj[0].VendorName;
            result.VehicleNo   = obj[0].VehicleNo;
            result.WeighingBy  = obj[0].WeighingBy;
            result.WeighmentId = obj[0].WeighmentId;
            result.DateTime    = obj[0].DateTime;
            return(PartialView("WeighmentInEdit", result));
        }
Exemplo n.º 4
0
        public ActionResult GetWeighmentInDetails(string id)
        {
            Web.Controllers.WebApiController.WebApiController webapi = new Web.Controllers.WebApiController.WebApiController();
            List <Core.Model.WeighmentModel> obj = new List <Core.Model.WeighmentModel>();

            try
            {
                Core.Model.WeighmentModel         result = new Core.Model.WeighmentModel();
                Data.DbConnection.dtiDbConnection db     = new Data.DbConnection.dtiDbConnection();

                result        = db.tblWeighment.Where(m => m.RefNo == id).FirstOrDefault();
                Session["Id"] = result.RefNo.ToString();
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public ActionResult DeleteItems(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            dtiDbConnection db = new dtiDbConnection();

            Core.Model.WeighmentModel personalDetail = db.tblWeighment.Find(id);
            if (personalDetail == null)
            {
                return(HttpNotFound());
            }

            Web.Controllers.WebApiController.WebApiController api = new Web.Controllers.WebApiController.WebApiController();
            api.DeleteItems(id.Value);
            return(this.RedirectToAction("WeighmentIn"));

            //return null;
        }
Exemplo n.º 6
0
 public void CreateWebAPIWeighmentIn(Core.Model.WeighmentModel res)
 {
     Data.SangamRepository rep = new Data.SangamRepository();
     rep.WeighmentInEntry(res);
 }