public static Object SUBMITSUBSCRIPTION(NameValueCollection Parameters)
        {
            try
            {
                //notes:    only POST method processing
                if (Parameters["PageFormMethod"] == "POST")
                {
                    //notes:    FORM PARAMETERS
                    //          SubscriptionID:   int, required
                    //          EmployeeID:       int, required
                    //          Address:          string, not required
                    //          City:             string, not required
                    //          State:            string, not required
                    //          Zip:              int, not required
                    //          AccountNumber:    int, not required
                    //          BillingNumber:    string, not required
                    //          StartDate:        datetime, not required
                    //          EndDate:          datetime, not required
                    //          Paid:             string, not required
                    //          HomeAddress:      bool, not required
                    //          Notes:            string, not required

                    //notes:    verify that correct parameters were passed in
                    SubscriptionItem objItem = new SubscriptionItem();

                    objItem.SubscriptionID = Convert.ToInt32(Parameters["txtSubscriptionID"]);
                    objItem.EmployeeID = Convert.ToInt32(Parameters["txtPerson"]);
                    objItem.VendorID = Convert.ToInt32(Parameters["ddlVendor"]);
                    objItem.Address = Parameters["txtAddress"];
                    objItem.City = Parameters["txtCity"];
                    objItem.State = Parameters["txtState"];
                    objItem.Zip = Convert.ToInt32(Parameters["txtZip"]);
                    objItem.AccountNumber = Convert.ToInt32(Parameters["txtAccountNumber"]);
                    objItem.BillingNumber = Parameters["txtBillingNumber"];
                    objItem.StartDate = Convert.ToDateTime(Parameters["txtStartDate"]);
                    objItem.EndDate = Convert.ToDateTime(Parameters["txtEndDate"]);
                    objItem.Paid = Parameters["txtPaid"];
                    objItem.HomeAddress = Convert.ToBoolean(Convert.ToInt32(Parameters["rblAddress"]));
                    objItem.Notes = Parameters["txtNotes"];

                    ResponseStatus objStatus = new ResponseStatus();

                    new FlowManager.SubscriptionItemFlow().Update(objItem, out objStatus);

                    //if (objStatus.ResponseStatusResult == ResponseStatusResult.Fail)
                    //    return objStatus;
                    //else
                        return objStatus;
                }
                else
                    return new ResponseStatus("Submit Subscription failed.", "Only POST method allowed.", ResponseStatusResult.Fail);
            }
            catch (Exception ex)
            {
                return new ResponseStatus("Submit Subscription failed.", ex.Message, ResponseStatusResult.Fail);
            }
        }
 //notes:    insert, update, delete
 public void Update(SubscriptionItem ObjectSubscriptionItem, out ResponseStatus StatusResult)
 {
     if (ObjectSubscriptionItem.SubscriptionID > 0)
         base.UpdateItem(ObjectSubscriptionItem, out StatusResult);
     else
     {
         //notes:    TODO: insert
         base.UpdateItem(ObjectSubscriptionItem, out StatusResult);
     }
 }
        protected void UpdateItem(SubscriptionItem SubscriptionItemObject, out ResponseStatus StatusResult)
        {
            string strStoredProcName = "jsp_Subscription_ExecuteResult";

            //notes:    ListValue options
            //          20 = UPDATE_ITEM
            try
            {
                //notes:    set the parameters to use for this query
                ParameterCollection objParamCollection = this.GetBaseParams(SubscriptionItemObject);
                objParamCollection.Add((20).GetParameterListValue());
                objParamCollection.Add(SubscriptionItemObject.SubscriptionID.GetParameterInt("@SubscriptionID"));

                //notes:    call data tier to update
                DataHelper.ExecuteDB(objParamCollection, strStoredProcName, base.GetConnectionString());

                //notes:    set out parameter
                StatusResult = new ResponseStatus("Update successful.", "ID = " + SubscriptionItemObject.SubscriptionID.ToString(), ResponseStatusResult.Success);
            }
            catch (Exception ex)
            {
                StatusResult = new ResponseStatus("Update failed.", ex.Message, ex.StackTrace, ResponseStatusResult.Fail);
            }
        }
 private void GetEmbeddedProperties(ref SubscriptionItem ThisObject)
 {
 }
        private ParameterCollection GetBaseParams(SubscriptionItem ThisObject)
        {
            //notes:    set base parameters - used mostly for insert/update methods
            ParameterCollection objHelperParamList = new ParameterCollection();

            if (ThisObject.VendorID > 0)
                objHelperParamList.Add(ThisObject.VendorID.GetParameterInt("@VendorID"));

            if (ThisObject.EmployeeID > 0)
                objHelperParamList.Add(ThisObject.VendorID.GetParameterInt("@EmployeeID"));

            if (ThisObject.Address != null && ThisObject.Address.Trim().Length > 0)
                objHelperParamList.Add(ThisObject.Address.GetParameterVarchar("@Address", 100));

            if (ThisObject.City != null)
                objHelperParamList.Add(ThisObject.City.GetParameterVarchar("@City", 50));

            if (ThisObject.State != null)
                objHelperParamList.Add(ThisObject.State.GetParameterVarchar("@State", 50));

            if (ThisObject.Zip > 0)
                objHelperParamList.Add(ThisObject.Zip.GetParameterInt("@Zip"));

            if (ThisObject.AccountNumber > 0)
                objHelperParamList.Add(ThisObject.AccountNumber.GetParameterInt("@AccountNumber"));

            if (ThisObject.BillingNumber != null)
                objHelperParamList.Add(ThisObject.BillingNumber.GetParameterVarchar("@BillingNumber", 50));

            if (ThisObject.StartDate != DateTime.MinValue)
                objHelperParamList.Add(ThisObject.StartDate.GetParameterDateTime("@StartDate"));

            if (ThisObject.EndDate != DateTime.MinValue)
                objHelperParamList.Add(ThisObject.EndDate.GetParameterDateTime("@EndDate"));

            if (ThisObject.Paid != null)
                objHelperParamList.Add(ThisObject.Paid.GetParameterVarchar("@Paid", 50));

            return objHelperParamList;
        }