public void SendEmailToSupplier(int empid, string body, string subject) { PurchaseOrderBLL pobll = new PurchaseOrderBLL(); EmployeeBLL empbll = new EmployeeBLL(); Employee currentuser = new Employee(); currentuser = empbll.GetEmployeeById(empid); Supplier toSupplier = new Supplier(); toSupplier = supbll.GetSupplierByName(ddlSupplierList.SelectedValue); string bodymsg = "Purchase Order Number: " + poNum + "<br/>" + body + "<br/>With Regards,<br/>" + currentuser.EmployeeName; pobll.SendEmailToSupplier(toSupplier.Email, currentuser.Email, bodymsg, subject); }
public string Createsupplier(string gstregno, string suppliercode, string suppliername, string contactname, string phone, string fax, string Address, string email) { Supplier createsupp = new Supplier(); createsupp.GST_RegNo = gstregno; createsupp.Supplier_Code = suppliercode; createsupp.Supplier_Name = suppliername; createsupp.Contact_Name = contactname; createsupp.Phone = phone; createsupp.Fax = fax; createsupp.Address = Address; createsupp.Email = email; edm.Suppliers.AddObject(createsupp); edm.SaveChanges(); return "Insert successfully"; }
public string UpdateSupplierInfo(Supplier updateSupInfo) { Supplier updateInfo = edm.Suppliers.FirstOrDefault(c => c.Supplier_Code == updateSupInfo.Supplier_Code); if (updateInfo != null) { updateInfo.Supplier_Code = updateSupInfo.Supplier_Code; updateInfo.Supplier_Name = updateSupInfo.Supplier_Name; updateInfo.Phone = updateSupInfo.Phone; updateInfo.Fax = updateSupInfo.Fax; updateInfo.Contact_Name = updateSupInfo.Contact_Name; updateInfo.Address = updateSupInfo.Address; } this.edm.SaveChanges(); string s = "Update is successful"; return s; }
/// <summary> /// Create a new Supplier object. /// </summary> /// <param name="supplier_Code">Initial value of the Supplier_Code property.</param> /// <param name="supplier_Name">Initial value of the Supplier_Name property.</param> /// <param name="contact_Name">Initial value of the Contact_Name property.</param> /// <param name="phone">Initial value of the Phone property.</param> /// <param name="address">Initial value of the Address property.</param> public static Supplier CreateSupplier(global::System.String supplier_Code, global::System.String supplier_Name, global::System.String contact_Name, global::System.String phone, global::System.String address) { Supplier supplier = new Supplier(); supplier.Supplier_Code = supplier_Code; supplier.Supplier_Name = supplier_Name; supplier.Contact_Name = contact_Name; supplier.Phone = phone; supplier.Address = address; return supplier; }
/// <summary> /// Deprecated Method for adding a new object to the Suppliers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSuppliers(Supplier supplier) { base.AddObject("Suppliers", supplier); }