//Insert contact public bool Insert_contact(string name, string email, string title, string content, string address, string phone) { ESHOP_CONTACT add = new ESHOP_CONTACT { CONTACT_NAME = name, CONTACT_EMAIL = email, CONTACT_TITLE = title, CONTACT_CONTENT = content, CONTACT_PUBLISHDATE = DateTime.Now, CONTACT_ADDRESS = address, CONTACT_PHONE = phone, CONTACT_TYPE = 0 }; db.ESHOP_CONTACTs.InsertOnSubmit(add); db.SubmitChanges(); return(true); }
//Insert contact public int Insert_contact(string name, string email, string address, string phone, int areaId, int typeId) { try { ESHOP_CONTACT add = new ESHOP_CONTACT { CONTACT_NAME = name, CONTACT_EMAIL = email, CONTACT_PUBLISHDATE = DateTime.Now, CONTACT_ADDRESS = address, CONTACT_PHONE = phone, AREA_ID = areaId, CONTACT_TYPE = typeId }; db.ESHOP_CONTACTs.InsertOnSubmit(add); db.SubmitChanges(); return(1); } catch { return(0); } }