public static void AddIntoView_Wechatpwds(string pwd, string wechat_id, string whitchpwd) { if (pwd == null || pwd.Length == 0) { return; } using (HualitongDBDataContext db = new HualitongDBDataContext()) { var hasexistdate = db.users.Single(u => u.wechat_id == wechat_id); if (hasexistdate == null) { AddIntoUsers(wechat_id); hasexistdate = db.users.Single(u => u.wechat_id == wechat_id); } var pwdid = hasexistdate.pwds_id; if (pwdid == 0) { pwds newpwd = new pwds { }; db.pwds.InsertOnSubmit(newpwd); db.SubmitChanges(); pwdid = (from apwd in db.pwds select apwd.pwds_id).Max(); hasexistdate.pwds_id = pwdid; } var pwdt = db.pwds.Single(p => p.pwds_id == pwdid); if (whitchpwd == xhmes) { pwdt.student_num = pwd; } else if (whitchpwd == jwcmes) { pwdt.jw_pwd = pwd; } db.SubmitChanges(); db.Dispose(); } }
partial void Updatepwds(pwds instance);
partial void Deletepwds(pwds instance);
partial void Insertpwds(pwds instance);