protected new void CreateMasterCode() { var product = Repository<Product>.FindFirst(); var masterCode = new MasterCode(product, "MCODE", "마스터코드1") {Name = "MCODE", Description = "설명입니다."}; masterCode.AddLocale(new CultureInfo("en"), new MasterCodeLocale {Name = "MCODE"}); masterCode.AddLocale(new CultureInfo("ko"), new MasterCodeLocale {Name = "마스터코드"}); Repository<MasterCode>.SaveOrUpdate(masterCode); }
/// <summary> /// 새로운 MasterCode를 생성합니다. /// </summary> /// <param name="product">제품</param> /// <param name="code">MasterCode의 코드</param> /// <param name="name">MasterCode의 Name</param> /// <param name="isActive">사용여부</param> /// <param name="description">설명</param> /// <param name="exAttr">확장속성</param> /// <returns>새로 생성된 MasterCode</returns> public MasterCode CreateMasterCode(Product product, string code, string name, bool? isActive, string description, string exAttr) { product.ShouldNotBeNull("product"); code.ShouldNotBeWhiteSpace("code"); if(IsDebugEnabled) log.Debug(@"새로운 MasterCode를 생성합니다... " + @"product={0}, code={1}, name={2}, isActive={3}, description={4}, exAttr={5}", product, code, name, isActive, description, exAttr); var masterCode = new MasterCode(product, code, name) { IsActive = isActive, Description = description, ExAttr = exAttr }; return Repository<MasterCode>.SaveOrUpdate(masterCode); }
/// <summary> /// 새로운 MasterCodeItem을 생성합니다. /// </summary> /// <param name="masterCode">MasterCode 인스턴스</param> /// <param name="itemCode">Item Code</param> /// <param name="itemValue">Item Value (값)</param> /// <returns>새로운 <see cref="MasterCodeItem"/></returns> public MasterCodeItem CreateMasterCodeItem(MasterCode masterCode, string itemCode, string itemValue) { return CreateMasterCodeItem(masterCode, itemCode, itemCode, itemValue); }
/// <summary> /// 새로운 MasterCodeItem을 생성합니다. /// </summary> /// <param name="masterCode">MasterCode 인스턴스</param> /// <param name="itemCode">Item Code</param> /// <param name="itemName">Item Name (표시명)</param> /// <param name="itemValue">Item Value (값)</param> /// <param name="viewOrder">정렬 순서</param> /// <returns>새로운 <see cref="MasterCodeItem"/></returns> public MasterCodeItem CreateMasterCodeItem(MasterCode masterCode, string itemCode, string itemName, string itemValue, int? viewOrder) { masterCode.ShouldNotBeNull("masterCode"); itemCode.ShouldNotBeWhiteSpace("itemCode"); if(IsDebugEnabled) log.Debug(@"새로운 MasterCodeItem을 생성합니다... masterCode={0}, itemCode={1}, itemName={2}, itemValue={3}, viewOrder={4}", masterCode, itemCode, itemName, itemValue, viewOrder); var codeItem = new MasterCodeItem(masterCode, itemCode, itemName, itemValue) { ViewOrder = viewOrder }; masterCode.Items.Add(codeItem); // UnitOfWork.CurrentSession.SaveOrUpdate(masterCode); // 정렬 순서를 넣는다. if(viewOrder.HasValue == false) codeItem.ViewOrder = Math.Max(0, masterCode.Items.Count - 1); return Repository<MasterCodeItem>.SaveOrUpdate(codeItem); }
public void Display_Film(string ShortFilmId) { try { string LoadURL = ""; //string url = Request.Url.AbsoluteUri; //string[] Split = url.Split('%'); //Display_List(lstComments, "Select Comments_Id,Name,Message from tbl_Comments where Isactive='True' and ShortFilm_Id=" + Split[Split.Length - 2].Substring(2) + " Order by Comments_Id desc"); //DataSet objLike = MasterCode.RetrieveQuery("Select COUNT(*) from tbl_Like where ShortFilm_Id=" + Split[Split.Length - 2].Substring(2)); //lblDisplayLikes.Text = objLike.Tables[0].Rows[0][0].ToString() + " Like"; DataSet objDataSetBudget = MasterCode.RetrieveQuery("Select User_Budget from tbl_Register_User where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + ")"); if (objDataSetBudget.Tables[0].Rows.Count > 0) { if (Convert.ToDecimal(objDataSetBudget.Tables[0].Rows[0][0].ToString()) != 0) { if (ShortFilmId != "") { DataSet objDataSet = MasterCode.RetrieveQuery("select Short_film_Id,Title,'../Videos/'+Video as Shortfilm,CONVERT(varchar(12),CreatedDate,100)as Publish,Description,Visits from tbl_Short_film where Short_film_Id=" + ShortFilmId); if (objDataSet.Tables[0].Rows.Count > 0) { lblTitle.Text = objDataSet.Tables[0].Rows[0]["Title"].ToString(); LoadURL = objDataSet.Tables[0].Rows[0]["Shortfilm"].ToString(); add.InnerHtml = "<video id='Video' height='376px' width='100%' controls onclick='Play_Pause()'><source src='" + objDataSet.Tables[0].Rows[0]["Shortfilm"].ToString() + "' type='video/mp4'>"; id.Attributes.Add("data-href", "http://www.nscreens.com/Admin/frmSingle.aspx?shortfilm=" + ShortFilmId); Display_List(lstMostLiked, "Select top 4 Short_film_Id,Title,Hero,Video,Visits,'frmSingle.aspx?shortfilm='+cast(Short_film_Id as varchar(max)) as shortfilm,'../Video_Images/'+Short_film_Image as Short_film_Image,RIGHT(CONVERT(CHAR(8),DATEADD(second,Duration,0),108),5)as Duration from tbl_Short_film where Isactive='True' and Status='Approve' and Channel in (Select Channel from tbl_Short_film where Short_film_Id=" + ShortFilmId + ") order by Short_film_Id desc "); //// Video.Attributes.Add("src", objDataSet.Tables[0].Rows[0]["Shortfilm"].ToString()); lblPublished.Text = objDataSet.Tables[0].Rows[0]["Publish"].ToString(); lblDescription.Text = objDataSet.Tables[0].Rows[0]["Description"].ToString(); lblViews.Text = objDataSet.Tables[0].Rows[0]["Visits"].ToString(); //DataSet objDataSetGetBudget = MasterCode.RetrieveQuery("Select Short_Film,Admin,Promoter from tbl_Budget_Settings where Budget_Settings_Id in (Select case when PromoCode IS NULL then 2 else 1 end from tbl_Register_User where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + "))"); //if (objDataSetGetBudget.Tables[0].Rows.Count > 0) // objDataSetGetBudget = MasterCode.RetrieveQuery("insert into tbl_Budget(User_Budget,Promoter_Budget,Admin_Budget,Short_Film_Id,CreatedDate,CreatedById) values(" + objDataSetGetBudget.Tables[0].Rows[0]["Short_Film"] + "," + objDataSetGetBudget.Tables[0].Rows[0]["Promoter"] + "," + objDataSetGetBudget.Tables[0].Rows[0]["Admin"] + "," + ShortFilmId + ",'" + DateTime.Now.AddHours(Connection.SetHours).ToShortDateString() + "'," + Session["UserId"].ToString() + ")"); //DataSet objDataSetUp = MasterCode.RetrieveQuery("update tbl_Short_film set Visits=Visits+1 where Short_film_Id=" + ShortFilmId); //DataSet objDataSetMinBud = MasterCode.RetrieveQuery("update tbl_Register_User set User_Budget=User_Budget-(Select Budget from tbl_Budget_Settings where Budget_Settings_Id=2) where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + ")"); //DataSet objDataSet2 = MasterCode.RetrieveQuery("Select User_Budget from tbl_Register_User where Isactive='True' and Register_Id in (select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + ")"); //if (objDataSet2.Tables[0].Rows.Count > 0) // this.Master.Amount = objDataSet2.Tables[0].Rows[0][0].ToString(); ////btnPlay.Enabled = false; } } else { Display_Add(ShortFilmId); } } else { Display_Add(ShortFilmId); } } else { Display_Add(ShortFilmId); } } catch (Exception Ex) { } }
protected virtual void CreateMasterCode() { var products = NAccessContext.Domains.ProductRepository.FindAllActiveProduct(); foreach(var product in products) { foreach(var masterCodeCode in SampleData.GetCodes("MASTER_CODE_", SampleData.AvgSampleCount)) { var code = new MasterCode(product, masterCodeCode, masterCodeCode) { Description = "MasterCode " + masterCodeCode }; int viewOrder = 0; foreach(var itemCode in SampleData.GetCodes("CODE_ITEM_CODE_", SampleData.MaxSampleCount)) { var item = new MasterCodeItem(code, itemCode, itemCode, itemCode) { Description = "MasterCodeItem " + itemCode, ViewOrder = viewOrder }; code.Items.Add(item); //Console.WriteLine("Item[{0}] HashCode=[{1}]", item.Code, item.GetHashCode()); viewOrder++; } Assert.AreEqual(viewOrder, code.Items.Count); Repository<MasterCode>.SaveOrUpdate(code); } } UnitOfWork.Current.TransactionalFlush(); }
protected void gvShortFilm_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName.Equals("detail")) { ViewState["Artist"] = null; int index = Convert.ToInt32(e.CommandArgument); DataSet objDataSet = MasterCode.RetrieveQuery("SELECT Short_film_Id,Title,Tag,Category,Language,Channel,Description,Status,Video,CreatedDate,CreatedById,ModifiedDate,ModifiedById,Isactive,Visits,ShortIds,Short_film_Image FROM tbl_Short_film where Short_film_Id=" + (gvShortFilm.Rows[index].FindControl("lblGridAdvertisement_Id") as Label).Text); if (objDataSet.Tables[0].Rows.Count > 0) { DataSet objDataSetArtist = MasterCode.RetrieveQuery("Select Short_Artist_Id,Artist_Id,(Select Artist_Name from tbl_admin_Artist AA where AA.Artist_Id=SA.Artist_Id)as Artist,Name from tbl_Short_Artist SA where Isactive='true' and Short_Film_Id=" + objDataSet.Tables[0].Rows[0]["Short_film_Id"].ToString()); if (objDataSetArtist.Tables[0].Rows.Count > 0) { if (ViewState["Artist"] == null) { objDataTable.Columns.Add("Id", typeof(Int32)); objDataTable.Columns.Add("ArtistId", typeof(Int32)); objDataTable.Columns.Add("Artist", typeof(String)); objDataTable.Columns.Add("Name", typeof(String)); objDataTable.Columns["Id"].AutoIncrementSeed = 1; objDataTable.Columns["Id"].AutoIncrement = true; } else { objDataTable = (DataTable)ViewState["Artist"]; } for (int i = 0; i < objDataSetArtist.Tables[0].Rows.Count; i++) { DataRow objDataRow = objDataTable.NewRow(); objDataRow["ArtistId"] = objDataSetArtist.Tables[0].Rows[i]["Artist_Id"].ToString(); objDataRow["Artist"] = objDataSetArtist.Tables[0].Rows[i]["Artist"].ToString(); objDataRow["Name"] = objDataSetArtist.Tables[0].Rows[i]["Name"].ToString(); objDataTable.Rows.Add(objDataRow); } ViewState["Artist"] = objDataTable; gvArtist.DataSource = (DataTable)ViewState["Artist"]; gvArtist.DataBind(); } else { DropDownList((gvArtist.FooterRow.FindControl("ddlArtist") as DropDownList), "Artist_Id", "Artist_Name", "Select Artist_Id,Artist_Name from tbl_admin_Artist where Isactive='True' Order by Artist_Name", "Select"); } lblShortFilmId.Text = objDataSet.Tables[0].Rows[0]["Short_film_Id"].ToString(); txtTitle.Text = objDataSet.Tables[0].Rows[0]["Title"].ToString(); ddlLanguage.ClearSelection(); if (ddlLanguage.Items.FindByValue(objDataSet.Tables[0].Rows[0]["Language"].ToString()) != null) { ddlLanguage.Items.FindByValue(objDataSet.Tables[0].Rows[0]["Language"].ToString()).Selected = true; } txtDescription.Text = objDataSet.Tables[0].Rows[0]["Description"].ToString(); txtTag.Text = objDataSet.Tables[0].Rows[0]["Tag"].ToString(); ddlCategory.ClearSelection(); if (ddlCategory.Items.FindByValue(objDataSet.Tables[0].Rows[0]["Category"].ToString()) != null) { ddlCategory.Items.FindByValue(objDataSet.Tables[0].Rows[0]["Category"].ToString()).Selected = true; } ddlChannel.ClearSelection(); if (ddlChannel.Items.FindByValue(objDataSet.Tables[0].Rows[0]["Channel"].ToString()) != null) { ddlChannel.Items.FindByValue(objDataSet.Tables[0].Rows[0]["Channel"].ToString()).Selected = true; } DropDownList((gvArtist.FooterRow.FindControl("ddlArtist") as DropDownList), "Artist_Id", "Artist_Name", "Select Artist_Id,Artist_Name from tbl_admin_Artist where Isactive='True' Order by Artist_Name", "Select"); txtDescription.Focus(); } } } catch (Exception Ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { DataSet objDataSet = MasterCode.ExcuteOneParameter(DateTime.Now.AddHours(Connection.SetHours).ToShortDateString(), "Sp_Home", DateTime.Now.AddHours(Connection.SetHours).AddDays(1).ToShortDateString()); if (objDataSet.Tables[0].Rows.Count > 0) { lblTotalBuses.Text = objDataSet.Tables[0].Rows[0][0].ToString(); lblRunningBuses.Text = objDataSet.Tables[2].Rows[0][0].ToString(); lblVacantBuses.Text = objDataSet.Tables[1].Rows[0][0].ToString(); lblHoldedBuses.Text = objDataSet.Tables[3].Rows[0][0].ToString(); if (objDataSet.Tables[4].Rows.Count > 5) { pnlRelesing.ScrollBars.Equals("Vertical"); } if (objDataSet.Tables[5].Rows.Count > 5) { pnlBilling.ScrollBars.Equals("Vertical"); } if (objDataSet.Tables[6].Rows.Count > 5) { pnlGoing.ScrollBars.Equals("Vertical"); } if (objDataSet.Tables[6].Rows.Count > 5) { pnlPending.ScrollBars.Equals("Vertical"); } if (objDataSet.Tables[7].Rows.Count > 5) { pnlPendingQuotations.ScrollBars.Equals("Vertical"); } gvNewBus.DataSource = objDataSet.Tables[4]; gvNewBus.DataBind(); gvQuotation.DataSource = objDataSet.Tables[5]; gvQuotation.DataBind(); gvVendors.DataSource = objDataSet.Tables[6]; gvVendors.DataBind(); gvPendingWork.DataSource = objDataSet.Tables[8]; gvPendingWork.DataBind(); gvPendingQuotations.DataSource = objDataSet.Tables[7]; gvPendingQuotations.DataBind(); gvunallocateQuotations.DataSource = objDataSet.Tables[9]; gvunallocateQuotations.DataBind(); } } } catch (Exception Ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { String myUrl = Request.RawUrl.ToString(); var result = Path.GetFileName(myUrl); String Folder = Path.GetDirectoryName(myUrl); string[] SplitOffer = Folder.Split('\\'); for (int i = 0; i < SplitOffer.Length; i++) { if (i == 1) { Master.master_lblUrl = "../" + SplitOffer[i] + "/" + result; } } DropDownList(ddloperator, "OperatorCode", "OperatorName", "Select OperatorCode,OperatorName from tbl_operator where Isactive='true' and RechargeType='Prepaid' Order by OperatorName", "Select"); decimal WalletAmt = 0; DataSet objDataSetE = MasterCode.RetrieveQuery("Select EarningAmt from tbl_Register_User where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + ")"); if (objDataSetE.Tables[0].Rows.Count > 0) { WalletAmt = Convert.ToDecimal(objDataSetE.Tables[0].Rows[0][0].ToString()); } else { WalletAmt = 0; } txtEarningAmt.Text = WalletAmt.ToString(); lblDumpEarningAmt.Text = WalletAmt.ToString(); Districts_List1(gdvHistory, "SELECT R.ID,convert(varchar(10),Date,100)as Date,MobileNo,Amount,Code,OperatorName,R.CreatedDate,R.CreatedById,R.ModifiedDate,R.ModifiedById,R.Isactive,Status,PrevBalance,Balance,ResponseCode,ClientTXT,Area FROM Request R join tbl_operator O on R.Code=O.OperatorCode where R.Isactive='true' order by R.ID"); Districts_List1(gdvoffers, "SELECT top 20 Offer_Id,Area,Operator_Code,OperatorName,O.RechargeType,Amount,TT_Type,Days,Description,O.CreatedDate,O.CreatedById,O.ModifiedDate,O.ModifiedById,O.Isactive FROM tbl_offers O join tbl_operator T on O.Operator_Code=T.OperatorCode where O.Isactive='true' order by Offer_Id"); Districts_List1(gdvTran, "Select t.Id,Form_Name as Page,PageType,Transaction_Id,Debit,Credit,convert(varchar(20),CreatedDate,100) as Date from tbl_transactions t JOIN tbl_page P on P.Id=t.Page_Id and CreatedById=" + Session["UserId"].ToString() + " order by Id desc"); //string ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; //if (string.IsNullOrEmpty(ipAddress)) //{ // ipAddress = Request.ServerVariables["REMOTE_ADDR"]; //} //string APIKey = "81dce31671738f9a3fdf05ee98c9a869dc78242e9603381233b3e663f0fcca3d"; //string url = string.Format("http://api.ipinfodb.com/v3/ip-city/?key={0}&ip={1}&format=json", APIKey, ipAddress); //using (WebClient client = new WebClient()) //{ // string json = client.DownloadString(url); // Location location = new JavaScriptSerializer().Deserialize<Location>(json); // DataSet objDataSet = MasterCode.RetrieveQuery("Select City_Id from tbl_admin_city where City_Name='" + location.CityName + "'"); // if (objDataSet.Tables[0].Rows.Count > 0) // CityId = objDataSet.Tables[0].Rows[0][0].ToString(); // //List<Location> locations = new List<Location>(); // //locations.Add(location); // //gvLocation.DataSource = locations; // //gvLocation.DataBind(); //} //Display_List(lstRecentVideos, "Select Advertisement_Id,Title,Video,Visits,'frmSingle.aspx?/'+cast(Advertisement_Id as varchar(max))+'/shortfilm' as shortfilm,'../Video_Images/'+Advertisement_Image as Short_film_Image from tbl_Advertisement where Isactive='True' and Status='Approve' and City_Id Like '%" + CityId + "%' Order by Advertisement_Id desc"); string Gender = "", DOB = ""; string CityId = ""; DataSet objDataSet = MasterCode.RetrieveQuery("Select Gender,DATEDIFF(hour,DOB,GETDATE())/8766 AS AgeYearsIntTrunc,City_Id from tbl_Register_User R join tbl_user U on R.Register_Id=U.Staff_Id where U.Username='******'"); if (objDataSet.Tables[0].Rows.Count > 0) { Gender = objDataSet.Tables[0].Rows[0][0].ToString(); DOB = objDataSet.Tables[0].Rows[0][1].ToString(); CityId = objDataSet.Tables[0].Rows[0][2].ToString(); } string ShortId = Request.QueryString["shortfilm"]; //if (ShortId != null) // Display_List(ShortId, lstRecentVideos, "Select Advertisement_Id,Title,Video,Visits,'frmSingle.aspx?Advertisement='+cast(Advertisement_Id as varchar(max))+'&shortfilm=" + ShortId + "' as shortfilm,'../Video_Images/'+Advertisement_Image as Short_film_Image,Description from tbl_Advertisement where Isactive='True' and Status='Approve' and Gender in ('ALL','" + Gender + "') and " + DOB + " >= Agefrom and " + DOB + " <= Ageto and NoofVisits>Visits and EndDate>'" + DateTime.Now.AddHours(Connection.SetHours).ToString("yyyy-MM-dd") + "' and StartDate<='" + DateTime.Now.AddHours(Connection.SetHours).ToString("yyyy-MM-dd") + "' and ShortFilmId Like '%," + ShortId + ",%' Order by Advertisement_Id desc"); //else // ShowNotification("Advertisement", "Please Select any Short Film..!", NotificationType.error); if (ShortId == null) { Display_List(ShortId, lstRecentVideos, "Select Advertisement_Id,Title,Video,Visits,'frmSingle.aspx?Advertisement='+cast(Advertisement_Id as varchar(max))+'&shortfilm=" + ShortId + "' as shortfilm,'../Video_Images/'+Advertisement_Image as Short_film_Image,Description from tbl_Advertisement where Isactive='True' and Status='Approve' and City_Id Like '%" + CityId + "%' and Gender in ('ALL','" + Gender + "') and " + DOB + " >= Agefrom and " + DOB + " <= Ageto and NoofVisits>Visits and EndDate>'" + DateTime.Now.AddHours(Connection.SetHours).ToString("yyyy-MM-dd") + "' and StartDate<='" + DateTime.Now.AddHours(Connection.SetHours).ToString("yyyy-MM-dd") + "' and Advertisement_Id not in (select Advertisement_Id from tbl_Advertizment_Visits where User_Id=" + Session["UserId"].ToString() + ") Order by Advertisement_Id desc"); } else { ShowNotification("Advertisement", "Your wallet amount is not sufficient,Do any of the below processes to refill the wallet", NotificationType.success); Display_List(ShortId, lstRecentVideos, "Select Advertisement_Id,Title,Video,Visits,'frmSingle.aspx?Advertisement='+cast(Advertisement_Id as varchar(max))+'&shortfilm=" + ShortId + "' as shortfilm,'../Video_Images/'+Advertisement_Image as Short_film_Image,Description from tbl_Advertisement where Isactive='True' and Status='Approve' and City_Id Like '%" + CityId + "%' and Gender in ('ALL','" + Gender + "') and " + DOB + " >= Agefrom and " + DOB + " <= Ageto and NoofVisits>Visits and EndDate>'" + DateTime.Now.AddHours(Connection.SetHours).ToString("yyyy-MM-dd") + "' and StartDate<='" + DateTime.Now.AddHours(Connection.SetHours).ToString("yyyy-MM-dd") + "' and ShortFilmId Like '%," + ShortId + ",%' and Advertisement_Id not in (select Advertisement_Id from tbl_Advertizment_Visits where User_Id=" + Session["UserId"].ToString() + ") Order by Advertisement_Id desc"); } } } catch (Exception Ex) { } }
protected void btnTransfer_Click(object sender, EventArgs e) { try { if (txtTransferAmount.Text.Trim() != "") { if (Convert.ToDecimal(txtTransferAmount.Text.Trim()) <= Convert.ToDecimal(lblDumpEarningAmt.Text.Trim())) { DataSet objDataSet = MasterCode.ExcuteOneParameter(txtTransferAmount.Text.Trim(), "Sp_Amount_Transfer", Session["UserId"].ToString()); if (objDataSet.Tables[0].Rows[0][0].ToString() == "1") { Master.Amount = (Convert.ToDecimal(Master.Amount) + Convert.ToDecimal(txtTransferAmount.Text)).ToString(); txtTransferAmount.Text = ""; //DataSet objDataSet = MasterCode.RetrieveQuery("Update tbl_Register_User set User_Budget="+txtTransferAmount.Text.Trim()+" where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"] + ")"); ShowNotification("Amount Transfer", "Amount Transfer Successfully..", NotificationType.success); decimal WalletAmt = 0; DataSet objDataSetE = MasterCode.RetrieveQuery("Select EarningAmt from tbl_Register_User where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + ")"); if (objDataSetE.Tables[0].Rows.Count > 0) { WalletAmt = Convert.ToDecimal(objDataSetE.Tables[0].Rows[0][0].ToString()); } else { WalletAmt = 0; } Master.EarningAmount = "( " + WalletAmt.ToString() + " )"; txtEarningAmt.Text = WalletAmt.ToString(); lblDumpEarningAmt.Text = WalletAmt.ToString(); string Short = Request.QueryString["shortfilm"]; string ShrUserId = Request.QueryString["userId"]; if (Short != null) { if (ShrUserId == null) { Response.Redirect("frmSingle.aspx?shortfilm=" + Short, false); } else { Response.Redirect("frmSingle.aspx?shortfilm=" + Short + "&userId=" + ShrUserId, false); } } } } else { ShowNotification("Amount Transfer", "Invalid Amount..", NotificationType.error); } } else { ShowNotification("Amount Transfer", "Please Enter Transfer Amount..", NotificationType.error); } } catch (Exception Ex) { } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { if (txtOldPassword.Text != "" && txtNewPassword.Text != "" && txtConfirmPassword.Text != "") { if (Session["Username"] != null) { if (txtNewPassword.Text.Trim().Length >= 5) { if (txtNewPassword.Text == txtConfirmPassword.Text) { string UserName = Session["Username"].ToString(); SqlCommand cmd = new SqlCommand("Sp_Login_ChangePassword", con); con.Open(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@OldPassword", SqlDbType.VarChar)).Value = txtOldPassword.Text; cmd.Parameters.Add(new SqlParameter("@NewPassword", SqlDbType.VarChar)).Value = txtNewPassword.Text.Trim(); cmd.Parameters.Add(new SqlParameter("@Username", SqlDbType.VarChar)).Value = Session["Username"].ToString(); cmd.Parameters.Add(new SqlParameter("@Id", SqlDbType.Int)).Value = 1; SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0][0].ToString() == "1") { DataSet objDataSet = MasterCode.RetrieveQuery("select Password,(select EmailId from tbl_Register_User UR where UR.Register_Id=U.Staff_Id)as EmailId,(select Name from tbl_Register_User UR where UR.Register_Id=U.Staff_Id)as Name,(select Mobile_No from tbl_Register_User UR where UR.Register_Id=U.Staff_Id)as Mobile_No from tbl_user U where UserName='******'"); if (objDataSet.Tables[0].Rows.Count > 0) { DataSet objDataSetChk = MasterCode.RetrieveQuery("Select Email,SMS from tbl_Settings where Form_Settings='ChgPass'"); if (objDataSetChk.Tables[0].Rows[0]["Email"].ToString() == "True") { //string Body = "<span style='color: Navy'>G'day " + objDataSet.Tables[0].Rows[0]["Name"].ToString() + ",</span><br /><span style='color: DarkGreen'><br />Your User Name : " + objDataSet.Tables[0].Rows[0]["EmailId"].ToString() + "<br />Your Password : "******"Password"].ToString() + "</span></span>"; string Body = "<table width='600' border='0' align='center' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'>" + "<tr><td><table width='600' border='0' align='center' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'><tr><td><table width='100%' border='0' cellspacing='0' cellpadding='0' bgcolor='#ffffff'><tr><td height='120' align='right'><img src='http://www.nscreens.com/images/logo.png' />" + "</td></tr></table></td></tr><tr><td bgcolor='#d82727'><table width='98%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td><p style='font-size: 18px; color: #ffffff; margin: 1; padding: 0; font-family: Arial, Helvetica, sans-serif;'>" + "Hello " + objDataSet.Tables[0].Rows[0]["Name"].ToString() + ",</p></td></tr><tr><td><p style='font-size: 14px; color: #ffffff; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif;'>Greetings, </p></td></tr></table></td></tr></table></td></tr><tr><td> </td></tr><tr><td><table width='100%' border='0' cellspacing='0' cellpadding='5' bgcolor='#ffffff'><tr>" + "<td><p style='font-size: 13px; margin: 1; padding: 1; color: #333333; font-family: Arial, Helvetica, sans-serif;'>Your Login Details</p></td></tr><tr><td><table width='60%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td><p style='font-size: 12px; color: #333333; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif;'>Username :</p></td>" + "<td><p style='font-size: 12px; color: #333333; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif;'>" + objDataSet.Tables[0].Rows[0]["EmailId"].ToString() + "</p></td></tr><tr><td><p style='font-size: 12px; color: #333333; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif;'>Password :</p></td><td><p style='font-size: 12px; color: #333333; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif;'>" + objDataSet.Tables[0].Rows[0]["Password"].ToString() + "</p></td></tr></table></td></tr><tr><td> </td></tr>" + "</table></td></tr><tr><td> </td></tr><tr><td><p style='font-size: 13px; margin: 1; padding: 0; color: #ffffff; font-family: Arial, Helvetica, sans-serif;'>Please note that this is a system-generated mail with regard to your account at nscreens.com. Your profile information is of utmost importance to us and hence you can be rest assured of its security.</p><p style='font-size: 13px; margin: 1; padding: 0; color: #ffffff; font-family: Arial, Helvetica, sans-serif;'>We welcome you all to contact us for any query, comments and suggestions at <a href='mailto:[email protected]'>" + "[email protected]</a> or please call us at +91--_____</p></td></tr></table></td></tr><tr><td bgcolor='#b90303'><p style='font-size: 13px; margin: 1; padding: 0; text-align: right; color: #ffffff;font-family: Arial, Helvetica, sans-serif;'>With Best Wishes <br />nscreens.com </p></td></tr></table></td></tr></table>"; MailMessage mail = new MailMessage(); mail.To.Add(objDataSet.Tables[0].Rows[0]["EmailId"].ToString()); mail.From = new MailAddress("*****@*****.**"); mail.Subject = "Your Password NScreens"; StringBuilder objStringBuilder = new StringBuilder(); objStringBuilder.Append(Body); AlternateView objAlternateView; objAlternateView = AlternateView.CreateAlternateViewFromString(objStringBuilder.ToString(), null, "text/html"); mail.AlternateViews.Add(objAlternateView); mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address smtp.EnableSsl = true; smtp.Port = 587; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "9885908149");//Or your Smtp Email ID and Password smtp.Send(mail); ((IDisposable)mail).Dispose(); //DataSet objDataSetBlock = SignUp.UpdateBlock(txtUsernameForforgetpass.Text.Trim()); ShowNotification("Change Password", "Password Changed successfully..", NotificationType.success); } if (objDataSetChk.Tables[0].Rows[0]["SMS"].ToString() == "True") { //message = "Dear Customer kindly pay your monthly bill amount Rs. " + dgvList.Rows[i].Cells[6].Value + "/- Ignore if paid. Thanks&Regards Surendra"; //string baseURL = "http://mobicomm.dove-sms.com/mobicomm/submitsms.jsp?user=SIMPLE1&key=809e3aa368XX&mobile=" + dgvList.Rows[i].Cells[4].Value + "&message='" + message + "'&senderid=alerts&accusage=1"; //client.OpenRead(baseURL); //Your user name string user = "******"; //Your authentication key string key = "809e3aa368XX"; //Multiple mobiles numbers separated by comma string mobile = objDataSet.Tables[0].Rows[0]["Mobile_No"].ToString(); //Sender ID,While using route4 sender id should be 6 characters long. string senderid = "SIMPLE"; //Your message to send, Add URL encoding here. string message = HttpUtility.UrlEncode("Good Day " + objDataSet.Tables[0].Rows[0]["Name"].ToString() + " your changed password is " + objDataSet.Tables[0].Rows[0]["Password"].ToString() + ""); //Prepare you post parameters StringBuilder sbPostData = new StringBuilder(); sbPostData.AppendFormat("user={0}", user); sbPostData.AppendFormat("&key={0}", key); sbPostData.AppendFormat("&mobile={0}", mobile); sbPostData.AppendFormat("&message={0}", message); sbPostData.AppendFormat("&senderid={0}", senderid); sbPostData.AppendFormat("&accusage={0}", "1"); try { //Call Send SMS API string sendSMSUri = "http://mobicomm.dove-sms.com/mobicomm/submitsms.jsp?"; //Create HTTPWebrequest HttpWebRequest httpWReq = (HttpWebRequest)WebRequest.Create(sendSMSUri); //Prepare and Add URL Encoded data UTF8Encoding encoding = new UTF8Encoding(); byte[] data = encoding.GetBytes(sbPostData.ToString()); //Specify post method httpWReq.Method = "POST"; httpWReq.ContentType = "application/x-www-form-urlencoded"; httpWReq.ContentLength = data.Length; using (Stream stream = httpWReq.GetRequestStream()) { stream.Write(data, 0, data.Length); } //Get the response HttpWebResponse response = (HttpWebResponse)httpWReq.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string responseString = reader.ReadToEnd(); //Close the response reader.Close(); response.Close(); } catch (SystemException ex) { //MessageBox.Show(ex.Message.ToString()); } } } Session["Username"] = null; Session["UserFullName"] = null; Session["ChangePassword"] = "******"; Response.Redirect("../Login.aspx", false); } else { ShowNotification("Change Password", "Invalid Password..!", NotificationType.error); } } } else { ShowNotification("Change Password", "Sorry, New Password and Confirm Password should be Same..!", NotificationType.error); } } else { ShowNotification("Change Password", "Sorry, New Password should be at least 5 characters..!", NotificationType.error); } } else { ShowNotification("Change Password", "Sorry, Your Session had been Expired.. So Please Logout Once & Login Again..!", NotificationType.error); } } else { ShowNotification("Change Password", "Please Fill All Fields", NotificationType.error); } } catch (Exception Ex) { StackTrace objStackTrace = new StackTrace(); string calledMethodName = objStackTrace.GetFrame(1).GetMethod().Name; string dispErrorMsg = string.Format("Error occurred in {0} method.", calledMethodName); LogFile.WriteToLog(dispErrorMsg, Ex); SendLogFile.SendMail(); ShowNotification("Change Password", dispErrorMsg, NotificationType.error); } }
protected void lstRecentVideos_ItemCommand(object sender, ListViewCommandEventArgs e) { try { if (e.CommandName == "Display") { DataSet objDataSet = MasterCode.RetrieveQuery("Select Artist_Details_Id,Name,Description,'../Artist_Photo/'+Photo as Photo,Gender,Artist_Name,(Select City_Name from tbl_admin_city AC where AC.City_Id=AD.LocationId)as City_Name,ContactInformation,languagesId,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(LanguagesId,',',1))FOR XML PATH (''))as Languages from tbl_Artist_Details AD join tbl_admin_Artist AA on AA.Artist_Id=AD.Interest_Areas where AD.Isactive='true' and Artist_Details_Id=" + (e.Item.FindControl("lblArtistId") as Label).Text); if (objDataSet.Tables[0].Rows.Count > 0) { imgPhoto.ImageUrl = objDataSet.Tables[0].Rows[0]["Photo"].ToString(); lblName.Text = objDataSet.Tables[0].Rows[0]["Name"].ToString(); lblArtist.Text = objDataSet.Tables[0].Rows[0]["Artist_Name"].ToString(); lblGender.Text = objDataSet.Tables[0].Rows[0]["Gender"].ToString(); lblCity.Text = objDataSet.Tables[0].Rows[0]["City_Name"].ToString(); lblDescription.Text = objDataSet.Tables[0].Rows[0]["Description"].ToString(); lblContactInformation.Text = objDataSet.Tables[0].Rows[0]["ContactInformation"].ToString(); txtLanguagesDis.Text = objDataSet.Tables[0].Rows[0]["Languages"].ToString(); } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModalScript", "divPopup()", true); } else if (e.CommandName == "DisplayEdit") { DataSet objDataSet = MasterCode.RetrieveQuery("Select Artist_Details_Id,Name,Description,'../Artist_Photo/'+Photo as Photo,Gender,Interest_Areas,ContactInformation,LocationId,Isactive,languagesId from tbl_Artist_Details where Isactive='true' and Artist_Details_Id=" + (e.Item.FindControl("lblArtistId") as Label).Text); if (objDataSet.Tables[0].Rows.Count > 0) { string[] Languages = (objDataSet.Tables[0].Rows[0]["languagesId"].ToString()).Split(','); if (Languages.Length > 0) { for (int i = 0; i < Languages.Length; i++) { if (lstLanguage.Items.FindByValue(Languages[i]) != null) { lstLanguage.Items.FindByValue(Languages[i]).Selected = true; } } } txtContactInformation.Text = objDataSet.Tables[0].Rows[0]["ContactInformation"].ToString(); DropDownList(ddlLocationId, "City_Id", "City_Name", "Select City_Id,City_Name from tbl_admin_city where Isactive='true' and District_Id=" + ddlDistrict.SelectedValue.ToString() + " Order by City_Name", "Select"); ddlLocationId.ClearSelection(); if (ddlLocationId.Items.FindByValue(objDataSet.Tables[0].Rows[0]["LocationId"].ToString()) != null) { ddlLocationId.Items.FindByValue(objDataSet.Tables[0].Rows[0]["LocationId"].ToString()).Selected = true; } DropDownList(ddlUpdateInterestArea, "Artist_Id", "Artist_Name", "Select Artist_Id,Artist_Name from tbl_admin_Artist where Isactive='True' Order by Artist_Name", "Select"); ddlUpdateInterestArea.ClearSelection(); if (ddlUpdateInterestArea.Items.FindByValue(objDataSet.Tables[0].Rows[0]["Interest_Areas"].ToString()) != null) { ddlUpdateInterestArea.Items.FindByValue(objDataSet.Tables[0].Rows[0]["Interest_Areas"].ToString()).Selected = true; } if (objDataSet.Tables[0].Rows[0]["Gender"].ToString() == "Female") { rdbUpdateFemale.Checked = true; rdbUpdateMale.Checked = true; } else { rdbUpdateFemale.Checked = false; rdbUpdateMale.Checked = true; } txtUpdateDescription.Text = objDataSet.Tables[0].Rows[0]["Description"].ToString(); txtUpdateArtist.Text = objDataSet.Tables[0].Rows[0]["Name"].ToString(); lblID.Text = objDataSet.Tables[0].Rows[0]["Artist_Details_Id"].ToString(); lblDName.Text = objDataSet.Tables[0].Rows[0]["Name"].ToString(); if (objDataSet.Tables[0].Rows[0]["Isactive"].ToString() == "True") { rdbActiveNoArtist.Checked = false; rdbActiveYesArtist.Checked = true; } else { rdbActiveYesArtist.Checked = false; rdbActiveNoArtist.Checked = true; } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModalScript", "divPopupEdit()", true); } } } catch (Exception Ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { String myUrl = Request.RawUrl.ToString(); var result = Path.GetFileName(myUrl); String Folder = Path.GetDirectoryName(myUrl); string[] SplitOffer = Folder.Split('\\'); for (int i = 0; i < SplitOffer.Length; i++) { if (i == 1) { Master.master_lblUrl = "../" + SplitOffer[i] + "/" + result; } } //string CityId = ""; //string ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; //if (string.IsNullOrEmpty(ipAddress)) //{ // ipAddress = Request.ServerVariables["REMOTE_ADDR"]; //} //string APIKey = "81dce31671738f9a3fdf05ee98c9a869dc78242e9603381233b3e663f0fcca3d"; //string url = string.Format("http://api.ipinfodb.com/v3/ip-city/?key={0}&ip={1}&format=json", APIKey, ipAddress); //using (WebClient client = new WebClient()) //{ // string json = client.DownloadString(url); // Location location = new JavaScriptSerializer().Deserialize<Location>(json); // DataSet objDataSet = MasterCode.RetrieveQuery("Select City_Id from tbl_admin_city where City_Name='" + location.CityName + "'"); // if (objDataSet.Tables[0].Rows.Count > 0) // CityId = objDataSet.Tables[0].Rows[0][0].ToString(); // //List<Location> locations = new List<Location>(); // //locations.Add(location); // //gvLocation.DataSource = locations; // //gvLocation.DataBind(); //} //Display_List(lstRecentVideos, "Select Advertisement_Id,Title,Video,Visits,'frmSingle.aspx?/'+cast(Advertisement_Id as varchar(max))+'/shortfilm' as shortfilm,'../Video_Images/'+Advertisement_Image as Short_film_Image from tbl_Advertisement where Isactive='True' and Status='Approve' and City_Id='" + CityId + "' Order by Advertisement_Id desc"); //string ShortId = Request.QueryString["shortfilm"]; //if (ShortId==null) DropDownList(ddlDistrict, "District_Id", "District_Name", "Select District_Id,District_Name from tbl_admin_district where Isactive='true' order by District_Name", "All Districts"); DropDownList(ddlLocation, "City_Id", "City_Name", "Select City_Id,City_Name from tbl_admin_city where Isactive='true' and District_Id=" + ddlDistrict.SelectedValue.ToString() + " Order by City_Name", "All Locations"); string Artist_Id = Request.QueryString["Id"]; DataSet objDataSet = MasterCode.RetrieveQuery("Select Artist_Id,Artist_Name from tbl_admin_Artist where Artist_Id=" + Artist_Id); if (objDataSet.Tables[0].Rows.Count > 0) { lblArtistType.Text = "Artist List - " + objDataSet.Tables[0].Rows[0][1].ToString(); } lblArtistTypeMy.Text = "My Artist List"; Display_List(lstMyArtist, "Select Artist_Details_Id,Name,Description,'../Artist_Photo/'+Photo as Photo from tbl_Artist_Details where Isactive='true' and Interest_Areas='" + Artist_Id + "' and CreatedById=" + Session["UserId"].ToString() + " order by Name"); Display_List(lstRecentVideos, "Select Artist_Details_Id,Name,Description,'../Artist_Photo/'+Photo as Photo from tbl_Artist_Details where Isactive='true' and Interest_Areas='" + Artist_Id + "' and CreatedById!=" + Session["UserId"].ToString() + " order by Name"); CheckBoxList(lstLanguage, "Language_Id", "Language_Name", " select Language_Id,Language_Name from tbl_admin_language where Isactive='True' Order by Language_Id"); //else // Display_List(lstRecentVideos, "Select Advertisement_Id,Title,Video,Visits,'frmSingle.aspx?Advertisement='+cast(Advertisement_Id as varchar(max)) as shortfilm,'../Video_Images/'+Advertisement_Image as Short_film_Image from tbl_Advertisement where Isactive='True' and Status='Approve' and NoofVisits>Visits and EndDate>'" + DateTime.Now.AddHours(Connection.SetHours).ToString("yyyy-MM-dd") + "' and StartDate<='" + DateTime.Now.AddHours(Connection.SetHours).ToString("yyyy-MM-dd") + "' and ShortFilmId Like '%," + ShortId + ",%' Order by Advertisement_Id desc"); } } catch (Exception Ex) { } }
public void Display_Film(string ShortFilmId, string UserId, string VideoType) { try { string LoadURL = ""; //string url = Request.Url.AbsoluteUri; //string[] Split = url.Split('%'); //Display_List(lstComments, "Select Comments_Id,Name,Message from tbl_Comments where Isactive='True' and ShortFilm_Id=" + Split[Split.Length - 2].Substring(2) + " Order by Comments_Id desc"); //DataSet objLike = MasterCode.RetrieveQuery("Select COUNT(*) from tbl_Like where ShortFilm_Id=" + Split[Split.Length - 2].Substring(2)); //lblDisplayLikes.Text = objLike.Tables[0].Rows[0][0].ToString() + " Like"; DataSet objDataSetBudget = MasterCode.RetrieveQuery("Select User_Budget from tbl_Register_User where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + ")"); if (objDataSetBudget.Tables[0].Rows.Count > 0) { if (Convert.ToDecimal(objDataSetBudget.Tables[0].Rows[0][0].ToString()) != 0) { if (ShortFilmId != "") { DataSet objDataSet = MasterCode.RetrieveQuery("select Short_film_Id,Title,Video as Shortfilm,CONVERT(varchar(12),CreatedDate,100)as Publish,Description,Visits,Trailer from tbl_Short_film where Short_film_Id=" + ShortFilmId); if (objDataSet.Tables[0].Rows.Count > 0) { lblTitle.Text = objDataSet.Tables[0].Rows[0]["Title"].ToString(); LoadURL = objDataSet.Tables[0].Rows[0]["Shortfilm"].ToString(); //add.InnerHtml = "<video id='Video' height='376px' width='100%' controls autoplay onclick='Play_Pause()'><source src='" + objDataSet.Tables[0].Rows[0]["Shortfilm"].ToString() + "' type='video/mp4'>"; txtNextPN.Text = ""; if (VideoType == "Film") { add.InnerHtml = "<iframe id='player1' runat='server' src='" + objDataSet.Tables[0].Rows[0]["Shortfilm"].ToString() + "?autoplay=1&api=1&player_id=player1' width='630' height='354' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"; } else { add.InnerHtml = "<iframe id='player1' runat='server' src='" + objDataSet.Tables[0].Rows[0]["Trailer"].ToString() + "?autoplay=1&api=1&player_id=player1' width='630' height='354' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"; } id.Attributes.Add("data-href", "http://www.nscreens.com/Admin/frmSingle.aspx?shortfilm=" + ShortFilmId + "&userId=" + Session["UserId"].ToString()); a.Attributes.Add("href", "https://plus.google.com/share?url=http://www.nscreens.com/Admin/frmSingle.aspx?shortfilm=" + ShortFilmId + "&userId=" + Session["UserId"].ToString()); Display_List(lstMostLiked, "Select top 4 Short_film_Id,Title,Hero,Video,Visits,'frmSingle.aspx?shortfilm='+cast(Short_film_Id as varchar(max)) as shortfilm,'../Video_Images/'+Short_film_Image as Short_film_Image,RIGHT(CONVERT(CHAR(8),DATEADD(second,Duration,0),108),5)as Duration from tbl_Short_film where Isactive='True' and Status='Approve' and Channel in (Select Channel from tbl_Short_film where Short_film_Id=" + ShortFilmId + ") order by Short_film_Id desc "); //// Video.Attributes.Add("src", objDataSet.Tables[0].Rows[0]["Shortfilm"].ToString()); lblPublished.Text = objDataSet.Tables[0].Rows[0]["Publish"].ToString(); lblDescription.Text = objDataSet.Tables[0].Rows[0]["Description"].ToString(); lblViews.Text = objDataSet.Tables[0].Rows[0]["Visits"].ToString(); DataSet objDataSetGetBudget = null; if (UserId == "" || UserId == null) { UserId = "0"; } if (UserId == "0") { objDataSetGetBudget = MasterCode.RetrieveQuery("Select Short_Film,Admin,Promoter,Video_Sharing from tbl_Budget_Settings where Budget_Settings_Id in (Select case when PromoCode IS NULL then 2 else 1 end from tbl_Register_User where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + "))"); } else { objDataSetGetBudget = MasterCode.RetrieveQuery("Select Short_Film,Admin,Promoter,Video_Sharing from tbl_Budget_Settings where Budget_Settings_Id in (Select case when PromoCode IS NULL then 3 else 4 end from tbl_Register_User where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + "))"); } if (objDataSetGetBudget.Tables[0].Rows.Count > 0) { DataSet objDataSetVisits12 = MasterCode.RetrieveQuery("insert into tbl_Short_Film_Visits(Short_Film_Id,User_Id,Date_Time,City_Id,IPAddress,User_Budget,Promoter_Budget,Admin_Budget,Video_Sharing,User_Share_Id) values(" + ShortFilmId + "," + Session["UserId"].ToString() + ",'" + DateTime.UtcNow.AddHours(5).AddMinutes(30).ToString("yyyy-MM-dd hh:mm:ss tt") + "','Eluru','" + Request.UserHostAddress + "'," + objDataSetGetBudget.Tables[0].Rows[0]["Short_Film"] + "," + objDataSetGetBudget.Tables[0].Rows[0]["Promoter"] + "," + objDataSetGetBudget.Tables[0].Rows[0]["Admin"] + "," + objDataSetGetBudget.Tables[0].Rows[0]["Video_Sharing"] + "," + UserId + ")"); } DataSet objDataSetUp = MasterCode.RetrieveQuery("update tbl_Short_film set Visits=Visits+1 where Short_film_Id=" + ShortFilmId); DataSet objDataSetMinBud = MasterCode.RetrieveQuery("update tbl_Register_User set User_Budget=User_Budget-(Select Budget from tbl_Budget_Settings where Budget_Settings_Id=2) where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + ")"); DataSet objDataSet2 = MasterCode.RetrieveQuery("Select User_Budget from tbl_Register_User where Isactive='True' and Register_Id in (select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + ")"); if (objDataSet2.Tables[0].Rows.Count > 0) { this.Master.Amount = objDataSet2.Tables[0].Rows[0][0].ToString(); } //btnPlay.Enabled = false; Display_List(lstMostLiked, "Select top 4 Short_film_Id,Title,Hero,Video,Visits,'frmSingle.aspx?shortfilm='+cast(Short_film_Id as varchar(max)) as shortfilm,'../Video_Images/'+Short_film_Image as Short_film_Image,RIGHT(CONVERT(CHAR(8),DATEADD(second,Duration,0),108),5)as Duration from tbl_Short_film where Isactive='True' and Status='Approve' and Channel in (Select Channel from tbl_Short_film where Short_film_Id=" + ShortFilmId + ") order by Short_film_Id desc "); Display_List(lstRelatedVideos, "Select top 3 Short_film_Id,Title,Hero,Video,Visits,'frmSingle.aspx?shortfilm='+cast(Short_film_Id as varchar(max)) as shortfilm,'../Video_Images/'+Short_film_Image as Short_film_Image,RIGHT(CONVERT(CHAR(8),DATEADD(second,Duration,0),108),5)as Duration from tbl_Short_film where Isactive='True' and Status='Approve' and Channel in (Select Channel from tbl_Short_film where Short_film_Id=" + ShortFilmId + ") order by Short_film_Id desc "); Display_List(lstMost, "Select top 2 Short_film_Id,Title,Hero,Video,Visits,'frmSingle.aspx?shortfilm='+cast(Short_film_Id as varchar(max)) as shortfilm,'../Video_Images/'+Short_film_Image as Short_film_Image,RIGHT(CONVERT(CHAR(8),DATEADD(second,Duration,0),108),5)as Duration from tbl_Short_film where Isactive='True' and Status='Approve' and Channel in (Select Channel from tbl_Short_film where Short_film_Id=" + ShortFilmId + ") order by Visits desc "); } } else { Display_Add(ShortFilmId); } } else { Display_Add(ShortFilmId); } } else { Display_Add(ShortFilmId); } } catch (Exception Ex) { } }
public void User_Profile() { try { DataSet objDataSet = MasterCode.RetrieveQuery("Select Register_Id,Name,Mobile_No,EmailId,Address,CONVERT(varchar(12),DOB,100)as DOB,Photo,City_Id,(Select District_Id from tbl_admin_city C where C.City_Id=U.City_Id)as District_Id,(Select (select State_Id from tbl_admin_district AD where AD.District_Id=C.District_Id) from tbl_admin_city C where C.City_Id=U.City_Id)as State_Id,Gender,Profile_Updated_Date from tbl_Register_User U where Register_Id in (Select Staff_Id from tbl_user where User_Id=" + Session["UserId"].ToString() + ")"); if (objDataSet.Tables[0].Rows.Count > 0) { if (objDataSet.Tables[0].Rows[0]["Gender"].ToString() == "Male") { rdbMale.Checked = true; } else { rdbFemale.Checked = true; } //int CalDays =Convert.ToInt32(Convert.ToDateTime(objDataSet.Tables[0].Rows[0]["Profile_Updated_Date"].ToString()) - DateTime.Now.AddHours(Connection.SetHours)); if (Convert.ToDateTime(objDataSet.Tables[0].Rows[0]["Profile_Updated_Date"].ToString()).AddDays(14) <= DateTime.Now.AddHours(Connection.SetHours)) { rdbFemale.Enabled = true; rdbMale.Enabled = true; rdbOthers.Enabled = true; ddlCity.Enabled = true; ddlState.Enabled = true; ddlDistrict.Enabled = true; } else { rdbFemale.Enabled = false; rdbMale.Enabled = false; rdbOthers.Enabled = false; ddlCity.Enabled = false; ddlState.Enabled = false; ddlDistrict.Enabled = false; } DateTime BirthDate = Convert.ToDateTime(objDataSet.Tables[0].Rows[0]["DOB"].ToString()); ddlDay.ClearSelection(); if (ddlDay.Items.FindByValue(BirthDate.Day.ToString()) != null) { ddlDay.Items.FindByValue(BirthDate.Day.ToString()).Selected = true; } ddlMonth.ClearSelection(); if (ddlMonth.Items.FindByValue(BirthDate.Month.ToString()) != null) { ddlMonth.Items.FindByValue(BirthDate.Month.ToString()).Selected = true; } ddlYear.ClearSelection(); if (ddlYear.Items.FindByText(BirthDate.Year.ToString()) != null) { ddlYear.Items.FindByText(BirthDate.Year.ToString()).Selected = true; } DropDownList(ddlState, "State_Id", "State_Name", "select State_Id,State_Name from tbl_admin_state where Isactive='True' Order by State_Name", "Select"); ddlState.ClearSelection(); if (ddlState.Items.FindByValue(objDataSet.Tables[0].Rows[0]["State_Id"].ToString()) != null) { ddlState.Items.FindByValue(objDataSet.Tables[0].Rows[0]["State_Id"].ToString()).Selected = true; } DropDownList(ddlDistrict, "District_Id", "District_Name", "Select District_Id,District_Name from tbl_admin_district where Isactive='True' and State_Id=" + ddlState.SelectedValue.ToString() + " Order by District_Name", "Select"); ddlDistrict.ClearSelection(); if (ddlDistrict.Items.FindByValue(objDataSet.Tables[0].Rows[0]["District_Id"].ToString()) != null) { ddlDistrict.Items.FindByValue(objDataSet.Tables[0].Rows[0]["District_Id"].ToString()).Selected = true; } DropDownList(ddlCity, "City_Id", "City_Name", "Select City_Id,City_Name from tbl_admin_city where Isactive='True' and District_Id=" + ddlDistrict.SelectedValue + " Order by City_Name", "Select"); ddlCity.ClearSelection(); if (ddlCity.Items.FindByValue(objDataSet.Tables[0].Rows[0]["City_Id"].ToString()) != null) { ddlCity.Items.FindByValue(objDataSet.Tables[0].Rows[0]["City_Id"].ToString()).Selected = true; } lblDumpCityId.Text = objDataSet.Tables[0].Rows[0]["City_Id"].ToString(); txtName.Text = objDataSet.Tables[0].Rows[0]["Name"].ToString(); txtMobileNumber.Text = objDataSet.Tables[0].Rows[0]["Mobile_No"].ToString(); txtAddress.Text = objDataSet.Tables[0].Rows[0]["Address"].ToString(); txtEmailId.Text = objDataSet.Tables[0].Rows[0]["EmailId"].ToString(); lblRegisterId.Text = objDataSet.Tables[0].Rows[0]["Register_Id"].ToString(); lblDumpEmailId.Text = objDataSet.Tables[0].Rows[0]["EmailId"].ToString(); imgPhoto.ImageUrl = "~/User_Photos/" + objDataSet.Tables[0].Rows[0]["Photo"].ToString(); } } catch (Exception Ex) { } }