Example #1
0
        private void UpdateCustomerData()
        {
            try
            {
                Model.tblCustomer customer = new Model.tblCustomer();
                customer.Address       = txtAddress.Text;
                customer.CustomerID    = this.CustomerID;
                customer.EmailID       = txtMail.Text;
                customer.MobileNo      = txtMobileNo.Text;
                customer.Name          = txtCustomerName.Text;
                customer.MB_CustomerID = this.MB_CustomerID;
                customer.LastChange    = 0; // it means the data will be pushed back to the server.

                int result = DAL.TAILORING_DB.Instance.UpdateCustomer(customer);
                if (result > 0)
                {
                    Model.Utility.WriteLog("Customer data has been updated");

                    List <Model.tblCustomer> lstCustomer = new List <Model.tblCustomer>();
                    lstCustomer.Add(customer);

                    Model.clsSyncOperation clsSyncOperation = new Model.clsSyncOperation();
                    clsSyncOperation.SyncCustomerData(lstCustomer, true);

                    Model.Utility.ShowMessageBox("Customer data has been updated in device.", Model.Utility.MessageType.Success, this);

                    Navigation.PushAsync(new Customer());
                }
            }
            catch (Exception ex)
            {
                Model.Utility.WriteLog("UpdateCustomerData : " + ex.ToString());
            }
        }
Example #2
0
        public frmCustomerEdit(Model.tblCustomer tblCustomer)
        {
            InitializeComponent();

            txtCustomerName.Text = tblCustomer.Name;
            txtAddress.Text      = tblCustomer.Address;
            txtMail.Text         = tblCustomer.EmailID;
            txtMobileNo.Text     = tblCustomer.MobileNo;
            MB_CustomerID        = tblCustomer.MB_CustomerID;
            this.CustomerID      = tblCustomer.CustomerID;
        }