public IActionResult Profile(string profile) { User user = new User(); var files = HttpContext.Request.Form.Files; foreach (var Image in files) { if (Image != null && Image.Length > 0) { var file = Image; //There is an error here var uploads = Path.Combine(_appEnvironment.WebRootPath, "ProfilePhoto"); if (file.Length > 0) { var fileName = Guid.NewGuid().ToString().Replace("-", "") + Path.GetExtension(file.FileName); using (var fileStream = new FileStream(Path.Combine(uploads, fileName), FileMode.Create)) { file.CopyToAsync(fileStream); user = _accountRepository.UpdateProfile(fileName); if (user != null) { ViewBag.Sucess = "Profile Save Successfull..!"; } } } } } Comman data = _accountRepository.GetProfile(Convert.ToInt32(user.Id)); ModelState.Clear(); return(View(data)); }
protected void btnSave_Click(object sender, EventArgs e) { int result = 0; try { if (Valid()) { objTrainingAndDevelopmentBAL = new TrainingAndDevelopmentBAL(); objTrainingAndDevelopmentBAL.TrainingApprovalSave(this.MemberOrgId, ddlFirstLevel.SelectedValue, ddlSecondLevel.SelectedValue, ddlThirdLevel.SelectedValue, hdnHighestEmpId.Value, LoggedInEmpId, out result); if (result > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Training & Development", "showSuccessToast('" + ResourceReader.GetMessage("TrainingAndDevelopment_044") + "');", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "Training & Development", "showErrorToast('" + ResourceReader.GetMessage("TrainingAndDevelopment_045") + "');", true); } } } catch (Exception ex) { Comman.LogException(ex, PAGE_TITLE, Comman.MemberOrgId, true); } }
private List <RoleModel> GetMenuDataFromDB(int model) { FormCollection form = new FormCollection(); int RoleId = model; return(Comman.getAllMenuWhichNotAssignedToTheRole1(Convert.ToInt32(RoleId))); }
public ActionResult GetMenuByRoleId(int RoleId) { List <menu_master> objmenu_master = new List <menu_master>(); objmenu_master = Comman.getAllMenuWhichNotAssignedToTheRole(RoleId); SelectList obgcity = new SelectList(objmenu_master, "m_id", "m_name", 0); ViewBag.ddlMenu = new SelectList(obgcity, "m_id", "m_name"); return(Json(obgcity)); }
public JsonResult Register(UserViewModel user) { var res = new ActionDetails(); var results = new RegistrationValidation().Validate(user); if (!results.IsValid) { return(new JsonContractResult { Data = new ActionDetails { ResponseCode = ResponseCode.ValidationError, Content = Comman.FluantErrorList(results.Errors), Message = "registration is not success", State = false }, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } Mapper.CreateMap <UserViewModel, UserBo>(); var response = userService.RegisterUser(Mapper.Map <UserBo>(user)); Enums.AuthType auth = Enums.AuthType.Anonymas; if (response.ResponseCode == ResponseCode.Success) { Mapper.CreateMap <UserBo, SessionModel>(); SessionConfig.Session = Mapper.Map <SessionModel>((UserBo)response.Content); res = new ActionDetails { ResponseCode = ResponseCode.Success, Content = SessionConfig.Session, Message = "registration is success", State = true }; } else { res = new ActionDetails { ResponseCode = response.ResponseCode, Content = new List <string> { "user deferent domain" }, Message = "registration is not success", State = false }; } return(new JsonContractResult { Data = res, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public IActionResult Profile() { string id = HttpContext.Session.GetString("UserId"); if (id == null) { return(RedirectToAction("Login", "User")); } Comman data = _accountRepository.GetProfile(Convert.ToInt32(id)); return(View(data)); }
// Use this for initialization void Start() { ReqLogin aa = new ReqLogin(); aa.password = "******"; aa.account = "lxb"; byte[] myByte = Comman.Serialize <ReqLogin> (aa); ReqLogin bb = Comman.DeSerialize <ReqLogin> (myByte); Debug.Log(bb.account); Debug.Log(bb.password); }
protected void Page_Load(object sender, EventArgs e) { if (Comman.GetSessionValue("SessionRollStudent") != null) { Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60)) + ";URL=../SessionTimeout.aspx"); _lsttbl = Comman.GetSessionValue("SessionRollStudent") as tbl_StudentProfile; lbluseremail.Text = _lsttbl.EmailID.ToString(); lblstunamefull.Text = _lsttbl.FirstName.ToString() + " " + _lsttbl.LastName.ToString(); imgstupic.Src = "~/PhotoUploads/" + _lsttbl.PhotoPath.ToString() + ""; } else { Response.Redirect("../SessionTimeout.aspx"); } }
public JsonResult LoadPhysiansByDepartment(string deptId) { List <menu_master> objmenu_master = new List <menu_master>(); objmenu_master = Comman.getAllMenuWhichNotAssignedToTheRole(Convert.ToInt32(deptId)); //Your Code For Getting Physicans Goes Here // var phyList = this.GetPhysicans(Convert.ToInt32(deptId)); var phyData = objmenu_master.Select(m => new SelectListItem() { Text = m.m_name, Value = m.m_id.ToString(), }); return(Json(phyData, JsonRequestBehavior.AllowGet)); }
// GET: NOCModule public ActionResult Index(NOCModel model) { if (model == null) { model = new NOCModel(); } try { Masters repo = new Masters(); List <Task> tasks = new List <Task>(); tasks.Add(Task.Factory.StartNew(() => { TempData["FixedLandNocTypeList"] = repo.FixedLandNocTypeList().Data.Select(i => new SelectListItem() { Text = i.Value, Value = i.Key }); })); tasks.Add(Task.Factory.StartNew(() => { TempData["FixedLandPermissionTypesList"] = repo.FixedLandPermissionTypesList(null).Data.Select(i => new SelectListItem() { Text = i.Value, Value = i.Key }); })); tasks.Add(Task.Factory.StartNew(() => { TempData["ApplicantType"] = Comman.GetApplicantType(); })); tasks.Add(Task.Factory.StartNew(() => { model.PlantDetail = repo.GetPlantList().Data.Select(i => new PlantDetails { ID = Convert.ToInt32(i.Value), PlantName = i.Key }).ToList(); TempData["PlantDetail"] = model.PlantDetail; })); Task.WaitAll(tasks.ToArray()); } catch (Exception ex) { } return(View(model)); }
public Comman GetProfile(int id) { User user = _context.Users.Where(a => a.Id == id).FirstOrDefault(); ProfilesPictureGallery profilesPicture = _context.ProfilesPictureGalleries.Where(a => a.Id == user.ProfilePictureId && a.DateDeleted == null).FirstOrDefault(); Comman comman = new Comman(); comman.Id = user.Id; comman.First_Name = user.First_Name; comman.Last_Name = user.Last_Name; comman.Email = user.Email; comman.ProfilePictureId = user.ProfilePictureId; if (profilesPicture != null) { comman.PictureName = profilesPicture.Picture; } else { comman.PictureName = "blank-profile-picture-973460_1280.png"; } return(comman); }
public string AddNewStockItem(ItemsVM objItem) { para = new SqlParameter[] { new SqlParameter("@MainCategoryID", objItem.MainCategoryID), new SqlParameter("@SubCategoryID", objItem.SubCategoryID), new SqlParameter("@MeasureUnitID", objItem.MeasureUnitID), new SqlParameter("@DetailValues", Comman.ConvertList(objItem.DetailValues)) }; int i = obj.InsertInTo("spAddNewStockItem", para); string msg = string.Empty; if (i > 0) { msg = "Item Added Succesfullylllll"; } else { msg = "ItemNotAdded"; } return(msg); }
public Comman CurrentUserPicture() { string Id = _session.GetString("UserId"); int userid = Convert.ToInt32(Id); var user = _context.Users.Where(a => a.Id == userid).FirstOrDefault(); string currentprofile = _context.ProfilesPictureGalleries.Where(a => a.Id == user.ProfilePictureId && a.DateDeleted == null).Select(a => a.Picture).FirstOrDefault(); if (currentprofile == null) { currentprofile = "blank-profile-picture-973460_1280.png"; } Comman comman = new Comman() { First_Name = user.First_Name, Last_Name = user.Last_Name, Email = user.Email, Id = user.Id, currentProfile = currentprofile, }; return(comman); }
public IActionResult UserProfile(int id) { Comman data = _accountRepository.GetProfile(id); return(View(data)); }