Exemplo n.º 1
0
        public ActionResult Update()
        {
            string id       = Request["id"] ?? "";
            string xh       = Request["xh"] ?? "";
            string wtfqymc  = Request["wtfqymc"] ?? "";
            string ckrq     = Request["ckrq"] ?? "";
            string cklx     = Request["cklx"] ?? "";
            string hpmc     = Request["hpmc"] ?? "";
            string ggxh     = Request["ggxh"] ?? "";
            string scqy     = Request["scqy"] ?? "";
            string cpzcz    = Request["cpzcz"] ?? "";
            string scph     = Request["scph"] ?? "";
            string cytj     = Request["cytj"] ?? "";
            string yxq      = Request["yxq"] ?? "";
            string dw       = Request["dw"] ?? "";
            string sl       = Request["sl"] ?? "";
            string shkhmc   = Request["shkhmc"] ?? "";
            string shdz     = Request["shdz"] ?? "";
            string lxr      = Request["lxr"] ?? "";
            string lxfs     = Request["lxfs"] ?? "";
            string bz       = Request["bz"] ?? "";
            string col1     = Request["col1"] ?? "";
            string makedate = Request["makedate"] ?? "";
            string makeman  = Request["makeman"] ?? "";
            int    uid      = int.Parse(id);

            try
            {
                cfda_outhistory p = ob_cfda_outhistoryservice.GetEntityById(cfda_outhistory => cfda_outhistory.ID == uid);
                p.XH       = xh.Trim();
                p.WTFQYMC  = wtfqymc.Trim();
                p.CKRQ     = ckrq.Trim();
                p.CKLX     = cklx.Trim();
                p.HPMC     = hpmc.Trim();
                p.GGXH     = ggxh.Trim();
                p.SCQY     = scqy.Trim();
                p.CPZCZ    = cpzcz.Trim();
                p.SCPH     = scph.Trim();
                p.CYTJ     = cytj.Trim();
                p.YXQ      = yxq.Trim();
                p.DW       = dw.Trim();
                p.SL       = sl.Trim();
                p.SHKHMC   = shkhmc.Trim();
                p.SHDZ     = shdz.Trim();
                p.LXR      = lxr.Trim();
                p.LXFS     = lxfs.Trim();
                p.BZ       = bz.Trim();
                p.Col1     = col1.Trim();
                p.MakeDate = makedate == "" ? DateTime.Now : DateTime.Parse(makedate);
                p.MakeMan  = makeman == "" ? 0 : int.Parse(makeman);
                ob_cfda_outhistoryservice.UpdateEntity(p);
                ViewBag.saveok = ViewAddTag.ModifyOk;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                ViewBag.saveok = ViewAddTag.ModifyNo;
            }
            return(RedirectToAction("Edit", new { id = uid }));
        }
Exemplo n.º 2
0
        public ActionResult Save()
        {
            string id       = Request["id"] ?? "";
            string xh       = Request["xh"] ?? "";
            string wtfqymc  = Request["wtfqymc"] ?? "";
            string ckrq     = Request["ckrq"] ?? "";
            string cklx     = Request["cklx"] ?? "";
            string hpmc     = Request["hpmc"] ?? "";
            string ggxh     = Request["ggxh"] ?? "";
            string scqy     = Request["scqy"] ?? "";
            string cpzcz    = Request["cpzcz"] ?? "";
            string scph     = Request["scph"] ?? "";
            string cytj     = Request["cytj"] ?? "";
            string yxq      = Request["yxq"] ?? "";
            string dw       = Request["dw"] ?? "";
            string sl       = Request["sl"] ?? "";
            string shkhmc   = Request["shkhmc"] ?? "";
            string shdz     = Request["shdz"] ?? "";
            string lxr      = Request["lxr"] ?? "";
            string lxfs     = Request["lxfs"] ?? "";
            string bz       = Request["bz"] ?? "";
            string col1     = Request["col1"] ?? "";
            string makedate = Request["makedate"] ?? "";
            string makeman  = Request["makeman"] ?? "";

            try
            {
                cfda_outhistory ob_cfda_outhistory = new cfda_outhistory();
                ob_cfda_outhistory.XH       = xh.Trim();
                ob_cfda_outhistory.WTFQYMC  = wtfqymc.Trim();
                ob_cfda_outhistory.CKRQ     = ckrq.Trim();
                ob_cfda_outhistory.CKLX     = cklx.Trim();
                ob_cfda_outhistory.HPMC     = hpmc.Trim();
                ob_cfda_outhistory.GGXH     = ggxh.Trim();
                ob_cfda_outhistory.SCQY     = scqy.Trim();
                ob_cfda_outhistory.CPZCZ    = cpzcz.Trim();
                ob_cfda_outhistory.SCPH     = scph.Trim();
                ob_cfda_outhistory.CYTJ     = cytj.Trim();
                ob_cfda_outhistory.YXQ      = yxq.Trim();
                ob_cfda_outhistory.DW       = dw.Trim();
                ob_cfda_outhistory.SL       = sl.Trim();
                ob_cfda_outhistory.SHKHMC   = shkhmc.Trim();
                ob_cfda_outhistory.SHDZ     = shdz.Trim();
                ob_cfda_outhistory.LXR      = lxr.Trim();
                ob_cfda_outhistory.LXFS     = lxfs.Trim();
                ob_cfda_outhistory.BZ       = bz.Trim();
                ob_cfda_outhistory.Col1     = col1.Trim();
                ob_cfda_outhistory.MakeDate = makedate == "" ? DateTime.Now : DateTime.Parse(makedate);
                ob_cfda_outhistory.MakeMan  = makeman == "" ? 0 : int.Parse(makeman);
                ob_cfda_outhistory          = ob_cfda_outhistoryservice.AddEntity(ob_cfda_outhistory);
                ViewBag.cfda_outhistory     = ob_cfda_outhistory;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
        public ActionResult Edit(int id)
        {
            cfda_outhistory tempData = ob_cfda_outhistoryservice.GetEntityById(cfda_outhistory => cfda_outhistory.ID == id && cfda_outhistory.IsDelete == false);

            ViewBag.cfda_outhistory = tempData;
            if (tempData == null)
            {
                return(View());
            }
            else
            {
                cfda_outhistoryViewModel cfda_outhistoryviewmodel = new cfda_outhistoryViewModel();
                cfda_outhistoryviewmodel.ID       = tempData.ID;
                cfda_outhistoryviewmodel.XH       = tempData.XH;
                cfda_outhistoryviewmodel.WTFQYMC  = tempData.WTFQYMC;
                cfda_outhistoryviewmodel.CKRQ     = tempData.CKRQ;
                cfda_outhistoryviewmodel.CKLX     = tempData.CKLX;
                cfda_outhistoryviewmodel.HPMC     = tempData.HPMC;
                cfda_outhistoryviewmodel.GGXH     = tempData.GGXH;
                cfda_outhistoryviewmodel.SCQY     = tempData.SCQY;
                cfda_outhistoryviewmodel.CPZCZ    = tempData.CPZCZ;
                cfda_outhistoryviewmodel.SCPH     = tempData.SCPH;
                cfda_outhistoryviewmodel.CYTJ     = tempData.CYTJ;
                cfda_outhistoryviewmodel.YXQ      = tempData.YXQ;
                cfda_outhistoryviewmodel.DW       = tempData.DW;
                cfda_outhistoryviewmodel.SL       = tempData.SL;
                cfda_outhistoryviewmodel.SHKHMC   = tempData.SHKHMC;
                cfda_outhistoryviewmodel.SHDZ     = tempData.SHDZ;
                cfda_outhistoryviewmodel.LXR      = tempData.LXR;
                cfda_outhistoryviewmodel.LXFS     = tempData.LXFS;
                cfda_outhistoryviewmodel.BZ       = tempData.BZ;
                cfda_outhistoryviewmodel.Col1     = tempData.Col1;
                cfda_outhistoryviewmodel.MakeDate = tempData.MakeDate;
                cfda_outhistoryviewmodel.MakeMan  = tempData.MakeMan;
                return(View(cfda_outhistoryviewmodel));
            }
        }