bool GetBasicFuild(string login) { sandwichPanel = new SandwichPanel(); sandwichPanel.datetimeCreate = DateTime.Now; sandwichPanel.id_AspNetUsersCreate = new Login().LoginEmailToId(login); sandwichPanel.numberOrder = ""; sandwichPanel.onApprove = true; sandwichPanel.onCorrection = false; sandwichPanel.onCustomer = false; sandwichPanel.onGetDateComplited = false; sandwichPanel.onComplited = false; sandwichPanel.remove = false; return(true); }
public EmailSandwichPanel(SandwichPanel order, string login, int stepNumber) { mailToList = new List <string>(); try { this.login = login; this.stepNumber = stepNumber; this.order = db.SandwichPanel .Include(d => d.SandwichPanel_PZ.Select(s => s.PZ_PlanZakaz)) .First(d => d.id == order.id); mail.From = new MailAddress(this.login); if (stepNumber == 1) //Create - 1 { GetMailPM(); GetMailManufacturing(); GetMailMYI(); GetMailKO(); } else if (stepNumber == 2) //ToWork - 2 { GetMailPurchaseDepartment(); GetMailPM(); GetMailMYI(); } else if (stepNumber == 3) //ToUpdate - 3 { GetMailKB(); GetMailPM(); GetMailMYI(); } else if (stepNumber == 4) //ToCustomer - 4 { GetMailCustomer(); GetMailPM(); GetMailMYI(); } else if (stepNumber == 5) //ToGetDateComplited { GetMailPM(); GetMailManufacturing(); GetMailMYI(); } else if (stepNumber == 6) //ToComplited { GetMailPM(); GetMailManufacturing(); GetMailMYI(); } else { GetMailMYI(); } GetSubject(); GetBody(); SendEmail(); logger.Debug("EmailSandwichPanel: " + order.id); } catch (Exception ex) { logger.Error("EmailSandwichPanel: " + order.id + " | " + ex); } }