Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9556 for branches


Ignore:
Timestamp:
05/29/13 15:01:23 (12 years ago)
Author:
fschoepp
Message:

#1888:

  • Added views for the billing component (Register users, Create orders and Activate Orders view)
  • Added a mockup for the billing back-end .
Location:
branches/OaaS
Files:
12 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS/HeuristicLab 3.3 Services.sln

    r9550 r9556  
    3939    Release.AspNetCompiler.FixedNames = "false"
    4040    Release.AspNetCompiler.Debug = "False"
    41     VWDPort = "25129"
     41    VWDPort = "19288"
    4242    VWDVirtualPath = "/Hive-3.3"
    4343    DefaultWebSiteLanguage = "Visual C#"
  • branches/OaaS/HeuristicLab.Services.Optimization.Billing/HeuristicLab.Services.Optimization.Billing.csproj

    r9550 r9556  
    4343  <ItemGroup>
    4444    <Compile Include="Interfaces\IOptimizationBilling.cs" />
     45    <Compile Include="MockupOptimizationBilling.cs" />
    4546    <Compile Include="Model\Model.cs" />
    4647    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/OaaS/HeuristicLab.Services.Optimization.Billing/Model/Model.cs

    r9550 r9556  
    3434
    3535  public class User {
     36    public string Name { get; set; }
    3637  }
    3738
     
    5354    public DateTime ActiveUntil { get; set; }
    5455    public IList<Invoice> Invoices { get; set; }
     56    public IList<OrderLine> OrderLines { get; set; }
    5557  }
    5658
  • branches/OaaS/HeuristicLab.Services.Optimization.ControllerService.Tests/HeuristicLab.Services.Optimization.ControllerService.Tests.csproj

    r9166 r9556  
    182182  </ItemGroup>
    183183  <ItemGroup>
    184     <None Include="app.config">
     184    <None Include="mappings\app.config">
    185185      <SubType>Designer</SubType>
    186186    </None>
  • branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/AccountController.cs

    r8384 r9556  
    5656    }
    5757
    58    
    59     ////
    60     //// GET: /Account/Register
    6158
    62     //public ActionResult Register() {
    63     //  return View();
    64     //}
     59    //
     60    // GET: /Account/Register
    6561
    66     ////
    67     //// POST: /Account/Register
     62    public ActionResult Register() {
     63      return View();
     64    }
    6865
    69     //[HttpPost]
    70     //public ActionResult Register(RegisterModel model) {
    71     //  if (ModelState.IsValid) {
    72     //    // Attempt to register the user
    73     //    MembershipCreateStatus createStatus;
    74     //    Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus);
     66    //
     67    // POST: /Account/Register
    7568
    76     //    if (createStatus == MembershipCreateStatus.Success) {
    77     //      FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */);
    78     //      return RedirectToAction("Index", "Home");
    79     //    }
    80     //    else {
    81     //      ModelState.AddModelError("", ErrorCodeToString(createStatus));
    82     //    }
    83     //  }
     69    [HttpPost]
     70    public ActionResult Register(RegisterModel model) {
     71      if (ModelState.IsValid) {
     72        // Attempt to register the user
     73        MembershipCreateStatus createStatus;
     74        Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus);
     75        if (createStatus == MembershipCreateStatus.Success) {
     76          Roles.AddUserToRole(model.UserName, "Web User");
     77          Roles.AddUserToRole(model.UserName, "Hive User");
     78          FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */);
     79          return RedirectToAction("Index", "Home");
     80        }
     81        else {
     82          ModelState.AddModelError("", ErrorCodeToString(createStatus));
     83        }
     84      }
    8485
    85     //  // If we got this far, something failed, redisplay form
    86     //  return View(model);
    87     //}
     86      // If we got this far, something failed, redisplay form
     87      return View(model);
     88    }
    8889
    89     ////
    90     //// GET: /Account/ChangePassword
     90    //
     91    // GET: /Account/ChangePassword
    9192
    92     //[Authorize]
    93     //public ActionResult ChangePassword() {
    94     //  return View();
    95     //}
     93    [Authorize]
     94    public ActionResult ChangePassword() {
     95      return View();
     96    }
    9697
    97     ////
    98     //// POST: /Account/ChangePassword
     98    //
     99    // POST: /Account/ChangePassword
    99100
    100     //[Authorize]
    101     //[HttpPost]
    102     //public ActionResult ChangePassword(ChangePasswordModel model) {
    103     //  if (ModelState.IsValid) {
     101    [Authorize]
     102    [HttpPost]
     103    public ActionResult ChangePassword(ChangePasswordModel model) {
     104      if (ModelState.IsValid) {
    104105
    105     //    // ChangePassword will throw an exception rather
    106     //    // than return false in certain failure scenarios.
    107     //    bool changePasswordSucceeded;
    108     //    try {
    109     //      MembershipUser currentUser = Membership.GetUser(User.Identity.Name, true /* userIsOnline */);
    110     //      changePasswordSucceeded = currentUser.ChangePassword(model.OldPassword, model.NewPassword);
    111     //    }
    112     //    catch (Exception) {
    113     //      changePasswordSucceeded = false;
    114     //    }
     106        // ChangePassword will throw an exception rather
     107        // than return false in certain failure scenarios.
     108        bool changePasswordSucceeded;
     109        try {
     110          MembershipUser currentUser = Membership.GetUser(User.Identity.Name, true /* userIsOnline */);
     111          changePasswordSucceeded = currentUser.ChangePassword(model.OldPassword, model.NewPassword);
     112        }
     113        catch (Exception) {
     114          changePasswordSucceeded = false;
     115        }
    115116
    116     //    if (changePasswordSucceeded) {
    117     //      return RedirectToAction("ChangePasswordSuccess");
    118     //    }
    119     //    else {
    120     //      ModelState.AddModelError("", "The current password is incorrect or the new password is invalid.");
    121     //    }
    122     //  }
     117        if (changePasswordSucceeded) {
     118          return RedirectToAction("ChangePasswordSuccess");
     119        }
     120        else {
     121          ModelState.AddModelError("", "The current password is incorrect or the new password is invalid.");
     122        }
     123      }
    123124
    124     //  // If we got this far, something failed, redisplay form
    125     //  return View(model);
    126     //}
     125      // If we got this far, something failed, redisplay form
     126      return View(model);
     127    }
    127128
    128     ////
    129     //// GET: /Account/ChangePasswordSuccess
     129    //
     130    // GET: /Account/ChangePasswordSuccess
    130131
    131     //public ActionResult ChangePasswordSuccess() {
    132     //  return View();
    133     //}
     132    public ActionResult ChangePasswordSuccess() {
     133      return View();
     134    }
    134135
    135136    #region Status Codes
  • branches/OaaS/HeuristicLab.Services.Optimization.Web/HeuristicLab.Services.Optimization.Web.csproj

    r9549 r9556  
    127127    <Compile Include="Controllers\HomeController.cs" />
    128128    <Compile Include="Controllers\JobController.cs" />
     129    <Compile Include="Controllers\OrderAdminController.cs" />
     130    <Compile Include="Controllers\OrderController.cs" />
    129131    <Compile Include="Global.asax.cs">
    130132      <DependentUpon>Global.asax</DependentUpon>
     
    135137    <Compile Include="Models\AdminModels.cs" />
    136138    <Compile Include="Models\ChartModels.cs" />
     139    <Compile Include="Models\OrderAdminModel.cs" />
    137140    <Compile Include="Models\ExperimentModel.cs" />
    138141    <Compile Include="Models\OptimizationModels.cs" />
     142    <Compile Include="Models\OrderModel.cs" />
    139143    <Compile Include="Models\StatusModel.cs" />
    140144    <Compile Include="Properties\AssemblyInfo.cs" />
     
    364368  </ItemGroup>
    365369  <ItemGroup>
     370    <ProjectReference Include="..\HeuristicLab.Services.Optimization.Billing\HeuristicLab.Services.Optimization.Billing.csproj">
     371      <Project>{5DC3E4F1-E21B-4C18-8921-88058E86FB07}</Project>
     372      <Name>HeuristicLab.Services.Optimization.Billing</Name>
     373    </ProjectReference>
    366374    <ProjectReference Include="..\HeuristicLab.Services.Optimization.Controller\HeuristicLab.Services.Optimization.ControllerService.csproj">
    367375      <Project>{E0095F29-604B-4EE8-9EE8-8187DA3B24F1}</Project>
     
    380388    <Content Include="Views\Experiment\NewEdit.cshtml" />
    381389    <Content Include="Views\Job\Index.cshtml" />
     390    <Content Include="Views\Order\Index.cshtml" />
     391    <Content Include="Views\Order\AddProduct.cshtml" />
     392    <Content Include="Views\Order\SaveOrder.cshtml" />
     393    <Content Include="Views\Order\OrderSaved.cshtml" />
     394    <Content Include="Views\OrderAdmin\Index.cshtml" />
    382395  </ItemGroup>
    383396  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Note: See TracChangeset for help on using the changeset viewer.