Example #1
0
        public ActionResult UpdateData(string ExcAbbVal, string txtExcName, string txtPttId, string txtLocNo, string txtStateId, string txtMainNo, string txtAreaClass, string txtExcType, string txtExcId, string txtSegment, string txtAdd1, string txtAdd2, string txtCity)
        {
            bool success = true;

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

            WebService._base.ExchangeMaintenance newExcMain = new WebService._base.ExchangeMaintenance();
            newExcMain.EXC_NAME = txtExcName;
            newExcMain.PTT_ID   = txtPttId;
            newExcMain.LOC_NO   = txtLocNo;
            newExcMain.STATE_ID = txtStateId;
            newExcMain.MAIN_NO  = txtMainNo;
            newExcMain.CAT_CODE = txtAreaClass;
            newExcMain.EXC_TYPE = txtExcType;
            newExcMain.EXC_ID   = txtExcId;
            newExcMain.SEGMENT  = txtSegment;
            // newExcMain.CITY = txtExcId; // city
            newExcMain.ADD1 = txtAdd1;
            newExcMain.ADD2 = txtAdd2;
            newExcMain.CITY = txtCity;

            System.Diagnostics.Debug.WriteLine("A : " + newExcMain.ADD1);
            success = myWebService.UpdateExchangeMaintenance(newExcMain, ExcAbbVal);

            return(Json(new
            {
                Success = success
            }, JsonRequestBehavior.AllowGet));
        }
Example #2
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);
        }