public void GetCustomerPoints(string custno) { progressPanel1.Visible = true; var bl = new BusinessLogic.BlCustomer().GetAvailablePointsInServer(_custno); if (bl > 0) { txtactualpoints.EditValue = Math.Round(bl/100, 2); } else { txtactualpoints.EditValue = 0; simpleButton1.Enabled = false; } progressPanel1.Visible = false; }
private void simpleButton1_Click(object sender, EventArgs e) { if (XtraMessageBox.Show("Are you sure to make re-dim", "Re-dim", MessageBoxButtons.YesNo) == DialogResult.Yes) { var bl = new BusinessLogic.BlCustomer(); try { _redmipoints = decimal.Parse(txtactualpoints.EditValue.ToString()); var _points = bl.GetAvailablePointsInServer(_custno); progressPanel1.Visible = true; if (_points > 0) { txtactualpoints.EditValue = Math.Round(_points/100, 2); } else { txtactualpoints.EditValue = 0; } if (_redmipoints != Math.Round(_points/100, 2)) { XtraMessageBox.Show("Customer points has changed", "Re-dim", MessageBoxButtons.OK); } _redmipoints = decimal.Parse(txtactualpoints.EditValue.ToString()); bl.UpdateCustomrePointsInServer(_custno,-_points); Close(); } catch (Exception ex) { XtraMessageBox.Show("Error checking the available points try again", "Re-dim", MessageBoxButtons.OK); _redmipoints = 0; progressPanel1.Visible = false; } } }
void DoSave(string option) { if (ValidateCustomer()) return; var bl = new BlCustomer(); var newrow =(DsMaster.CUSTOMERRow) new DsMaster().CUSTOMER.NewRow(); newrow.CUSTNO = _customerno; newrow.CUSTOMERTYPE = int.Parse(customertype.EditValue.ToString()); newrow.CUSTCOMP = custcomp.Text; newrow.CUSTOMERNAME = customername.Text; newrow.CUSTOMERID = custmobile.Text; newrow.EMAIL = custemail.Text; newrow.PHONE = custphone.Text; newrow.Mobile = custmobile.Text; newrow.NOTE = custnote.Text; newrow.FIXDISC = custfixdisc.Checked; newrow.PAYTYPE = comboBoxEdit1.SelectedIndex; if(customertype.EditValue.ToString() =="0") newrow.MEMBERNO = int.Parse(txtmemno.EditValue.ToString()); if (custfixdiscperc.EditValue!=null) newrow.FIXDISCAMTPER = decimal.Parse(custfixdiscperc.EditValue.ToString()); if (iNSURANCEDISCBindingSource.Count > 0 && customertype.EditValue.ToString() == "1") { bl.InsurancediscDataTable = dsMaster1.INSURANCEDISC; } bl.CustomerRow = newrow; try { var retval = bl.DoSave(); if (retval == "1") { _customerno = bl.Customerno; XtraMessageBox.Show("Data Saved", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information); if (iNSURANCEDISCBindingSource.Count > 0) { //var addedRows = from row in dsMaster1.INSURANCEDISC // where row.RowState == DataRowState.Added select row; //foreach (var row in addedRows.ToArray()) //{row.Delete();} dsMaster1.Merge(COMMON.ClsGetData.GetInsuranceByCust(_customerno)); //dsMaster1.AcceptChanges(); } if(option=="1") {Dispose(); } if (option == "2") {DoNew();} SetNavigation(); } else { XtraMessageBox.Show(retval, "POS", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch(Exception ex) { XtraMessageBox.Show(ex.ToString(), "POS", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void ChkCustomerByMemNo(string memno) { var blc = new BlCustomer(); blc.GetCustomerByMemno(int.Parse(memno)); if (blc.CustomerRow == null) return; customertype.Enabled = true; _customerno = blc.CustomerRow.CUSTNO; customertype.EditValue = blc.CustomerRow.CUSTOMERTYPE; custcomp.Text = blc.CustomerRow.CUSTCOMP; customername.Text = blc.CustomerRow.CUSTOMERNAME; customerid.Text = blc.CustomerRow.CUSTOMERID; custphone.Text = blc.CustomerRow.PHONE; custmobile.Text = blc.CustomerRow.Mobile; custemail.Text = blc.CustomerRow.EMAIL; custnote.Text = blc.CustomerRow.NOTE; custfixdisc.Checked = blc.CustomerRow.FIXDISC; custfixdiscperc.EditValue = blc.CustomerRow.FIXDISCAMTPER; comboBoxEdit1.SelectedIndex = blc.CustomerRow.PAYTYPE; }
public void UpdatePointsDetails(string custno, decimal points, string comp, DateTime dt, string sinv, decimal redimamt) { var bl = new BlCustomer(); bl.UpdatePointsDetails(custno, points, comp,dt,sinv, redimamt); }