/// <summary> /// this method show a customerFollowup /// </summary> private void ShowCustomerFollowup() { customerManager = new CustomerManager(this); var customerFollowup = customerManager.GetCustomerFollowup(Company.CompanyId, Convert.ToInt32(Page.ViewState["CustomerFollowupId"])); txtContactId.Value = customerFollowup.ContactId.ToString(); var taskManager = new TaskManager(this); var task = taskManager.GetTask(customerFollowup.CustomerFollowupId, "CustomerFollowUp.aspx"); if (task != null) { ucNextMeetingDate.DateTime = task.StartDate; txtAppoitmentSubject.Text = task.Name; } selContact.ShowContact(customerFollowup.Contact); if (customerFollowup.CustomerFollowupActionId.HasValue) cboCustomerFollowupAction.SelectedValue = customerFollowup.CustomerFollowupActionId.ToString(); txtEntryDate.Text = "Data de Entrada:<br/><b>" + customerFollowup.EntryDate.ToString("dd/MM/yyyy") + "</b>"; txtDescription.Text = customerFollowup.Description; Page.ViewState["CustomerId"] = customerFollowup.CustomerId; Page.ViewState["ContactId"] = customerFollowup.ContactId; }
public static void DeleteCustomerFollowup(int customerFollowupId) { using (CustomerManager customerManager = new CustomerManager(null)) { var taskManager = new TaskManager(null); var task = taskManager.GetTask(customerFollowupId, "CustomerFollowUp.aspx"); if (task != null) taskManager.DeleteTask(task); customerManager.DeleteCustomerFollowup(customerManager.GetCustomerFollowup(customerFollowupId)); } }
public static bool SaveCustomerFollowUp(string[] customerFollowUp) { using (var customerManager = new CustomerManager(null)) { var cf = new CustomerFollowup(); var originalCustomerFollowUp = new CustomerFollowup(); if (!String.IsNullOrEmpty(customerFollowUp[8])) { originalCustomerFollowUp = customerManager.GetCustomerFollowup(Convert.ToInt32(customerFollowUp[1]), Convert.ToInt32(customerFollowUp[8])); cf.CopyPropertiesFrom(originalCustomerFollowUp); } cf.ContactId = Convert.ToInt32(customerFollowUp[0]); cf.CompanyId = Convert.ToInt32(customerFollowUp[1]); cf.UserId = Convert.ToInt32(customerFollowUp[2]); cf.Description = customerFollowUp[3].ToString(); if (!String.IsNullOrEmpty(customerFollowUp[4])) cf.CustomerFollowupActionId = Convert.ToInt32(customerFollowUp[4]); if (!String.IsNullOrEmpty(customerFollowUp[8])) { if (!IsAppointment(customerFollowUp)) customerManager.UpdateCustomerFollowup(originalCustomerFollowUp, cf, null, null, null); else customerManager.UpdateCustomerFollowup(originalCustomerFollowUp, cf, Convert.ToInt32(customerFollowUp[9]), Convert.ToDateTime(customerFollowUp[6]), customerFollowUp[10]); } else if (!IsAppointment(customerFollowUp)) customerManager.InsertCustomerFollowup(cf, null, null, null); else customerManager.InsertCustomerFollowup(cf, Convert.ToInt32(customerFollowUp[9]), Convert.ToDateTime(customerFollowUp[6]), customerFollowUp[10]); if (cf.CustomerFollowupId != 0) return true; else return false; } }