예제 #1
0
        public ActionResult NewExchangeMaintenance(ExchangeMaintenanceModel m)
        {
            bool success = true;

            WebView.WebService._base myWebService;
            myWebService = new WebService._base();

            //string Success = "false";
            bool selected = false;

            WebService._base.ExchangeMaintenance newExcMain = new WebService._base.ExchangeMaintenance();
            System.Diagnostics.Debug.WriteLine("A :" + m.PTT_ID);
            newExcMain.EXC_ABB  = m.EXC_ABB;
            newExcMain.EXC_NAME = m.EXC_NAME;
            newExcMain.PTT_ID   = m.PTT_ID;
            newExcMain.LOC_NO   = m.LOC_NO;
            newExcMain.STATE_ID = m.STATE_ID;
            newExcMain.MAIN_NO  = m.MAIN_NO.ToString();
            newExcMain.CAT_CODE = m.CAT_CODE;
            newExcMain.EXC_TYPE = m.EXC_TYPE;
            newExcMain.EXC_ID   = m.EXC_ID;
            newExcMain.SEGMENT  = m.SEGMENT;
            newExcMain.ADD1     = m.ADDR1;
            newExcMain.ADD2     = m.ADDR2;
            newExcMain.CITY     = m.CITY;

            success  = myWebService.AddExchangeMaintenance(newExcMain);
            selected = true;
            System.Diagnostics.Debug.WriteLine("C : " + m.SEGMENT);
            //if (ModelState.IsValid && selected)
            //{

            if (success == true)
            {
                return(RedirectToAction("NewSave"));
            }
            else
            {
                return(RedirectToAction("NewSaveFail"));    // store to db failed.
            }
            //}

            //return View(m);
        }