예제 #1
0
        public ActionResult UpdateData(string MatIdVal, string txtMatName, string txtMatUOM, string txtMatPrice, string txtMatCat, string txtRecType, string txtTransType)
        {
            bool success = true;

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

            WebService._base.MaterialMasterMaintenance newMatMast = new WebService._base.MaterialMasterMaintenance();
            newMatMast.MAT_NAME    = txtMatName;
            newMatMast.MAT_UOM     = txtMatUOM;
            newMatMast.MAT_PRICE   = txtMatPrice;
            newMatMast.MAT_CAT     = txtMatCat;
            newMatMast.RECORD_TYPE = txtRecType;
            newMatMast.TRANS_TYPE  = txtTransType;
            success = myWebService.UpdateMatMastMaintenance(newMatMast, MatIdVal);

            return(Json(new
            {
                Success = success
            }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public ActionResult NewMaterialMastMaintenance(MaterialMastMaintenanceModel m)
        {
            bool success = true;

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

            bool selected = false;

            WebService._base.MaterialMasterMaintenance newMatMastM = new WebService._base.MaterialMasterMaintenance();

            System.Diagnostics.Debug.WriteLine("base :2  Mat Name [" + newMatMastM.MAT_NAME + "]   Mat UOM  [" + newMatMastM.MAT_UOM + "]   Mat Price [" + newMatMastM.MAT_PRICE + "] Mat Cat [" + newMatMastM.MAT_CAT + "]  Record Type [" + newMatMastM.RECORD_TYPE + "]  Tras Type [" + newMatMastM.TRANS_TYPE + "] ");

            newMatMastM.MAT_NAME    = m.MatName;
            newMatMastM.MAT_UOM     = m.MatUOM;
            newMatMastM.MAT_PRICE   = m.MatPrice.ToString();
            newMatMastM.MAT_CAT     = m.MatCat;
            newMatMastM.RECORD_TYPE = m.RecordType;
            newMatMastM.TRANS_TYPE  = m.TransType;
            success  = myWebService.AddMatMastMaintenance(newMatMastM);
            selected = true;

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

            //return View(m);
        }