public IHttpActionResult AddApplicationForm(VMSite.ApplicationForm obj) { if (ModelState.IsValid) { try { bool ret = BisApplicationForm.AddApplicationForm(obj); if (ret) { return(Ok(ret)); } else { return(NotFound()); } } catch { return(NotFound()); } } else { PublicFunctions getError = new PublicFunctions(); return(Content(HttpStatusCode.NotFound, getError.GetErrorListFromModelState(ModelState))); } }
public IHttpActionResult AddUserSiteByEnroll(VMSite.SignUp obj) { if (ModelState.IsValid) { try { obj.Password = obj.Password.FixFarsi().EncryptData(); bool ret = BisUserSite.AddUserSiteByEnroll(obj); if (ret) { return(Ok(ret)); } else { return(NotFound()); } } catch { return(NotFound()); } } else { PublicFunctions getError = new PublicFunctions(); return(Content(HttpStatusCode.NotFound, getError.GetErrorListFromModelState(ModelState))); } }
public IHttpActionResult LoginUserSiteByToken(ViewModel.tblLogUser obj) { if (ModelState.IsValid) { try { JArray jsLogin = BisUserSite.LoginUserSiteByToken(obj); return(Ok(jsLogin)); } catch { return(NotFound()); } } else { PublicFunctions getError = new PublicFunctions(); return(Content(HttpStatusCode.NotFound, getError.GetErrorListFromModelState(ModelState))); } }
public IHttpActionResult LoginUserSite(VMSite.SignIn obj) { if (ModelState.IsValid) { try { obj.Password = obj.Password.FixFarsi().EncryptData(); JArray jsLogin = BisUserSite.LoginUserSite(obj); return(Ok(jsLogin)); } catch { return(NotFound()); } } else { PublicFunctions getError = new PublicFunctions(); return(Content(HttpStatusCode.NotFound, getError.GetErrorListFromModelState(ModelState))); } }
public IHttpActionResult AddMaterialList(ViewModelSite.tblMaterialList obj) { try { if (ModelState.IsValid) { obj.IDUser = AuUser.ReturnIDUser(obj.IDLogUser); if (obj.IDUser != Guid.Empty) { obj.IDLogUser = null; bool ret = BisMaterialList.AddMaterialListInSite(obj); if (ret) { return(Ok(ret)); } else { return(NotFound()); } } else { return(Content(HttpStatusCode.MethodNotAllowed, "ابتدا به حساب کاربری خود وارد شوید")); } } else { PublicFunctions getError = new PublicFunctions(); return(Content(HttpStatusCode.NotFound, getError.GetErrorListFromModelState(ModelState))); } } catch (Exception ex) { return(NotFound()); } }