public ActionResult Update()
        {
            string id            = Request["id"] ?? "";
            string u8code        = Request["u8code"] ?? "";
            string cargocode     = Request["cargocode"] ?? "";
            string recievenumber = Request["recievenumber"] ?? "";
            string col1          = Request["col1"] ?? "";
            string makedate      = Request["makedate"] ?? "";
            string makeman       = Request["makeman"] ?? "";
            int    uid           = int.Parse(id);

            try
            {
                u8_lackcargo p = ob_u8_lackcargoservice.GetEntityById(u8_lackcargo => u8_lackcargo.ID == uid);
                p.U8Code        = u8code.Trim();
                p.CargoCode     = cargocode.Trim();
                p.RecieveNumber = recievenumber == "" ? 0 : float.Parse(recievenumber);
                p.Col1          = col1.Trim();
                p.MakeDate      = makedate == "" ? DateTime.Now : DateTime.Parse(makedate);
                p.MakeMan       = makeman == "" ? 0 : int.Parse(makeman);
                ob_u8_lackcargoservice.UpdateEntity(p);
                ViewBag.saveok = ViewAddTag.ModifyOk;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                ViewBag.saveok = ViewAddTag.ModifyNo;
            }
            return(RedirectToAction("Edit", new { id = uid }));
        }
        public ActionResult Save()
        {
            string id            = Request["id"] ?? "";
            string u8code        = Request["u8code"] ?? "";
            string cargocode     = Request["cargocode"] ?? "";
            string recievenumber = Request["recievenumber"] ?? "";
            string col1          = Request["col1"] ?? "";
            string makedate      = Request["makedate"] ?? "";
            string makeman       = Request["makeman"] ?? "";

            try
            {
                u8_lackcargo ob_u8_lackcargo = new u8_lackcargo();
                ob_u8_lackcargo.U8Code        = u8code.Trim();
                ob_u8_lackcargo.CargoCode     = cargocode.Trim();
                ob_u8_lackcargo.RecieveNumber = recievenumber == "" ? 0 : float.Parse(recievenumber);
                ob_u8_lackcargo.Col1          = col1.Trim();
                ob_u8_lackcargo.MakeDate      = makedate == "" ? DateTime.Now : DateTime.Parse(makedate);
                ob_u8_lackcargo.MakeMan       = makeman == "" ? 0 : int.Parse(makeman);
                ob_u8_lackcargo      = ob_u8_lackcargoservice.AddEntity(ob_u8_lackcargo);
                ViewBag.u8_lackcargo = ob_u8_lackcargo;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit(int id)
        {
            u8_lackcargo tempData = ob_u8_lackcargoservice.GetEntityById(u8_lackcargo => u8_lackcargo.ID == id && u8_lackcargo.IsDelete == false);

            ViewBag.u8_lackcargo = tempData;
            if (tempData == null)
            {
                return(View());
            }
            else
            {
                u8_lackcargoViewModel u8_lackcargoviewmodel = new u8_lackcargoViewModel();
                u8_lackcargoviewmodel.ID            = tempData.ID;
                u8_lackcargoviewmodel.U8Code        = tempData.U8Code;
                u8_lackcargoviewmodel.CargoCode     = tempData.CargoCode;
                u8_lackcargoviewmodel.RecieveNumber = tempData.RecieveNumber;
                u8_lackcargoviewmodel.Col1          = tempData.Col1;
                u8_lackcargoviewmodel.MakeDate      = tempData.MakeDate;
                u8_lackcargoviewmodel.MakeMan       = tempData.MakeMan;
                return(View(u8_lackcargoviewmodel));
            }
        }