private void SetUpCustomerProfile() { myAnimator = GetComponent<Animator>(); myRigidBody = GetComponent<Rigidbody2D>(); customerDirector = FindObjectOfType<CustomerDirector>(); myAnimator.runtimeAnimatorController = customerProfile.animatorController; SpriteRenderer sr = GetComponent<SpriteRenderer>(); sr.sprite = customerProfile.customerSprite; }
// Start is called before the first frame update void Start() { shelfManager = FindObjectOfType <ShelfManager>(); customerDirector = FindObjectOfType <CustomerDirector>(); standAreaCollider = standArea.GetComponent <CircleCollider2D>(); if (HeldItem.item != null) { //TODO, rework code so that shelves only hold one item. customerDirector.UnclaimShelf(this); } }
// Start is called before the first frame update void Start() { shelvedItems = new List <ItemInstance>(); CustomerManager = FindObjectOfType <CustomerDirector>(); //For every item in the player inventory, populate the inventory panel with an item button items = playerInventory.GetInventory(); foreach (ItemInstance item in items) { AddNewItemButton(item, playerInventoryPanel); } isShowing = false; ShelfCanvas.SetActive(isShowing); }
// Start is called before the first frame update void Start() { path = GetComponent<CustomerPath>(); customerDirector = FindObjectOfType<CustomerDirector>(); customerTimer = GetComponent<CustomerTimer>(); unclaimedItems = customerDirector.unclaimedItems; IsLeavingChange += IsLeavingHandler; customerStartTime = Time.timeSinceLevelLoad; layerMask = LayerMask.GetMask("Interactable", "Walls", "Player"); Bulletin.gameObject.SetActive(false); pathIndex = 0; SetUpCustomerProfile(); customerID = Guid.NewGuid().ToString(); customerDirector.WaitingCustomers.Add(customerID, this); customerTimer.StartWaitingTimer(); }
void FillCustomerInfo() { try { customerInfo = _customerService.Get(frmMain.customerIdx); customerAccountant = _customerAccountantService.Get(frmMain.customerIdx); customerPurchStaff = _purchasingStaffService.Get(frmMain.customerIdx); customerDirector = _customerDirectorService.Get(frmMain.customerIdx); txtCode.Text = customerInfo.CustomerCode; txtName.Text = customerInfo.CustomerName; txtTaxNo.Text = customerInfo.CustomerTaxNo; txtTaxDepart.Text = customerInfo.CustomerTaxDepartment; cmbEnvoy.EditValue = customerInfo.CustomerEnvoyId; txtAddress.Text = customerInfo.CustomerAddress; chbActive.Checked = customerInfo.CustomerActive; chbAppointment.Checked = customerInfo.CustomerGotAppointment; chbDebate.Checked = customerInfo.CustomerDebated; txtAccountantName.Text = customerAccountant.AccountantName; txtAccountantGsm.Text = customerAccountant.AccountantGsm; txtAccountantMail.Text = customerAccountant.AccountantMail; txtAccountantPhone.Text = customerAccountant.AccountantPhone; dtpAccountantExpiry.EditValue = customerAccountant.AccountantExpiry; txtPurchasingDirector.Text = customerPurchStaff.PurchaseStaffName; txtPurchasingGsm.Text = customerPurchStaff.PurchaseStaffGsm; txtPurchasingMail.Text = customerPurchStaff.PurchaseStaffMail; txtPurchasingPhone.Text = customerPurchStaff.PurchaseStaffPhone; txtDirectorName.Text = customerDirector.DirectorName; txtDirectorTitle.Text = customerDirector.DirectorTitle; txtDirectorGsm.Text = customerDirector.DirectorGsm; txtDirectorMail.Text = customerDirector.DirectorMail; txtDirectorPhone.Text = customerDirector.DirectorPhone; } catch { } }
public void Update(CustomerDirector director) { _customerDirectorDal.Update(director); }
public void Delete(CustomerDirector director) { _customerDirectorDal.Delete(director); }
public void Add(CustomerDirector director) { _customerDirectorDal.Add(director); }
public void UpdateWithTransaction(Customer customer, CustomerAccountant accountant, CustomerDirector director, CustomerPurchasingStaff purchasingStaff) { Update(customer); _customerDirectorService.Update(director); _customerStaffService.Update(purchasingStaff); _customerAccountantService.Update(accountant); }
public void AddWithTransaction(Customer customer, CustomerAccountant accountant, CustomerDirector director, CustomerPurchasingStaff purchasingStaff) { Add(customer); accountant.CustomerId = customer.CustomerId; director.CustomerId = customer.CustomerId; purchasingStaff.CustomerId = customer.CustomerId; _customerAccountantService.Add(accountant); _customerDirectorService.Add(director); _customerStaffService.Add(purchasingStaff); }
private void tbtnSave_ItemClick(object sender, TileItemEventArgs e) { ExceptionHandler.HandleException(() => { if (frmMain.customerIdx != 0) { #region Update var updateCustomer = new Customer { CustomerId = customerInfo.CustomerId, CustomerCode = txtCode.Text, CustomerName = txtName.Text, CustomerTaxNo = txtTaxNo.Text, CustomerTaxDepartment = txtTaxDepart.Text, CustomerAddress = txtAddress.Text, CustomerActive = chbActive.Checked, CustomerDebated = chbDebate.Checked, CustomerGotAppointment = chbAppointment.Checked, CustomerEnvoyId = Convert.ToInt32(cmbEnvoy.EditValue) }; var updateDirector = new CustomerDirector { DirectorId = customerDirector.DirectorId, DirectorName = txtDirectorName.Text, DirectorTitle = txtDirectorTitle.Text, DirectorGsm = txtDirectorGsm.Text, DirectorMail = txtDirectorMail.Text, DirectorPhone = txtDirectorPhone.Text, CustomerId = updateCustomer.CustomerId }; var updatePurchasingStaff = new CustomerPurchasingStaff { PurchaseStaffId = customerPurchStaff.PurchaseStaffId, PurchaseStaffName = txtPurchasingDirector.Text, PurchaseStaffGsm = txtPurchasingGsm.Text, PurchaseStaffMail = txtPurchasingMail.Text, PurchaseStaffPhone = txtPurchasingPhone.Text, CustomerId = updateCustomer.CustomerId }; var updateAccountant = new CustomerAccountant { AccountantId = customerAccountant.AccountantId, CustomerId = updateCustomer.CustomerId, AccountantName = txtAccountantName.Text, AccountantGsm = txtAccountantGsm.Text, AccountantMail = txtAccountantMail.Text, AccountantPhone = txtAccountantPhone.Text, AccountantExpiry = dtpAccountantExpiry.DateTime }; _customerService.UpdateWithTransaction(updateCustomer, updateAccountant, updateDirector, updatePurchasingStaff); FillCustomerInfo(); XtraMessageBox.Show("Güncellendi."); #endregion } else { #region NewRecord var newCustomerRec = new Customer { CustomerCode = txtCode.Text, CustomerName = txtName.Text, CustomerTaxNo = txtTaxNo.Text, CustomerTaxDepartment = txtTaxDepart.Text, CustomerAddress = txtAddress.Text, CustomerActive = chbActive.Checked, CustomerDebated = chbDebate.Checked, CustomerGotAppointment = chbAppointment.Checked, CustomerEnvoyId = Convert.ToInt32(cmbEnvoy.EditValue) }; var newDirectorRec = new CustomerDirector { DirectorName = txtDirectorName.Text, DirectorTitle = txtDirectorTitle.Text, DirectorGsm = txtDirectorGsm.Text, DirectorMail = txtDirectorMail.Text, DirectorPhone = txtDirectorPhone.Text, }; var newPurchasingStaffRec = new CustomerPurchasingStaff { PurchaseStaffName = txtPurchasingDirector.Text, PurchaseStaffGsm = txtPurchasingGsm.Text, PurchaseStaffMail = txtPurchasingMail.Text, PurchaseStaffPhone = txtPurchasingPhone.Text, }; var newAccountantRec = new CustomerAccountant { AccountantName = txtAccountantName.Text, AccountantGsm = txtAccountantGsm.Text, AccountantMail = txtAccountantMail.Text, AccountantPhone = txtAccountantPhone.Text, AccountantExpiry = dtpAccountantExpiry.DateTime }; _customerService.AddWithTransaction(newCustomerRec, newAccountantRec, newDirectorRec, newPurchasingStaffRec); frmMain.customerIdx = newCustomerRec.CustomerId; FillCustomerInfo(); tbarDetails.Visible = true; XtraMessageBox.Show("Başarıyla Oluşturuldu."); #endregion } }); }
public void ImportXl(string path, ICustomerService customerService) { try { string xlConn = string .Format($"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={path};Extended Properties=\"Excel 12.0;HDR=NO;\""); using (OleDbConnection xconn = new OleDbConnection(xlConn)) { OleDbCommand xcmd = new OleDbCommand("select * from [Sayfa1$]", xconn); OleDbDataReader xdr; xconn.Open(); xdr = xcmd.ExecuteReader(); while (xdr.Read()) { importedCustomer = new Customer { CustomerCode = xdr[0].ToString(), CustomerName = xdr[1].ToString(), CustomerTaxNo = xdr[2].ToString(), CustomerTaxDepartment = xdr[3].ToString(), CustomerAddress = xdr[4].ToString() }; importedDirector = new CustomerDirector { CustomerId = importedCustomer.CustomerId, DirectorName = xdr[5].ToString(), DirectorTitle = xdr[6].ToString(), DirectorGsm = xdr[7].ToString(), DirectorMail = xdr[8].ToString(), DirectorPhone = xdr[9].ToString() }; importedStaff = new CustomerPurchasingStaff { CustomerId = importedCustomer.CustomerId, PurchaseStaffName = xdr[10].ToString(), PurchaseStaffGsm = xdr[11].ToString(), PurchaseStaffMail = xdr[12].ToString(), PurchaseStaffPhone = xdr[13].ToString() }; importedAccountant = new CustomerAccountant { CustomerId = importedCustomer.CustomerId, AccountantName = xdr[14].ToString(), AccountantGsm = xdr[15].ToString(), AccountantMail = xdr[16].ToString(), AccountantPhone = xdr[17].ToString(), AccountantExpiry = Convert.ToDateTime(xdr[18], CultureInfo.GetCultureInfo("tr-TR").DateTimeFormat) }; customerService.AddWithTransaction(importedCustomer, importedAccountant, importedDirector, importedStaff); } xconn.Close(); } } catch (Exception exception) { throw new Exception($"Hata {importedCustomer.CustomerName} " + exception.Message + "\r Hatalı kayıt Silindi."); } }