Exemple #1
0
        public ActionResult Delete(Customerinfo delete)
        {
            CustomerService customerService = new CustomerService();

            customerService.Delete(delete);
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public void UpdateCustomerByCustomerID(Customerinfo custinfo)
        {
            try
            {
                using (RMSDataContext db = new RMSDataContext())
                {
                    var obj = (from customer in db.Customers
                               where customer.CustomerID == custinfo.CustomerID
                               select customer).First();

                    obj.Customercode = custinfo.CustomerCode;
                    obj.Contact      = custinfo.Contact;
                    obj.Address      = custinfo.address;
                    obj.Name         = custinfo.Name;
                    obj.TownshipID   = custinfo.TownshipID;
                    obj.UpdateDate   = DateTime.Now;

                    db.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                Customer cust = new Customer();
            }
        }
Exemple #3
0
 public List <Customerinfo> selectallcustomerinfo()
 {
     try
     {
         List <Customerinfo> listcustomerinfo = new List <Customerinfo>();
         {
             using (RMSDataContext db = new RMSDataContext())
             {
                 Customerinfo customerinfo;
                 var          a = (from o in db.Customers select o).ToList();
                 foreach (var obj in a)
                 {
                     customerinfo              = new Customerinfo();
                     customerinfo.CustomerID   = obj.CustomerID;
                     customerinfo.CustomerCode = obj.Customercode;
                     customerinfo.Name         = obj.Name;
                     customerinfo.TownshipID   = obj.TownshipID;
                     customerinfo.Contact      = obj.Contact;
                     customerinfo.address      = obj.Address;
                     customerinfo.InsertDate   = obj.InsertDate;
                     customerinfo.UpdateDate   = obj.UpdateDate;
                     listcustomerinfo.Add(customerinfo);
                 }
                 return(listcustomerinfo);
             }
         }
     }
     catch (Exception ex)
     {
         return(new List <Customerinfo>());
     }
 }
Exemple #4
0
        public ActionResult Delete(long id)
        {
            CustomerService delete = new CustomerService();
            Customerinfo    info   = delete.AllCustList().Single(cust => cust.ID == id);

            return(View(info));
        }
Exemple #5
0
        public ActionResult UpdateCust(Customerinfo Update)
        {
            CustomerService edit = new CustomerService();

            edit.UpdateCust(Update);
            return(RedirectToAction("Index"));
        }
Exemple #6
0
        public ActionResult AddCust_Post(Customerinfo NewCust)
        {
            CustomerService New = new CustomerService();

            New.AddCust(NewCust);
            return(RedirectToAction("Index"));
        }
Exemple #7
0
        public ActionResult UpdateCust(long id)
        {
            CustomerService edit = new CustomerService();

            Customerinfo info = edit.AllCustList().Single(cust => cust.ID == id);

            return(View(info));

            //return View(edit.GetCust(id));
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Customercontroller custCtlr = new Customercontroller();
            Customerinfo       custInfo = new Customerinfo();

            custInfo.CustomerCode = txtCustomerCode.Text;
            custInfo.Name         = txtCustomerName.Text;
            custInfo.TownshipID   = townshipData.SelectedValue;
            custInfo.Contact      = int.Parse(txtContact.Text);
            custInfo.address      = CustomerAddress.SelectedValue;

            custCtlr.InsertCustomer(custInfo);
            SelectAllCustomer();
        }
Exemple #9
0
 public void insert_customer(Customerinfo custinfo)
 {
     using (RMSDataContext db = new RMSDataContext())
     {
         Customer custbl = new Customer();
         custbl.CustomerID   = custinfo.CustomerID;
         custbl.Customercode = custinfo.CustomerCode;
         custbl.Address      = custinfo.address;
         custbl.Contact      = custinfo.Contact;
         custbl.InsertDate   = custinfo.InsertDate;
         custbl.Name         = custinfo.Name;
         custbl.TownshipID   = custinfo.TownshipID;
         custbl.UpdateDate   = custinfo.UpdateDate;
         db.Customers.InsertOnSubmit(custbl);
         db.SubmitChanges();
     }
 }
Exemple #10
0
        public void DeleteCustomerByCustomerID(Customerinfo custinfo)
        {
            try
            {
                using (RMSDataContext db = new RMSDataContext())
                {
                    var obj = (from cust in db.Customers
                               where cust.CustomerID == custinfo.CustomerID
                               select cust).First();

                    db.Customers.DeleteOnSubmit(obj);
                    db.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                Customer c = new Customer();
            }
        }
Exemple #11
0
        static void Main(string[] args)
        {
            //Create voguepay merchant instance
            Merchant merchantinfo = new Merchant();

            merchantinfo.MerchantID = "6359-0000000";
            merchantinfo.Username   = "******";
            merchantinfo.Email      = "*****@*****.**";

            //Create voguepay instance (Parameters "live" or "demo", default is demo)
            Voguepay voguepay = new Voguepay("live");

            voguepay.Init(merchantinfo);

            //Create customer instance
            Customerinfo customer = new Customerinfo();

            customer.Name    = "Sam Great";
            customer.Phone   = "20339922";
            customer.Email   = "*****@*****.**";
            customer.City    = "Allen";
            customer.Country = "NGA";
            customer.State   = "Ikeja";
            customer.ZipCode = "23401";
            customer.Address = "3 Drive view estate";

            //Create a hosted payment transaction
            HostedPayment hostedPayment = new HostedPayment();

            hostedPayment.Amount          = 250.3333;
            hostedPayment.Reference       = "MyRef123";
            hostedPayment.Memo            = "Sample payment";
            hostedPayment.Currency        = "NGN";
            hostedPayment.StoreID         = "293330002"; //optional
            hostedPayment.SuccessURL      = "https://sample.com/success";
            hostedPayment.FailureURL      = "https://sample.com/fail";
            hostedPayment.NotificationURL = "https://sample.com/notify";

            string jsonResult = voguepay.Pay(hostedPayment, customer);

            Console.WriteLine(jsonResult);
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            //Create voguepay merchant instance
            Merchant merchantinfo = new Merchant();

            merchantinfo.MerchantID      = "6359-0000000";
            merchantinfo.Username        = "******";
            merchantinfo.Email           = "*****@*****.**";
            merchantinfo.CommandAPIToken = "ZnHzcbxKVbvF5d3J5JvZqZe587Rna";
            merchantinfo.PublicKeyFile   = @"C:\Users\Rock\public.txt"; //URL path to saved public key

            //Create voguepay instance (Parameters "live" or "demo", default is demo)
            Voguepay voguepay = new Voguepay("live");

            voguepay.Init(merchantinfo);

            //Create customer instance
            Customerinfo customer = new Customerinfo();

            customer.Name    = "Sam Great";
            customer.Phone   = "20339922";
            customer.Email   = "*****@*****.**";
            customer.City    = "Allen";
            customer.Country = "NGA";
            customer.State   = "Ikeja";
            customer.ZipCode = "23401";
            customer.Address = "3 Drive view estate";


            DirectPayment directpayment = new DirectPayment();

            directpayment.version     = 2;
            directpayment.Amount      = 100.22;
            directpayment.Currency    = "USD";
            directpayment.Reference   = "MY_UNIQUE_REF";
            directpayment.Memo        = "Sample payment";
            directpayment.RedirectURL = "https://sample.com/redirect";
            directpayment.ReferralURL = "https://sample.com/referral";
            directpayment.ResponseURL = "https://sample.com/notify/";
            directpayment.StoreID     = "5a33c3933ca"; //optional

            directpayment.CardName        = "Steve";
            directpayment.CardPan         = "5389830123937029";
            directpayment.CardExpiryMonth = 5;
            directpayment.CardExpiryYear  = 21;
            directpayment.CardCVV         = 170;


            directpayment.ServerPublicIP           = "192.333.44.33";
            directpayment.ServerWebsiteURL         = "www.google.com";
            directpayment.CustomerReferringIP      = "10.22.333.33";
            directpayment.CustomerReferringWebsite = "www.shades.com";

            directpayment.DescriptorCompanyName    = "Sparks";
            directpayment.DescriptorCountryAddress = "Sparks Street";
            directpayment.DescriptorCityAddress    = "Califonia";
            directpayment.DescriptorCountryAddress = "USA"; //country or 3 letter ISO

            // directpayment.CardToken = "5a344439203";
            //  directpayment.CardTokenize =true;

            string jsonResult = voguepay.Pay(directpayment, customer);

            Console.WriteLine(jsonResult);
            Console.ReadKey();
        }
 public void DeleteCustomer(Customerinfo custInfo)
 {
     cusdao.DeleteCustomerByCustomerID(custInfo);
 }
 public void UpdateCustomer(Customerinfo custInfo)
 {
     cusdao.UpdateCustomerByCustomerID(custInfo);
 }
 public void InsertCustomer(Customerinfo custInfo)
 {
     cusdao.insert_customer(custInfo);
 }