Exemplo n.º 1
0
        public ActionResult NewJob(DllVersion_NewJobModel model)
        {
            bool success = true;

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

            bool selected = false;

            using (Entities ctxData = new Entities())
            {
                var query = (from p in ctxData.WV_DLL_VERSION
                             where p.DLL_MASTER == model.DLL_MASTER && p.DLL_VERSION == model.DLL_VERSION
                             select p).Count();
                if (query == 0)
                {
                    WebService._base.DLLVersion newjob = new WebService._base.DLLVersion();
                    newjob.DLL_MASTER      = model.DLL_MASTER;
                    newjob.DLL_NAME        = model.DLL_NAME;
                    newjob.DLL_DESCRIPTION = model.DLL_DESCRIPTION;
                    newjob.DLL_VERSION     = model.DLL_VERSION;
                    newjob.CREATE_DATE     = model.CREATE_DATE;
                    success = myWebService.AddDllVersion(newjob);

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



            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult UpdateDataVersion(string txtMasterV, string txtNameV, string txtDescV, string txtVersionV)
        {
            bool success = true;

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

            WebService._base.DLLVersion upt_data = new WebService._base.DLLVersion();
            upt_data.DLL_MASTER      = txtMasterV;
            upt_data.DLL_NAME        = txtNameV;
            upt_data.DLL_VERSION     = txtVersionV;
            upt_data.DLL_DESCRIPTION = txtDescV;
            success = myWebService.UpdateDllVersion(upt_data);

            return(Json(new
            {
                Success = success
            }, JsonRequestBehavior.AllowGet));
        }