/// <summary> /// This method is used to update user profile details. /// </summary> /// <param name="objUserInfo"></param> /// <returns></returns> public static DataTable UpdateCategory(CategoryInfo objCategoryInfo,string ModifiedBy) { try { clsParameterCollection ParameterCollection = new clsParameterCollection(); ParameterCollection.ProcedureName = "BS_UpdateCategory"; ParameterCollection.Add(new clsParameter("@Categoryid", objCategoryInfo.CategoryId)); ParameterCollection.Add(new clsParameter("@CategoryName", objCategoryInfo.CategoryName)); ParameterCollection.Add(new clsParameter("@Desciption", objCategoryInfo.Desciption)); ParameterCollection.Add(new clsParameter("@Password", objCategoryInfo.Password)); ParameterCollection.Add(new clsParameter("@IsActive", objCategoryInfo.IsActive)); ParameterCollection.Add(new clsParameter("@Modifiedby", ModifiedBy.Trim())); ParameterCollection.Add(new clsParameter("@Order", objCategoryInfo.Order)); return DataAccess.ExecuteSpAndGetDataTable(ParameterCollection); } catch (Exception Ex) { if (!Ex.Message.Contains("User Define:")) BL_Exception.WriteLog(Ex); throw Ex; } }
/// <summary> /// This method is used to save user first name and last name. /// </summary> //private void SaveUserProperties(string UserName) //{ // dynamic profile = string.Empty; // profile = ProfileBase.Create(UserName); // profile.FirstName = txtFirstName.Text.Trim() + ","; // profile.LastName = txtLastName.Text.Trim(); // profile.Save(); //} /// <summary> /// This method is used to update user details. /// </summary> private void UpdateCategory(string CategoryId) { try { CategoryInfo categoryInfo = new CategoryInfo(); categoryInfo.CategoryId = Convert.ToInt32(CategoryId); categoryInfo.CategoryName = txtCategoryName.Text.Trim(); categoryInfo.Password = txtPassword.Text.Trim(); categoryInfo.Desciption = txtDesciption.Text.Trim(); categoryInfo.IsActive = (chkIsActive.Checked == true); categoryInfo.Order = Convert.ToInt32(txtOrder.Text.Trim()); BL_CategoryManagement.UpdateCategory(categoryInfo, Session["UserID"].ToString()); AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(this, GetType(), "checkValide", "alert('Category updated successfully!');", true); GetAllCategory(); Reset(); } catch (Exception Ex) { string Message = string.Empty; //if (Ex.Message == "The E-mail supplied is invalid.") // Message = "Unable to update User, Email already registered"; //else // Message = Ex.Message; Message = Ex.Message == "The E-mail supplied is invalid." ? "Unable to update User, Email already registered" : Ex.Message; AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(this, GetType(), "checkValide", "alert('" + Message + "');", true); Reset(); } }