/// <summary> /// code to update user profile /// </summary> /// <param name="ids"></param> /// <param name="pin"></param> /// <param name="state"></param> /// <param name="city"></param> /// <param name="address"></param> /// <returns></returns> public static int updateuserprofile(int ids, string state, string city, string address, long pin, DateTime dob, string img) { try { using (var objdata = new HavanadataclassesDataContext()) { tblprofile profile = objdata.tblprofiles.Where(x => x.RegId == ids).FirstOrDefault(); if (profile != null) { profile.State = state; profile.City = city; profile.Address = address; profile.Pin = pin; profile.DOB = dob; profile.Picture = img; } objdata.SubmitChanges(); return(1); } } catch (Exception ex) { throw ex; } }
/// <summary> /// code for user profile updation /// </summary> /// <param name="profile"></param> /// <returns></returns> public static int userprofileinsertion(tblprofile profile) { try { using (var objdata = new HavanadataclassesDataContext()) { profile.Updt = DateTime.Now; profile.Crdt = DateTime.Now; profile.IsActive = false; objdata.tblprofiles.InsertOnSubmit(profile); objdata.SubmitChanges(); return(1); } } catch (Exception ex) { throw ex; } }
/// <summary> /// code to update Profile Picture... /// </summary> /// <param name="ids"></param> /// <param name="img"></param> /// <returns></returns> public static int UpdateProfilePicture(int ids, string img) { try { using (var objdata = new HavanadataclassesDataContext()) { tblprofile pro = objdata.tblprofiles.Where(x => x.RegId == ids).FirstOrDefault(); if (pro != null) { pro.Picture = img ; } objdata.SubmitChanges(); return(1); } } catch (Exception ex) { throw ex; } }
public static int userProfileUpdation(int ids, string state, string city, string address, long pin) { tblprofile profile = new tblprofile(); try { using (var objdata = new HavanadataclassesDataContext()) { profile.Updt = DateTime.Now; profile.State = state; profile.City = city; profile.Address = address; profile.Pin = pin; objdata.SubmitChanges(); return(1); } } catch (Exception ex) { throw ex; } }