protected override void SaveToolStrip_Click(object sender, EventArgs e)
        {
            UpdateStatus("Saving Member", 50);
            string[] input = { "txtPhoneNo", "txtAddress", "txtEmailID" };
            if (Utilities.Validation.IsNullOrEmpty(this, true, new List<string>(input)))
            {
                return;
            }

            if (member == null)
                member = new Member(txtName.Text, txtMobNo.Text, txtPhoneNo.Text, txtMemberNo.Text, txtPLFNo.Text, txtAddress.Text, txtEmailID.Text);
            else
            {
                member.Name = txtName.Text;
                member.Mobile_No = txtMobNo.Text;
                member.Phone_No = txtPhoneNo.Text;
                member.MemberNo = txtMemberNo.Text;
                member.PLFNo = txtPLFNo.Text;
                member.Address = txtAddress.Text;
                member.Email = txtEmailID.Text;
            }

            bool success = Savers.PeoplePracticeSaver.SaveMemberInfo(member);

            if (success)
            {
                UpdateStatus("Saved", 100);
                this.Close();
                return;
            }

            UpdateStatus("Error in saving Member", 100);
        }
예제 #2
0
 public Sale(List<SaleItem> _items,bool _IsCredit, decimal _paidAmount, decimal _totalAmount,DateTime _dateOfSale, decimal _rebate,
             Customer _customer = null, Member _member = null,decimal _transportCharge = 0, decimal _balanceAmount = 0)
 {
     this.Items = _items;
     this.IsCredit = _IsCredit;
     this.Customer = _customer;
     this.Customer = _customer;
     this.Member = _member;
     this.TransportCharge = _transportCharge;
     this.PaidAmount = _paidAmount;
     this.BalanceAmount = _balanceAmount;
     this.TotalAmount = _totalAmount;
     this.DateOfSale = _dateOfSale;
     this.TotalRebate = _rebate;
 }
        public Winform_MemberDetails(Member _member)
        {
            InitializeComponent();
            member = _member;

            /*Load Controls*/
            txtAddress.Text = _member.Address;
            txtEmailID.Text = _member.Email;
            txtMobNo.Text = _member.Mobile_No;
            txtName.Text = _member.Name;
            txtPhoneNo.Text = _member.Phone_No;

            txtMemberNo.Text = _member.MemberNo;
            txtPLFNo.Text = _member.PLFNo;
        }
 public static bool SaveMemberInfo(Member _member)
 {
     using (var session = NHibernateHelper.OpenSession())
     {
         using (var tx = session.BeginTransaction())
         {
             try
             {
                 session.SaveOrUpdate(_member);
                 tx.Commit();
                 return true;
             }
             catch (Exception ex)
             {
                 log.Error(ex);
                 tx.Rollback();
                 return false;
             }
         }
     }
 }
        public void UpdateCustomerControls(Person _person)
        {
            if (rdbMember.Checked)
                this.memb = PeoplePracticeBuilder.GetMemberInfo(_person.ID);
            else
                this.cust = PeoplePracticeBuilder.GetCustomerInfo(_person.ID);

            txtName.Text = _person.Name;
            txtPhoneNo.Text = _person.Phone_No;
            txtMobNo.Text = _person.Mobile_No;
        }
        private void AddConsumerDetails()
        {
            this.cust = null;
            this.memb = null;
            this.UpdateCustomerControls(new Person());

            if (rdbMember.Checked)
                new Register.WinForm_MemberRegister().ShowDialog();
            else
                new Register.WinForm_CustomerRegister().ShowDialog();
        }