예제 #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         cust = Factory.Create(cmbCustomerType.Text);
         cust.CustomerName = txtCustomerName.Text;
         cust.Address      = txtAddress.Text;
         cust.PhoneNumber  = txtPhoneNumber.Text;
         if (cust.GetType() != typeof(LeadCustomer))
         {
             cust.BillDate   = Convert.ToDateTime(txtBillingDate.Text);
             cust.BillAmount = Convert.ToDecimal(txtBillingAmount.Text);
         }
         cust.CustomerType = cmbCustomerType.Text;
         string returnMessage = Fac.AddCustomer(cust);
         if (returnMessage == "SUCCESS")
         {
             MessageBox.Show("Customer saved successfully");
         }
         else if (returnMessage == "FAILED")
         {
             MessageBox.Show("Unable to save custome right now ,pleas try later");
         }
         else
         {
             MessageBox.Show(returnMessage);
         }
         Clear();
         LoadGridView();
     }
     catch (Exception ex)
     {
     }
 }
예제 #2
0
        public static void AddCustomer(string name, string phone, string notifactionToken)
        {
            customer customer = new customer()
            {
                custName = name, phoneNumber = phone, firebaseToken = notifactionToken
            };

            CustomerDal.AddCustomer(customer);
        }
        public ActionResult Create([Bind(Include = "Id,Name,Phone,Email")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                Customers.AddCustomer(customer);
                return(RedirectToAction("Index"));
            }

            return(View(customer));
        }
예제 #4
0
 public int Post(Customer c)
 {
     _logger.LogInformation(c.ModifiedBy + $"新增客户数据完成,新增客户编号为{ c.CustomerId}");
     return(dal.AddCustomer(c));
 }
예제 #5
0
 public string Add(Passport passport, Customer item)
 {
     return(dal.AddCustomer(passport, item) > 0 ? "" : ErrorMsg.AddFailMsg());
 }