Ejemplo n.º 1
0
 public ActionResult Add(ECommerceContainer model)
 {
     if (Session["UserName"] == null)
     {
         return(RedirectToAction("Index", "Account"));
     }
     ViewBag.ReportTitle = "Add new expense";
     AddECommerceContainer(model);
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 2
0
        public ActionResult Add()
        {
            // add new user
            if (Session["UserName"] == null)
            {
                return(RedirectToAction("Index", "Account"));
            }
            ViewBag.ReportTitle = "Create new container";

            var model = new ECommerceContainer();

            return(View(model));
        }
Ejemplo n.º 3
0
        public void AddECommerceContainer(ECommerceContainer model)
        {
            string sqlInsert = "INSERT tblcontainer (ContainerName, ContainerNumber, ShippedDate, EstimateArrivalDate, ArrivalDate, UnloadDate, MarketDate, UnloadBy, UnloadTimePeriod, Notes) "
                               + "VALUE (@ContainerName, @ContainerNumber, @ShippedDate, @EstimateArrivalDate, @ArrivalDate, @UnloadDate, @MarketDate, @UnloadBy, @UnloadTimePeriod, @Notes)";

            using (MySqlConnection connection = new MySqlConnection(Helpers.Helpers.GetERPConnectionString()))
            {
                try
                {
                    int result = connection.Execute(sqlInsert, model);
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
                finally
                {
                    connection.Close();
                }
            }
        }