public int Update(int Category_Id, string CultureCode, int Parent_ID, string Category_Code, string Category_Name, string Category_Link, string CssClass, string Photo, string BriefDescription, string Description, string Status) { string Alias = ModuleClass.convertTitle2Link(Category_Name); SqlCommand cmd = new SqlCommand("[Production].[Product_Categories_Update]", con) { CommandType = CommandType.StoredProcedure, CommandTimeout = Settings.CommandTimeout }; cmd.Parameters.AddWithValue("@CultureCode", CultureCode); cmd.Parameters.AddWithValue("@Category_Id", Category_Id); cmd.Parameters.AddWithValue("@Category_Code", Category_Code); cmd.Parameters.AddWithValue("@Category_Name", Category_Name); cmd.Parameters.AddWithValue("@Category_Link", Category_Link); cmd.Parameters.AddWithValue("@CssClass", CssClass); cmd.Parameters.AddWithValue("@Alias", Alias); cmd.Parameters.AddWithValue("@Parent_ID", Parent_ID); cmd.Parameters.AddWithValue("@Photo", Photo); cmd.Parameters.AddWithValue("@BriefDescription", BriefDescription); cmd.Parameters.AddWithValue("@Description", Description); cmd.Parameters.AddWithValue("@Status", Status); cmd.Parameters.Add(new SqlParameter("@o_return", SqlDbType.Int) { Direction = ParameterDirection.Output }); con.Open(); int i = cmd.ExecuteNonQuery(); int retunvalue = (int)cmd.Parameters["@o_return"].Value; con.Close(); return(retunvalue); }
public int Update(string userid, int portalid, string culturecode, int idx, int parentid, string code, string name, string image, string description, string status) { string alias = ModuleClass.convertTitle2Link(name); SqlCommand cmd = new SqlCommand("[Articles].[sp_ArticleCategories_Update]", con); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandTimeout = Settings.CommandTimeout; cmd.Parameters.AddWithValue("@userid", userid); cmd.Parameters.AddWithValue("@ip", ip); cmd.Parameters.AddWithValue("@portalid", portalid); cmd.Parameters.AddWithValue("@culturecode", culturecode); cmd.Parameters.AddWithValue("@idx", idx); cmd.Parameters.AddWithValue("@code", code); cmd.Parameters.AddWithValue("@name", name); cmd.Parameters.AddWithValue("@alias", alias); cmd.Parameters.AddWithValue("@parentid", parentid); cmd.Parameters.AddWithValue("@image", image).IsNullable = true; cmd.Parameters.AddWithValue("@description", description); cmd.Parameters.AddWithValue("@status", status); cmd.Parameters.Add(new SqlParameter("@o_return", SqlDbType.Int, 2) { Direction = ParameterDirection.Output }); con.Open(); int i = cmd.ExecuteNonQuery(); int retunvalue = (int)cmd.Parameters["@o_return"].Value; con.Close(); return(retunvalue); }
public int Insert(string ApplicationId, string ModuleTitle, bool AllTabs, bool IsAdmin, bool IsDeleted, bool InheritViewPermissions) { string FriendlyName = ModuleClass.convertTitle2Link(ModuleTitle); SqlCommand cmd = new SqlCommand("aspnet_Modules_Add", con) { CommandType = CommandType.StoredProcedure, CommandTimeout = Settings.CommandTimeout }; cmd.Parameters.AddWithValue("@ApplicationId", ApplicationId); cmd.Parameters.AddWithValue("@ModuleTitle", ModuleTitle); cmd.Parameters.AddWithValue("@FriendlyName", FriendlyName); cmd.Parameters.AddWithValue("@AllTabs", AllTabs); cmd.Parameters.AddWithValue("@IsAdmin", IsAdmin); cmd.Parameters.AddWithValue("@IsDeleted", IsDeleted); cmd.Parameters.AddWithValue("@InheritViewPermissions", InheritViewPermissions); cmd.Parameters.Add(new SqlParameter("@o_return", SqlDbType.Int) { Direction = ParameterDirection.Output }); con.Open(); int i = cmd.ExecuteNonQuery(); int retunvalue = (int)cmd.Parameters["@o_return"].Value; con.Close(); return(retunvalue); }
public int Insert(string userid, int portalid, string culturecode, string code, string title, string headline, string abstract_info, string frontimage, string mainimage, string maintext, string source, string navigateurl, string status) { /*** PostedDate ******************************************************************************/ //System.Globalization.CultureInfo customCulture = new System.Globalization.CultureInfo("en-US"); //customCulture.DateTimeFormat.ShortDatePattern = "MM/dd/yyyy"; //customCulture.DateTimeFormat.ShortTimePattern = "HH:mm:ss"; //System.Threading.Thread.CurrentThread.CurrentCulture = customCulture; //System.Threading.Thread.CurrentThread.CurrentUICulture = customCulture; //string PostedDate = System.DateTime.Now.ToString("G"); /*********************************************************************************************/ string alias = ModuleClass.convertTitle2Link(headline); maintext = module_obj.UTF8_Encode(maintext); string tags = module_obj.createTags(headline); SqlCommand cmd = new SqlCommand("[Articles].[sp_Articles_Insert]", con) { CommandType = CommandType.StoredProcedure, CommandTimeout = Settings.CommandTimeout }; cmd.Parameters.AddWithValue("@userid", userid); cmd.Parameters.AddWithValue("@ip", ip); cmd.Parameters.AddWithValue("@portalid", portalid); cmd.Parameters.AddWithValue("@culturecode", culturecode); cmd.Parameters.AddWithValue("@code", code); cmd.Parameters.AddWithValue("@title", title); cmd.Parameters.AddWithValue("@headline", headline); cmd.Parameters.AddWithValue("@alias", alias); cmd.Parameters.AddWithValue("@abstract", abstract_info); cmd.Parameters.AddWithValue("@frontimage", frontimage); cmd.Parameters.AddWithValue("@mainimage", mainimage); cmd.Parameters.AddWithValue("@maintext", maintext); cmd.Parameters.AddWithValue("@tags", tags); cmd.Parameters.AddWithValue("@source", source); cmd.Parameters.AddWithValue("@navigateurl", navigateurl); cmd.Parameters.AddWithValue("@status", status); cmd.Parameters.Add(new SqlParameter("@o_return", SqlDbType.Int) { Direction = ParameterDirection.Output }); con.Open(); int i = cmd.ExecuteNonQuery(); int retunvalue = (int)cmd.Parameters["@o_return"].Value; con.Close(); return(retunvalue); }
private int?AddData() { Gallery_Topic topic_obj = new Gallery_Topic(); topic_obj.ParentId = Convert.ToInt32(ddlTreeNode_Topics.SelectedValue); topic_obj.Gallery_TopicName = txtName.Text; topic_obj.Alias = ModuleClass.convertTitle2Link(txtName.Text); topic_obj.Description = txtDescription.Text; topic_obj.Status = Convert.ToChar(rdlStatus.SelectedValue); topic_obj.PostedDate = System.DateTime.Now; topic_obj.UserLog = System.Guid.Parse(Session["UserId"].ToString()); int?i = GalleryTopic.InsertData(topic_obj); return(i); }
public int Update(string userid, int portalid, string culturecode, int idx, string code, string title, string headline, string abstract_info, string frontimage, string mainimage, string maintext, string source, string navigateurl, string status) { string alias = ModuleClass.convertTitle2Link(headline); maintext = module_obj.UTF8_Encode(maintext); string tags = module_obj.createTags(headline); SqlCommand cmd = new SqlCommand("[Articles].[sp_Articles_Update]", con) { CommandType = CommandType.StoredProcedure, CommandTimeout = Settings.CommandTimeout }; cmd.Parameters.AddWithValue("@userid", userid); cmd.Parameters.AddWithValue("@ip", ip); cmd.Parameters.AddWithValue("@portalid", portalid); cmd.Parameters.AddWithValue("@culturecode", culturecode); cmd.Parameters.AddWithValue("@idx", idx); cmd.Parameters.AddWithValue("@code", code); cmd.Parameters.AddWithValue("@title", title); cmd.Parameters.AddWithValue("@headline", headline); cmd.Parameters.AddWithValue("@alias", alias); cmd.Parameters.AddWithValue("@abstract", abstract_info); cmd.Parameters.AddWithValue("@frontimage", frontimage); cmd.Parameters.AddWithValue("@mainimage", mainimage); cmd.Parameters.AddWithValue("@maintext", maintext); cmd.Parameters.AddWithValue("@tags", tags); cmd.Parameters.AddWithValue("@source", source); cmd.Parameters.AddWithValue("@navigateurl", navigateurl); cmd.Parameters.AddWithValue("@status", status); cmd.Parameters.Add(new SqlParameter("@o_return", SqlDbType.Int) { Direction = ParameterDirection.Output }); con.Open(); int i = cmd.ExecuteNonQuery(); int retunvalue = (int)cmd.Parameters["@o_return"].Value; con.Close(); return(retunvalue); }
public int Update(int Product_Id, string CultureCode, string Product_Code, string Category_Code, int Manufacturer_Id, int VendorId, int Product_TypeId, string Product_Name, string CurrencyCode, string NetPrice, string GrossPrice, int TaxRateId, int DiscountId, int UnitsInStock, int UnitsInAPackage, int UnitsInBox, string Unit, decimal Weight, string UnitOfWeightMeasure, decimal Length, decimal Width, decimal Height, string UnitOfDimensionMeasure, int MinPurchaseQty, int MaxPurchaseQty, string Availability, string StartDate, string EndDate, string PhotoFileName, string ThumbnailPhotoFileName, string Url, string ShortDescription, string Specification, int OnlineTransactionFlag, int Discontinued) { string Alias = ModuleClass.convertTitle2Link(Product_Name); NetPrice = StringHandleClass.RemoveExtraTextWithoutPointOrComma(NetPrice); GrossPrice = StringHandleClass.RemoveExtraTextWithoutPointOrComma(GrossPrice); SqlCommand cmd = new SqlCommand("[Production].[Products_Update]", con) { CommandType = CommandType.StoredProcedure, CommandTimeout = Settings.CommandTimeout }; cmd.Parameters.AddWithValue("@Product_Id", Product_Id); cmd.Parameters.AddWithValue("@CultureCode", CultureCode); cmd.Parameters.AddWithValue("@Product_Code", Product_Code); cmd.Parameters.AddWithValue("@Category_Code", Category_Code); cmd.Parameters.AddWithValue("@Manufacturer_Id", Manufacturer_Id); cmd.Parameters.AddWithValue("@Vendor_Id", VendorId); cmd.Parameters.AddWithValue("@Product_TypeId", Product_TypeId); cmd.Parameters.AddWithValue("@Product_Name", Product_Name); cmd.Parameters.AddWithValue("@Alias", Alias); cmd.Parameters.AddWithValue("@CurrencyCode", CurrencyCode); cmd.Parameters.AddWithValue("@NetPrice", NetPrice); cmd.Parameters.AddWithValue("@GrossPrice", GrossPrice); cmd.Parameters.AddWithValue("@TaxRateId", TaxRateId); cmd.Parameters.AddWithValue("@Discount_Id", DiscountId); cmd.Parameters.AddWithValue("@UnitsInStock", UnitsInStock); cmd.Parameters.AddWithValue("@UnitsInAPackage", UnitsInAPackage); cmd.Parameters.AddWithValue("@UnitsInBox", UnitsInBox); cmd.Parameters.AddWithValue("@Unit", Unit); cmd.Parameters.AddWithValue("@Weight", Weight); cmd.Parameters.AddWithValue("@UnitOfWeightMeasure", UnitOfWeightMeasure); cmd.Parameters.AddWithValue("@Length", Length); cmd.Parameters.AddWithValue("@Width", Width); cmd.Parameters.AddWithValue("@Height", Height); cmd.Parameters.AddWithValue("@UnitOfDimensionMeasure", UnitOfDimensionMeasure); cmd.Parameters.AddWithValue("@MinPurchaseQty", MinPurchaseQty); cmd.Parameters.AddWithValue("@MaxPurchaseQty", MaxPurchaseQty); cmd.Parameters.AddWithValue("@Availability", Availability); cmd.Parameters.AddWithValue("@StartDate", StartDate); cmd.Parameters.AddWithValue("@EndDate", EndDate); cmd.Parameters.AddWithValue("@PhotoFileName", PhotoFileName); cmd.Parameters.AddWithValue("@ThumbnailPhotoFileName", ThumbnailPhotoFileName); cmd.Parameters.AddWithValue("@Url", Url); cmd.Parameters.AddWithValue("@ShortDescription", ShortDescription); cmd.Parameters.AddWithValue("@Specification", Specification); cmd.Parameters.AddWithValue("@OnlineTransactionFlag", OnlineTransactionFlag); cmd.Parameters.AddWithValue("@Discontinued", Discontinued); cmd.Parameters.Add("@o_return", SqlDbType.Int, 2).Direction = ParameterDirection.Output; con.Open(); int i = cmd.ExecuteNonQuery(); int retunvalue = (int)cmd.Parameters["@o_return"].Value; con.Close(); return(retunvalue); }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label lblStatus = (Label)e.Row.FindControl("lblStatus"); if (lblStatus != null) { if (lblStatus.Text == "0") { lblStatus.Text = "InActive"; } else { lblStatus.Text = "Active"; } } string selectedItemId = GridView1.DataKeys[e.Row.RowIndex].Value.ToString(); //============================================================================================================================= string ID = GridView1.DataKeys[e.Row.RowIndex].Value.ToString(); e.Row.Attributes["ondblclick"] = "this.style.background='#BFFF00';ShowEditModal('" + ID + "');"; e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';this.style.color='#9C1E00'"; e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';this.style.color='#454545';"; e.Row.Attributes["onmouseclick"] = "this.style.background='#FFFFFF';"; //============================================================================================================================= CheckBox chkBxSelect = (CheckBox)e.Row.Cells[0].FindControl("chkBxSelect"); CheckBox chkBxHeader = (CheckBox)this.GridView1.HeaderRow.FindControl("chkBxHeader"); HiddenField hdnFldId = (HiddenField)e.Row.Cells[0].FindControl("hdnFldId"); chkBxSelect.Attributes["onclick"] = string.Format("javascript:ChildClick(this,document.getElementById('{0}'),'{1}');", chkBxHeader.ClientID, hdnFldId.Value.Trim()); chkBxSelect.Attributes["onclick"] = string.Format("javascript:ChildClick(this,document.getElementById('{0}'),'{1}');", chkBxHeader.ClientID, hdnFldId.Value.Trim()); try { HyperLink hplGetRowSelected = (HyperLink)e.Row.Cells[0].FindControl("hplGetRowSelected"); if (hplGetRowSelected != null) { if (Request.QueryString.Count > 0) { string strOptions = string.Empty, createdTabId = string.Empty; HiddenField hdnFldAlias = (HiddenField)e.Row.Cells[0].FindControl("hdnFldAlias"); if (selectedItemId != string.Empty) { strOptions += "selectedItemId=" + selectedItemId; } if (hdnFldAlias.Value != string.Empty) { strOptions += "&selectedContent=" + ModuleClass.convertTitle2Link(hdnFldAlias.Value); } if (Request.QueryString["portalId"].ToString() != "" && Request.QueryString["portalId"].ToString() != "") { strOptions += "&portalId=" + Request.QueryString["portalId"].ToString(); } if (Request.QueryString["selectedTabId"].ToString() != "" && Request.QueryString["selectedTabId"].ToString() != "") { strOptions += "&selectedTabId=" + Request.QueryString["selectedTabId"].ToString(); } if (Request.QueryString["contentItemKey"].ToString() != "" && Request.QueryString["contentItemKey"].ToString() != "") { strOptions += "&contentItemKey=" + Request.QueryString["contentItemKey"].ToString(); } if (Request.QueryString["keyWords"].ToString() != "" && Request.QueryString["keyWords"].ToString() != "") { strOptions += "&keyWords=" + Request.QueryString["keyWords"].ToString(); } if (Request.QueryString["createdTabId"] != null && Request.QueryString["createdTabId"].ToString() != string.Empty) { strOptions += "&createdTabId=" + Request.QueryString["CreatedTabId"].ToString(); } if (Request.QueryString["createdTabPath"].ToString() != "" && Request.QueryString["createdTabPath"].ToString() != "") { strOptions += "&createdTabPath=" + Request.QueryString["createdTabPath"].ToString(); } if (Request.QueryString["lang"].ToString() != "" && Request.QueryString["lang"].ToString() != "") { strOptions += "&lang=" + Request.QueryString["lang"].ToString(); } if (Request.QueryString["router"].ToString() != "" && Request.QueryString["router"].ToString() != "") { strOptions += "&router=" + Request.QueryString["router"].ToString(); } hplGetRowSelected.NavigateUrl = "/modules/admin/tabs/admin_front_tab_router_add.aspx?" + strOptions; } } } catch (NoNullAllowedException ex) { ex.ToString(); } } }