Example #1
0
        // TO DO:  The number of parameters here is obviously ridiculous... but is consistent with DDD
        //   principles
        public static Customer Create(int customerId, DateTime startDate, DateTime endDate, int statusCodeId, int nominationLevelId,
                                      AccountNumber accountNumber, int customerTypeId, int deliveryTypeId, DUNSNumber dunsNumber, LongName longName,
                                      ShortName shortName, DatabaseId ldcId, int lossTierId, DatabaseId deliveryLocation, int shipperId,
                                      DeliveryPressure deliveryPressure, MDQ mdq, MaxHourlyInterruptible maxHourlyInterruptible,
                                      MaxDailyInterruptible maxDailyInterruptible, HourlyInterruptible hourlyInterruptible,
                                      DailyInterruptible dailyInterruptible, TotalHourlySpecifiedFirm totalHourlySpecifiedFirm,
                                      TotalDailySpecifiedFirm totalDailySpecifiedFirm, InterstateSpecifiedFirm interstateSpecifiedFirm,
                                      IntrastateSpecifiedFirm intrastateSpecifiedFirm, CurrentDemand currentDemand, PreviousDemand previousDemand,
                                      int groupTypeId, int balancingLevelId, NAICSCode naicsCode, SICCode sicCode,
                                      SICCodePercentage sicCodePercentage, DateTime shippersLetterFromDate, DateTime shippersLetterToDate,
                                      bool ss1, bool isFederal, DateTime turnOffDate, DateTime turnOnDate)
        {
            DebugLog.Log("Entering Customer::Create");

            return(new Customer
            {
                Id = customerId,
                AccountNumber = accountNumber,
                AlternateCustomerId = null,
                BalancingLevelId = balancingLevelId,
                BasicPoolId = null,
                ContractTypeId = null,
                CurrentDemand = null,
                CustomerTypeId = customerTypeId,
                DailyInterruptible = dailyInterruptible,
                DeliveryLocation = deliveryLocation,
                DeliveryPressure = deliveryPressure,
                DeliveryTypeId = deliveryTypeId,
                DUNSNumber = dunsNumber,
                EndDate = endDate,
                GroupTypeId = groupTypeId,
                HourlyInterruptible = hourlyInterruptible,
                InterstateSpecifiedFirm = interstateSpecifiedFirm,
                IntrastateSpecifiedFirm = intrastateSpecifiedFirm,
                IsFederal = isFederal,
                LDCId = ldcId,
                LongName = longName,
                LossTierId = lossTierId,
                MaxDailyInterruptible = maxDailyInterruptible,
                MaxHourlyInterruptible = maxHourlyInterruptible,
                MDQ = mdq,
                NAICSCode = naicsCode,
                NominationLevelId = nominationLevelId,
                PreviousDemand = previousDemand,
                StartDate = startDate,
                StatusCodeId = statusCodeId,
                ShortName = shortName,
                ShipperId = shipperId,
                ShippersLetterFromDate = shippersLetterFromDate,
                ShippersLetterToDate = shippersLetterToDate,
                SICCode = sicCode,
                SICCodePercentage = sicCodePercentage,
                SS1 = ss1,
                TotalDailySpecifiedFirm = totalDailySpecifiedFirm,
                TotalHourlySpecifiedFirm = totalHourlySpecifiedFirm,
                TurnOffDate = turnOffDate,
                TurnOnDate = turnOnDate
            });
        }
        public ActionResult DeleteConfirmed(string id)
        {
            NAICSCode nAICSCodes = db.NAICSCodes.Find(id);

            db.NAICSCodes.Remove(nAICSCodes);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit(NAICSCode nAICSCodes)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nAICSCodes).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nAICSCodes));
 }
        //
        // GET: /NAICS/Details/5

        public ActionResult Details(string id = null)
        {
            NAICSCode naicscodes = db.NAICSCodes.Find(id);

            if (naicscodes == null)
            {
                return(HttpNotFound());
            }
            return(View(naicscodes));
        }
        public ActionResult Create(NAICSCode nAICSCodes)
        {
            if (ModelState.IsValid)
            {
                db.NAICSCodes.Add(nAICSCodes);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(nAICSCodes));
        }
        //GET: NAICSCodes/Edit
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NAICSCode nAICSCodes = db.NAICSCodes.Find(id);

            if (nAICSCodes == null)
            {
                return(HttpNotFound());
            }
            return(View(nAICSCodes));
        }