public static DataSet Channel_Send_To_DB(Admin_Channel objAdmin_Channel) { try { SqlParameter[] objSqlParameter = new SqlParameter[7]; objSqlParameter[0] = new SqlParameter("@ChannelName", objAdmin_Channel.ChannelName); objSqlParameter[1] = new SqlParameter("@ChannelId", objAdmin_Channel.ChannelId); objSqlParameter[2] = new SqlParameter("@DumpChannelName", objAdmin_Channel.DumpChannelName); objSqlParameter[3] = new SqlParameter("@Isactive", objAdmin_Channel.Isactive); objSqlParameter[4] = new SqlParameter("@CreatedDate", objAdmin_Channel.CreatedDate); objSqlParameter[5] = new SqlParameter("@UserId", objAdmin_Channel.UserId); objSqlParameter[6] = new SqlParameter("@Description", objAdmin_Channel.Description); return(SqlHelper.ExecuteDataSet(con, CommandType.StoredProcedure, "Sp_Admin_Channel", objSqlParameter)); } catch (Exception Ex) { throw Ex; } }
public void Send_Channel_Data(string Channel_Name, int Channel_Id, string DumpChannel_Name, bool Isactive, string Description) { try { if (Channel_Name != "" && Description != "") { if (Session["UserCode"] != null) { Admin_Channel objAdmin_Channel = new Admin_Channel(); objAdmin_Channel.ChannelName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Channel_Name.ToLower()); objAdmin_Channel.ChannelId = Channel_Id; objAdmin_Channel.DumpChannelName = DumpChannel_Name; objAdmin_Channel.Isactive = Isactive; objAdmin_Channel.CreatedDate = DateTime.Now.AddHours(Connection.SetHours); objAdmin_Channel.UserId = Convert.ToInt32(Session["UserId"].ToString()); objAdmin_Channel.Description = Description; DataSet objDataSet = Admin_Channel.Channel_Send_To_DB(objAdmin_Channel); if (objDataSet.Tables[0].Rows[0][0].ToString() == "1") { if (Channel_Id == 0) { ShowNotification("Channel", "Inserted Successfully..", NotificationType.success); txtChannel.Text = ""; txtDescription.Text = ""; Channels_List(gvChannel, "select Channel_Id,Channel_Name,Isactive,Description from tbl_Admin_Channel Order by Channel_Name"); } else { ShowNotification("Channel", "Updated Successfully..", NotificationType.success); Channels_List(gvChannel, "select Channel_Id,Channel_Name,Isactive,Description from tbl_Admin_Channel Order by Channel_Name"); } } else if (objDataSet.Tables[0].Rows[0][0].ToString() == "-5") { ShowNotification("Channel", "Channel Already Existed..!", NotificationType.error); if (Channel_Id == 0) { txtChannel.Focus(); } else { txtUpdateChannel.Focus(); } } else { ShowNotification("Channel", "Not inserted..!", NotificationType.error); } } else { ShowNotification("Channel", "Sorry, Your Session had been Expired.. So Please Logout Once & Login Again..!", NotificationType.error); } } else { ShowNotification("Channel", "Please fill all Fields..!", NotificationType.error); } } catch (Exception Ex) { } }