protected void ddlSearchOperator_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            //if (ddlSearchOperator.SelectedIndex != 0)
            //    Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD where State_Id=" + ddlSearchOperator.SelectedValue.ToString() + " Order by District_Name");
            //else
            //    Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD Order by District_Name");

            if (ddlSearchOperator.SelectedIndex != 0)
            {
                Districts_List(gvDistrict, "SELECT 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' and Operator_Code='" + ddlOperator.SelectedValue.ToString() + "' order by Offer_Id");
            }
            else
            {
                Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD Order by District_Name");
            }
        }
        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);
            ShowNotification("Offers", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#2
0
    protected void gvLanguage_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName.Equals("detail"))
            {
                int index = Convert.ToInt32(e.CommandArgument);

                txtUpdateLanguage.Text = (gvLanguage.Rows[index].FindControl("lblGridLanguage") as Label).Text;
                lblID.Text             = (gvLanguage.Rows[index].FindControl("lblGridLanguageId") as Label).Text;
                lblDName.Text          = (gvLanguage.Rows[index].FindControl("lblGridLanguage") as Label).Text;

                if ((gvLanguage.Rows[index].FindControl("lblGridLanguageIsactive") as Label).Text == " Active ")
                {
                    rdbActiveNoLanguage.Checked = false; rdbActiveYesLanguage.Checked = true;
                }
                else
                {
                    rdbActiveYesLanguage.Checked = false; rdbActiveNoLanguage.Checked = true;
                }

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModalScript", "divPopup()", true);
            }
        }
        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);
            ShowNotification("Language", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
    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");
                DropDownList(ddlSearchOperator, "OperatorCode", "OperatorName", "Select OperatorCode,OperatorName from tbl_operator where Isactive='true' and RechargeType='Prepaid' Order by OperatorName", "Select");
                Districts_List(gvDistrict, "SELECT 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");
                ddlOperator.Focus();
            }
        }
        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);
            ShowNotification("Offers", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#4
0
    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;
                    }
                }

                Languages_List(gvLanguage, "select Language_Id,Language_Name,Isactive from tbl_Admin_Language Order by Language_Name");
                txtLanguage.Focus();
            }
        }
        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);
            ShowNotification("Language", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#5
0
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            System.Threading.Thread.Sleep(1000);
            btnSubmit.Enabled = false;
            btnSubmit.Text    = "Please wait...";
            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Prepaid":

                clear();
                break;

            case "Save":
                Send_Data(txtUpdatetid.Text.Trim(), 0, "", true, TextBox4.Text.Trim(), txtDeatils.Text.Trim(), "0");
                clear();
                break;
            }
            btnSubmit.Enabled = true;
            btnSubmit.Text    = "Submit";
        }
        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);
            ShowNotification("Bank", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#6
0
    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(ddlCountry, "Country_Id", "Country_Name", "Select Country_Id,Country_Name from tbl_admin_country where Isactive='True' Order by Country_Name", "Select");
                States_List(gvState, "select Country_Id,State_Id,State_Name,Isactive,(Select Country_Name from tbl_admin_country AC where AC.Country_Id=S.Country_Id)as Country_Name from tbl_Admin_State S Order by State_Name");
                txtState.Focus();
            }
        }
        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);
            ShowNotification("State", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#7
0
    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;
                    }
                }

                Display_List(lstRecentVideos, "select Title_Id,Title_Name,Isactive,Tag,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(Languages,',',1))FOR XML PATH (''))as Languages,Tag,'~/Video_Images/'+Image as Photo from tbl_Register_Title where Isactive='true' and CreatedById=" + Session["UserId"].ToString() + " Order by Title_Name");
                //Titles_List(gvTitle, "select Title_Id,Title_Name,Isactive,Tag,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(Languages,',',1))FOR XML PATH (''))as Languages from tbl_Register_Title where Isactive='true' and CreatedById=" + Session["UserId"].ToString() + " Order by Title_Name");
            }
        }
        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);
            ShowNotification("Title", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#8
0
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Save":
                Send_Language_Data(txtLanguage.Text.Trim(), 0, "", true);
                break;

            case "Clear":
                txtLanguage.Text = "";
                break;

            case "Update":
                Send_Language_Data(txtUpdateLanguage.Text.Trim(), Convert.ToInt32(lblID.Text.Trim()), lblDName.Text.Trim(), rdbActiveYesLanguage.Checked ? true : false);
                btnClose.Focus();
                break;

            case "Seach":
                //Languages_List(gvLanguage, "select Language_Id,Language_Name,Isactive from tbl_Admin_Language where Language_Name Like '" + txtSearch.Text + "%' Order by Language_Name");
                break;
            }
        }
        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);
            ShowNotification("Language", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#9
0
    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(ddlSearchState, "State_Id", "State_Name", "SELECT State_Id,State_Name FROM tbl_Admin_State WHERE Isactive='True' ORDER BY State_Name", "All States");
                DropDownList(ddlState, "State_Id", "State_Name", "SELECT State_Id,State_Name FROM tbl_Admin_State WHERE Isactive='True' ORDER BY State_Name", "Select");
                Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD Order by District_Name");
                ddlState.Focus();
            }
        }
        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);
            ShowNotification("District", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#10
0
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Save":
                if (txtPassword1.Text != "" && txtDescription.Text.Trim() != "" && txtProduction.Text.Trim() != "" && fupProductionImage.FileName != "")
                {
                    DataSet objDataSet1 = MasterCode.RetrieveQuery("select count(*) from tbl_Admin_Channel where CreatedById=" + Session["UserId"].ToString());
                    if (Convert.ToInt32(objDataSet1.Tables[0].Rows[0][0].ToString()) > 0)
                    {
                        ShowNotification("Production", "Sorry Only one production for Single user..!", NotificationType.error);
                    }
                    else
                    {
                        DataSet objDataSet = MasterCode.RetrieveQuery("Select Password from tbl_user where Username='******'");
                        if (objDataSet.Tables[0].Rows[0][0].ToString() == txtPassword1.Text)
                        {
                            Send_Production_Data(txtProduction.Text.Trim(), 0, "", true, txtDescription.Text.Trim(), fupProductionImage.FileName);
                        }
                        else
                        {
                            ShowNotification("Production", "Invalid Password..!", NotificationType.error);
                        }
                    }
                }
                else
                {
                    ShowNotification("Production", "Please fill All fields..!", NotificationType.error);
                }
                break;

            case "Clear":
                txtProduction.Text  = "";
                txtDescription.Text = "";
                break;

            case "Update":
                Send_Production_Data(txtUpdateProduction.Text.Trim(), Convert.ToInt32(lblID.Text.Trim()), lblDName.Text.Trim(), rdbActiveYesProduction.Checked ? true : false, txtUpdateDescription.Text.Trim(), fudUpdateImg.FileName);
                btnClose.Focus();
                break;

            case "Seach":
                //Productions_List(gvProduction, "select Production_Id,Production_Name,Isactive from tbl_Admin_Production where Production_Name Like '" + txtSearch1.Text + "%' Order by Production_Name");
                break;
            }
        }
        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);
            ShowNotification("Production", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
    protected void gvTitle_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName.Equals("detail"))
            {
                int index = Convert.ToInt32(e.CommandArgument);

                txtUpdateTitle.Text   = (gvTitle.Rows[index].FindControl("lblGridTitle") as Label).Text;
                lblID.Text            = (gvTitle.Rows[index].FindControl("lblGridTitleId") as Label).Text;
                lblDName.Text         = (gvTitle.Rows[index].FindControl("lblGridTitle") as Label).Text;
                lblDumpLanguages.Text = (gvTitle.Rows[index].FindControl("lblGridLanguages1") as Label).Text;
                lblUpdateTagDump.Text = (gvTitle.Rows[index].FindControl("lblGridTag") as Label).Text;

                txtUpdateTag.Text = (gvTitle.Rows[index].FindControl("lblGridTag") as Label).Text;

                CheckBoxList(lstUpdateLanguage, "Language_Id", "Language_Name", "Select Language_Id,Language_Name from tbl_admin_language where Isactive='true' order by Language_Name");

                string LangIds = "";
                lstUpdateLanguage.ClearSelection();
                string[] Split = ((gvTitle.Rows[index].FindControl("lblGridLanguages") as Label).Text).Split(',');
                if (Split.Length > 0)
                {
                    for (int i = 0; i < Split.Length; i++)
                    {
                        foreach (ListItem li in lstUpdateLanguage.Items)
                        {
                            if (li.Text == Split[i])
                            {
                                li.Selected = true;
                                LangIds     = LangIds + li.Text;
                            }
                        }
                    }
                }
                txtUpdateLanguage.Text = LangIds;
                if ((gvTitle.Rows[index].FindControl("lblGridTitleIsactive") as Label).Text == " Active ")
                {
                    rdbActiveNoTitle.Checked = false; rdbActiveYesTitle.Checked = true;
                }
                else
                {
                    rdbActiveYesTitle.Checked = false; rdbActiveNoTitle.Checked = true;
                }

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModalScript", "divPopup()", true);
            }
        }
        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);
            ShowNotification("Title", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#12
0
    protected void gvCity_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName.Equals("detail"))
            {
                int index = Convert.ToInt32(e.CommandArgument);

                DataSet objDataSet = MasterCode.RetrieveQuery("Select State_Id from tbl_admin_district AD where District_Id=" + (gvCity.Rows[index].FindControl("lblGridDistrictId") as Label).Text);

                DropDownList(ddlUpdateState, "State_Id", "State_Name", "Select State_Id,State_Name from tbl_admin_state TA where Isactive='True' Order by State_Name", "Select");
                if (objDataSet.Tables[0].Rows.Count > 0)
                {
                    if (ddlUpdateState.Items.FindByValue(objDataSet.Tables[0].Rows[0]["State_Id"].ToString()) != null)
                    {
                        ddlUpdateState.Items.FindByValue(objDataSet.Tables[0].Rows[0]["State_Id"].ToString()).Selected = true;
                    }
                }

                DropDownList(ddlUpdateDistrict, "District_Id", "District_Name", "SELECT District_Id,District_Name FROM tbl_Admin_District WHERE Isactive='True' and State_Id=" + ddlUpdateState.SelectedValue + " ORDER BY District_Name", "");
                if (ddlUpdateDistrict.Items.FindByValue((gvCity.Rows[index].FindControl("lblGridDistrictId") as Label).Text) != null)
                {
                    ddlUpdateDistrict.Items.FindByValue((gvCity.Rows[index].FindControl("lblGridDistrictId") as Label).Text).Selected = true;
                }

                txtUpdateCity.Text     = (gvCity.Rows[index].FindControl("lblGridCity") as Label).Text;
                lblDName.Text          = (gvCity.Rows[index].FindControl("lblGridCity") as Label).Text;
                lblID.Text             = (gvCity.Rows[index].FindControl("lblGridCityId") as Label).Text;
                lblDumpDistrictId.Text = (gvCity.Rows[index].FindControl("lblGridDistrictId") as Label).Text;

                if ((gvCity.Rows[index].FindControl("lblGridCityIsactive") as Label).Text == " Active ")
                {
                    rdbActiveNoCity.Checked = false; rdbActiveYesCity.Checked = true;
                }
                else
                {
                    rdbActiveYesCity.Checked = false; rdbActiveNoCity.Checked = true;
                }

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModalScript", "divPopup()", true);
            }
        }
        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);
            ShowNotification("City", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#13
0
    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;
                    }
                }

                DataSet objDataSet = MasterCode.RetrieveQuery("select count(*) from tbl_Admin_Channel where CreatedById=" + Session["UserId"].ToString());
                if (Convert.ToInt32(objDataSet.Tables[0].Rows[0][0].ToString()) > 0)
                {
                    Response.Redirect("frmProductionList.aspx", false);
                    btnSubmit.Visible = false;
                }
                else
                {
                    btnSubmit.Visible = true;
                }
                //Productions_List(gvProduction, "select Channel_Id,Channel_Name,Isactive,Description from tbl_Admin_Channel where CreatedById=" + Session["UserId"].ToString() + " Order by Channel_Name");
                txtProduction.Focus();

                Display_List(lstOther, "select Channel_Id,Channel_Name,Isactive,Description,'../ProductionImg/'+Img as Img from tbl_Admin_Channel where Isactive='true' Order by Channel_Name");

                //ShowNotification("Production", "Please Create Production First..", NotificationType.info);
            }
        }
        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);
            ShowNotification("Production", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             Display();
         }
     }
     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);
         ShowNotification("State", dispErrorMsg, NotificationType.error);
         SendLogFile.SendMail();
     }
 }
示例#15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             Channels_List(gvChannel, "select Channel_Id,Channel_Name,Isactive,Description from tbl_Admin_Channel Order by Channel_Name");
             txtChannel.Focus();
         }
     }
     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);
         ShowNotification("Channel", dispErrorMsg, NotificationType.error);
         SendLogFile.SendMail();
     }
 }
示例#16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             Titles_List(gvTitle, "select Title_Id,Title_Name,Isactive,Tag,Languages from tbl_Register_Title Order by Title_Name");
             txtTitle.Focus();
         }
     }
     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);
         ShowNotification("Title", dispErrorMsg, NotificationType.error);
         SendLogFile.SendMail();
     }
 }
示例#17
0
    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 AId = Request.QueryString["Id"];

                lblDetailsId.Text = AId;

                DropDownList(ddlInterestArea, "Artist_Id", "Artist_Name", "Select Artist_Id,Artist_Name from tbl_admin_Artist where Isactive='True' Order by Artist_Name", "Select");

                DropDownList(ddlLocation, "City_Id", "City_Name", "Select City_Id,City_Name from tbl_admin_city where Isactive='true' Order by City_Name", "Select");

                Display_List(lstRecentVideos, "Select Artist_Details_Id,Name,Description,'../Artist_Photo/'+Photo as Photo,Gender,Interest_Areas as Artist_Name,Isactive from tbl_Artist_Details where Isactive='true'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");
                txtName.Focus();
            }
        }
        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);
            ShowNotification("Artist", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#18
0
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Save":
                Send_City_Data(Convert.ToInt32(ddlDistrict.SelectedValue.ToString()), txtCity.Text.Trim(), 0, "", false, 0);
                break;

            case "Clear":
                Clear_City();
                ddlState.SelectedIndex = 0;
                DropDownList(ddlDistrict, "District_Id", "District_Name", "SELECT District_Id,District_Name FROM tbl_Admin_District WHERE Isactive='True' and State_Id=" + ddlState.SelectedValue + " ORDER BY District_Name", "Select");
                break;

            case "Update":
                Send_City_Data(Convert.ToInt32(ddlUpdateDistrict.SelectedValue.ToString()), txtUpdateCity.Text.Trim(), Convert.ToInt32(lblID.Text.Trim()), lblDName.Text.Trim(), rdbActiveYesCity.Checked ? true : false, Convert.ToInt32(lblDumpDistrictId.Text.Trim()));
                btnClose.Focus();
                break;

            case "Search":
                //if (txtSearchCity.Text != "")
                //    Citys_List(gvCity, "select City_Id,City_Name,City_Code,District_Id,Isactive,(Select District_Name from tbl_admin_district AD where AD.District_Id=AC.District_Id)as District_Name,(Select (Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id) from tbl_admin_district AD where AD.District_Id=AC.District_Id)as State_Name from tbl_Admin_City AC where District_Id=" + ddlSearchDistrict.SelectedValue.ToString() + "and City_Name Like '" + txtSearchCity.Text + "%' Order by City_Name");
                //else
                //    Citys_List(gvCity, "select City_Id,City_Name,City_Code,District_Id,Isactive,(Select District_Name from tbl_admin_district AD where AD.District_Id=AC.District_Id)as District_Name,(Select (Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id) from tbl_admin_district AD where AD.District_Id=AC.District_Id)as State_Name from tbl_Admin_City AC where District_Id=" + ddlSearchDistrict.SelectedValue.ToString() + " Order by City_Name");
                //txtSearchCity.Focus();
                break;
            }
        }
        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);
            ShowNotification("City", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#19
0
    protected void gvDistrict_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName.Equals("detail"))
            {
                int index = Convert.ToInt32(e.CommandArgument);

                DropDownList(ddlUpdateState, "State_Id", "State_Name", "SELECT State_Id,State_Name FROM tbl_Admin_State WHERE Isactive='True' ORDER BY State_Name", "");
                if (ddlUpdateState.Items.FindByValue((gvDistrict.Rows[index].FindControl("lblGridStateId") as Label).Text) != null)
                {
                    ddlUpdateState.Items.FindByValue((gvDistrict.Rows[index].FindControl("lblGridStateId") as Label).Text).Selected = true;
                }

                txtUpdateDistrict.Text = (gvDistrict.Rows[index].FindControl("lblGridDistrict") as Label).Text;
                lblDName.Text          = (gvDistrict.Rows[index].FindControl("lblGridDistrict") as Label).Text;
                lblID.Text             = (gvDistrict.Rows[index].FindControl("lblGridDistrictId") as Label).Text;
                lblDumpStateId.Text    = (gvDistrict.Rows[index].FindControl("lblGridStateId") as Label).Text;

                if ((gvDistrict.Rows[index].FindControl("lblGridDistrictIsactive") as Label).Text == " Active ")
                {
                    rdbActiveNoDistrict.Checked = false; rdbActiveYesDistrict.Checked = true;
                }
                else
                {
                    rdbActiveYesDistrict.Checked = false; rdbActiveNoDistrict.Checked = true;
                }

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModalScript", "divPopup()", true);
            }
        }
        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);
            ShowNotification("District", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#20
0
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Save":
                Send_District_Data(Convert.ToInt32(ddlState.SelectedValue.ToString()), txtDistrict.Text.Trim(), 0, "", false, 0);
                break;

            case "Clear":
                Clear_District();
                ddlState.SelectedIndex = 0;
                break;

            case "Update":
                Send_District_Data(Convert.ToInt32(ddlUpdateState.SelectedValue.ToString()), txtUpdateDistrict.Text.Trim(), Convert.ToInt32(lblID.Text.Trim()), lblDName.Text.Trim(), rdbActiveYesDistrict.Checked ? true : false, Convert.ToInt32(lblDumpStateId.Text.Trim()));
                btnClose.Focus();
                break;

            case "Search":
                //if (txtSearchDistrict.Text != "")
                //    Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD where State_Id=" + ddlSearchState.SelectedValue.ToString() + "and District_Name Like '" + txtSearchDistrict.Text + "%' Order by District_Name");
                //else
                Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD where State_Id=" + ddlSearchState.SelectedValue.ToString() + " Order by District_Name");
                //txtSearchDistrict.Focus();
                break;
            }
        }
        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);
            ShowNotification("District", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#21
0
 protected void ddlSearchState_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (ddlSearchState.SelectedIndex != 0)
         {
             Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD where State_Id=" + ddlSearchState.SelectedValue.ToString() + " Order by District_Name");
         }
         else
         {
             Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD Order by District_Name");
         }
     }
     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);
         ShowNotification("District", dispErrorMsg, NotificationType.error);
         SendLogFile.SendMail();
     }
 }
示例#22
0
    protected void gvProduction_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName.Equals("detail"))
            {
                int     index      = Convert.ToInt32(e.CommandArgument);
                DataSet objDataSet = MasterCode.RetrieveQuery("select '~/ProductionImg/'+Img as Img from tbl_admin_channel where Channel_Id=" + (gvProduction.Rows[index].FindControl("lblGridProductionId") as Label).Text);
                txtUpdateProduction.Text = (gvProduction.Rows[index].FindControl("lblGridProduction") as Label).Text;
                lblID.Text                = (gvProduction.Rows[index].FindControl("lblGridProductionId") as Label).Text;
                lblDName.Text             = (gvProduction.Rows[index].FindControl("lblGridProduction") as Label).Text;
                txtUpdateDescription.Text = (gvProduction.Rows[index].FindControl("lblGridDescription") as Label).Text;

                imgupdate.ImageUrl = objDataSet.Tables[0].Rows[0]["Img"].ToString();

                if ((gvProduction.Rows[index].FindControl("lblGridProductionIsactive") as Label).Text == " Active ")
                {
                    rdbActiveNoProduction.Checked = false; rdbActiveYesProduction.Checked = true;
                }
                else
                {
                    rdbActiveYesProduction.Checked = false; rdbActiveNoProduction.Checked = true;
                }

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModalScript", "divPopup()", true);
            }
        }
        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);
            ShowNotification("Production", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Update":
                string LanguesIds = ",";
                for (int i = 0; i < lstLanguage.Items.Count; i++)
                {
                    if (lstLanguage.Items[i].Selected)
                    {
                        LanguesIds = LanguesIds + lstLanguage.Items[i].Value + ",";
                    }
                }

                Send_Artist_Data(ddlUpdateInterestArea.SelectedValue.ToString(), txtUpdateArtist.Text.Trim(), Convert.ToInt32(lblID.Text.Trim()), lblDName.Text.Trim(), rdbActiveYesArtist.Checked ? true : false, txtUpdateDescription.Text.Trim(), fupupdatePhoto.FileName, (rdbUpdateMale.Checked).ToString(), ddlUpdateInterestArea.SelectedValue.ToString(), Convert.ToInt32(ddlLocationId.SelectedValue.ToString()), txtContactInformation.Text.Trim(), LanguesIds);
                btnClose.Focus();
                break;

            case "Seach":
                //Artists_List(gvArtist, "select Artist_Id,Artist_Name,Isactive from tbl_Admin_Artist where Artist_Name Like '" + txtSearch.Text + "%' Order by Artist_Name");
                break;
            }
        }
        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);
            ShowNotification("Artist", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
    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 Login = Session["Username"].ToString();

                //if (Login == null)
                //    Response.Redirect("frmLogin.aspx", false);

                //ShowNotification("Change Password", "New Password should be at least 5 characters..", NotificationType.info);
            }
        }
        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", "Page Load Error", NotificationType.error);
        }
    }
示例#25
0
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Save":
                //Send_District_Data(Convert.ToInt32(ddlOperator.SelectedValue.ToString()), txtDescription.Text.Trim(), 0, "", false, 0);

                string RechargeTypeIds = ",";
                for (int i = 0; i < lstRechargeType.Items.Count; i++)
                {
                    if (lstRechargeType.Items[i].Selected)
                    {
                        RechargeTypeIds = RechargeTypeIds + lstRechargeType.Items[i].Text + ",";
                    }
                }

                if (txtAmount.Text.Trim() != "" && ddlOperator.SelectedIndex != 0 && RechargeTypeIds != ",")
                {
                    Recharge objRecharge = new Recharge();

                    objRecharge.Area            = ddlArea.SelectedItem.ToString();
                    objRecharge.OperatorCode    = ddlOperator.SelectedValue.ToString();
                    objRecharge.RechargeTypeIds = RechargeTypeIds;
                    objRecharge.Amount          = Convert.ToDecimal(txtAmount.Text.Trim());
                    if (ddlTTType.SelectedItem.ToString() != "-- Select --")
                    {
                        objRecharge.TTType = ddlTTType.SelectedItem.ToString();
                    }
                    else
                    {
                        objRecharge.TTType = "";
                    }

                    objRecharge.Days = txtDay.Text.Trim();

                    objRecharge.CreatedDate = DateTime.Now.AddHours(Connection.SetHours).ToString();
                    objRecharge.UserId      = Convert.ToInt32(Session["UserId"].ToString());
                    objRecharge.Description = txtDescription.Text.Trim();

                    DataSet objDataSet = Recharge.Recharge_Data_To_DB(objRecharge);
                    if (objDataSet.Tables[0].Rows[0][0].ToString() == "1")
                    {
                        ShowNotification("Offers", "Inserted Successfully..", NotificationType.success);
                        Clear();
                    }
                }
                break;

            case "Clear":
                Clear();
                ddlOperator.SelectedIndex = 0;
                break;

            case "Update":
                Send_District_Data(Convert.ToInt32(ddlUpdateState.SelectedValue.ToString()), txtUpdateDistrict.Text.Trim(), Convert.ToInt32(lblID.Text.Trim()), lblDName.Text.Trim(), rdbActiveYesDistrict.Checked ? true : false, Convert.ToInt32(lblDumpStateId.Text.Trim()));
                btnClose.Focus();
                break;

            case "Search":
                //if (txtSearchDistrict.Text != "")
                //    Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD where State_Id=" + ddlSearchOperator.SelectedValue.ToString() + "and District_Name Like '" + txtSearchDistrict.Text + "%' Order by District_Name");
                //else
                Districts_List(gvDistrict, "select District_Id,District_Name,State_Id,Isactive,(Select State_Name from tbl_admin_state TAS where TAS.State_Id=AD.State_Id)as State_Name from tbl_Admin_District AD where State_Id=" + ddlSearchOperator.SelectedValue.ToString() + " Order by District_Name");
                //txtSearchDistrict.Focus();
                break;
            }
        }
        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);
            ShowNotification("Offers", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
    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;
                    }
                }

                if (Session["UserName"].ToString() == "admin")
                {
                    //DataSet objDataSetE = MasterCode.RetrieveQuery("Select (Select case when SUM(Promoter_Budget) is null then 0 else SUM(Promoter_Budget) end +case when SUM(User_Budget) is null then 0 else SUM(User_Budget) end from tbl_Short_Film_Visits where Short_Film_Id in (Select Lan_Short_film_Id from tbl_Language_Short_FilmId where CreatedById=" + Session["UserId"].ToString() + "))+(Select case when SUM(Video_Sharing) is null then 0 else SUM(Video_Sharing) end from tbl_Short_Film_Visits where User_Share_Id=" + Session["UserId"].ToString() + ")+(Select case when sum(User_Budget) is null then 0 else sum(User_Budget) end +case when sum(Promoter_Budget) is null then 0 else sum(Promoter_Budget) end from tbl_Advertizment_Visits where Advertisement_Id in (Select Advertisement_Id from tbl_Advertisement where CreatedById=" + Session["UserId"].ToString() + "))");
                    //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() + ")");
                    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)
                    {
                        lblEarning.Text = objDataSetE.Tables[0].Rows[0][0].ToString();
                    }
                    else
                    {
                        lblEarning.Text = "0.00";
                    }

                    txtEarningAmt.Text     = lblEarning.Text;
                    lblDumpEarningAmt.Text = lblEarning.Text;


                    Titles_List(gvSettings, "SELECT Budget_Settings_Id,Budget,Short_Film,Admin,Promoter,Video_Sharing FROM tbl_Budget_Settings");
                    Titles_List(gvAdd, "Select cast(ROW_NUMBER() OVER (ORDER BY Visits_Id) as varchar(max))as [S. No.],(Select Title from tbl_Advertisement S where S.Advertisement_Id=V.Advertisement_Id)as Title,convert(varchar(12),Date_Time,100)as Date,Admin_Budget as Admin,User_Budget as Uploader,Promoter_Budget as Promoter from tbl_Advertizment_Visits V");
                    Titles_List(gvShort, "Select cast(ROW_NUMBER() OVER (ORDER BY Visits_Id) as varchar(max))as [S. No.],(Select  (Select Title from tbl_Short_film S where S.Short_film_Id=TL.Short_Film_Id) from tbl_Language_Short_FilmId TL where TL.Lan_Short_film_Id=V.Short_Film_Id)as Title,convert(varchar(12),Date_Time,100)as Date,Admin_Budget as Admin,User_Budget as Uploader,Promoter_Budget as Promoter,Video_Sharing as [Video Share] from tbl_Short_Film_Visits V ");
                    Titles_List(gvShare, "Select cast(ROW_NUMBER() OVER (ORDER BY Visits_Id) as varchar(max))as [S. No.],(Select Title from tbl_Short_film S where S.Short_film_Id=V.Short_Film_Id)as Title,convert(varchar(12),Date_Time,100)as Date,Video_Sharing as [Video Share],Promoter_Budget as Promoter,User_Budget as Uploader from tbl_Short_Film_Visits V where User_Share_Id=" + Session["UserId"].ToString() + "");
                }
                else
                {
                    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)
                    {
                        lblEarning.Text = objDataSetE.Tables[0].Rows[0][0].ToString();
                    }
                    else
                    {
                        lblEarning.Text = "0.00";
                    }

                    txtEarningAmt.Text     = lblEarning.Text;
                    lblDumpEarningAmt.Text = lblEarning.Text;

                    Titles_List(gvSettings, "SELECT Budget_Settings_Id,Budget,Short_Film,Admin,Promoter,Video_Sharing FROM tbl_Budget_Settings");
                    Titles_List(gvAdd, "Select cast(ROW_NUMBER() OVER (ORDER BY Visits_Id) as varchar(max))as [S. No.],(Select Title from tbl_Advertisement S where S.Advertisement_Id=V.Advertisement_Id)as Title,convert(varchar(12),Date_Time,100)as Date,User_Budget as Uploader,Promoter_Budget as Promoter from tbl_Advertizment_Visits V where Advertisement_Id in (Select Advertisement_Id from tbl_Advertisement where CreatedById=" + Session["UserId"].ToString() + ")");
                    Titles_List(gvShort, "Select cast(ROW_NUMBER() OVER (ORDER BY Visits_Id) as varchar(max))as [S. No.],(Select  (Select Title from tbl_Short_film S where S.Short_film_Id=TL.Short_Film_Id) from tbl_Language_Short_FilmId TL where TL.Lan_Short_film_Id=V.Short_Film_Id)as Title,convert(varchar(12),Date_Time,100)as Date,User_Budget as Uploader,Promoter_Budget as Promoter,Video_Sharing as [Video Share] from tbl_Short_Film_Visits V where  Short_Film_Id in (Select Lan_Short_film_Id from tbl_Language_Short_FilmId U where CreatedById=" + Session["UserId"].ToString() + ")");
                    Titles_List(gvShare, "Select cast(ROW_NUMBER() OVER (ORDER BY Visits_Id) as varchar(max))as [S. No.],(Select Title from tbl_Short_film S where S.Short_film_Id=V.Short_Film_Id)as Title,convert(varchar(12),Date_Time,100)as Date,Video_Sharing as [Video Share],Promoter_Budget as Promoter,User_Budget as Uploader from tbl_Short_Film_Visits V where User_Share_Id=" + Session["UserId"].ToString() + "");
                }
                Titles_List(gvTrans, "Select Id,Transaction_Id,Debit as Credit,convert(varchar(12),CreatedDate,100)as CreatedDate,'Refill Wallet' as Page from tbl_transactions S where Page_Id=3 and CreatedById=" + Session["UserId"].ToString());
                //Titles_List(gvTitle, "Select Visits_Id,(Select Title from tbl_Short_film S where S.Short_film_Id=V.Short_Film_Id)as Short_Film_Id,User_Id,convert(varchar(12),Date_Time,100)as Date_Time,Video_Sharing,User_Budget from tbl_Short_Film_Visits V where User_Share_Id=" + Session["UserId"].ToString() + " or Short_Film_Id in (Select Short_film_Id from tbl_Short_film U where CreatedById=" + Session["UserId"].ToString() + ") ");
            }
        }
        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);
            ShowNotification("Budget", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            //Button btn = sender as Button;
            //switch (btn.CommandName)
            //{
            //    case "Save":
            //        Send_State_Data(txtState.Text.Trim(), 0, "", true,0,Convert.ToInt32(ddlCountry.SelectedValue.ToString()));
            //        break;
            //    case "Clear":
            //        txtState.Text = "";
            //        break;
            //    case "Update":
            //        Send_State_Data(txtUpdateState.Text.Trim(), Convert.ToInt32(lblID.Text.Trim()), lblDName.Text.Trim(), rdbActiveYesState.Checked ? true : false, Convert.ToInt32(lblDumpCountryId.Text.Trim()), Convert.ToInt32(ddlUpdateCountry.SelectedValue.ToString()));
            //        btnClose.Focus();
            //        break;
            //    case "Seach":
            //        //States_List(gvState, "select State_Id,State_Name,Isactive from tbl_Admin_State where State_Name Like '" + txtSearch.Text + "%' Order by State_Name");
            //        break;
            //}

            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Save":
                if (lblDumpBudId.Text == "2")
                {
                    lblTitle.Text           = "Budget Settings";
                    txtPromoter.Text        = "0";
                    txtPromoter.Enabled     = false;
                    txtVideoSharing.Enabled = false;
                    txtVideoSharing.Text    = "0";

                    if (txtAddBudget.Text.Trim() != "" && txtAdmin.Text.Trim() != "" && txtShortFilm.Text.Trim() != "" && txtVideoSharing.Text.Trim() != "")
                    {
                        if ((Convert.ToDecimal(txtShortFilm.Text.Trim()) + Convert.ToDecimal(txtAdmin.Text.Trim())) == Convert.ToDecimal(txtAddBudget.Text.Trim()))
                        {
                            DataSet objDataSet = MasterCode.RetrieveQuery("update tbl_Budget_Settings set Budget=" + txtAddBudget.Text.Trim() + ",Short_Film=" + txtShortFilm.Text.Trim() + ",Admin=" + txtAdmin.Text.Trim() + ",Promoter=" + txtPromoter.Text.Trim() + ",Video_Sharing=" + txtVideoSharing.Text.Trim() + " where Budget_Settings_Id=2");

                            ShowNotification("Budget Settings", "Updated Successfully..", NotificationType.success);
                            Display();
                            clear();
                        }
                        else
                        {
                            ShowNotification("Budget Settings", "Invalid Budget..!", NotificationType.error);
                        }
                    }
                    else
                    {
                        ShowNotification("Budget Settings", "Please Fill All Fields..!", NotificationType.error);
                    }
                }
                else if (lblDumpBudId.Text == "1")
                {
                    lblTitle.Text           = "Budget Settings With Promoter";
                    txtPromoter.Enabled     = true;
                    txtVideoSharing.Enabled = false;

                    if (txtAddBudget.Text.Trim() != "" && txtAdmin.Text.Trim() != "" && txtShortFilm.Text.Trim() != "" && txtVideoSharing.Text.Trim() != "" && txtPromoter.Text.Trim() != "")
                    {
                        if ((Convert.ToDecimal(txtShortFilm.Text.Trim()) + Convert.ToDecimal(txtAdmin.Text.Trim()) + Convert.ToDecimal(txtPromoter.Text.Trim())) == Convert.ToDecimal(txtAddBudget.Text.Trim()))
                        {
                            DataSet objDataSet = MasterCode.RetrieveQuery("update tbl_Budget_Settings set Budget=" + txtAddBudget.Text.Trim() + ",Short_Film=" + txtShortFilm.Text.Trim() + ",Admin=" + txtAdmin.Text.Trim() + ",Promoter=" + txtPromoter.Text.Trim() + ",Video_Sharing=" + txtVideoSharing.Text.Trim() + " where Budget_Settings_Id=1");

                            ShowNotification("Budget Settings with Promoter", "Updated Successfully..", NotificationType.success);
                            Display();
                            clear();
                        }
                        else
                        {
                            ShowNotification("Budget Settings with Promoter", "Invalid Budget..!", NotificationType.error);
                        }
                    }
                    else
                    {
                        ShowNotification("Budget Settings with Promoter", "Please Fill All Fields..!", NotificationType.error);
                    }
                }
                else if (lblDumpBudId.Text == "3")
                {
                    lblTitle.Text           = "Budget Settings with sharing";
                    txtPromoter.Enabled     = false;
                    txtVideoSharing.Enabled = true;

                    if (txtAddBudget.Text.Trim() != "" && txtAdmin.Text.Trim() != "" && txtShortFilm.Text.Trim() != "" && txtVideoSharing.Text.Trim() != "" && txtPromoter.Text.Trim() != "")
                    {
                        if ((Convert.ToDecimal(txtShortFilm.Text.Trim()) + Convert.ToDecimal(txtAdmin.Text.Trim()) + Convert.ToDecimal(txtVideoSharing.Text.Trim()) + Convert.ToDecimal(txtPromoter.Text.Trim())) == Convert.ToDecimal(txtAddBudget.Text.Trim()))
                        {
                            DataSet objDataSet = MasterCode.RetrieveQuery("update tbl_Budget_Settings set Budget=" + txtAddBudget.Text.Trim() + ",Short_Film=" + txtShortFilm.Text.Trim() + ",Admin=" + txtAdmin.Text.Trim() + ",Promoter=" + txtPromoter.Text.Trim() + ",Video_Sharing=" + txtVideoSharing.Text.Trim() + " where Budget_Settings_Id=3");

                            ShowNotification("Budget Settings with Promoter", "Updated Successfully..", NotificationType.success);
                            Display();
                            clear();
                        }
                        else
                        {
                            ShowNotification("Budget Settings with Promoter", "Invalid Budget..!", NotificationType.error);
                        }
                    }
                    else
                    {
                        ShowNotification("Budget Settings with Promoter", "Please Fill All Fields..!", NotificationType.error);
                    }
                }
                else if (lblDumpBudId.Text == "4")
                {
                    lblTitle.Text           = "Budget Settings with sharing and promoter";
                    txtPromoter.Enabled     = true;
                    txtVideoSharing.Enabled = true;

                    if (txtAddBudget.Text.Trim() != "" && txtAdmin.Text.Trim() != "" && txtShortFilm.Text.Trim() != "" && txtVideoSharing.Text.Trim() != "" && txtPromoter.Text.Trim() != "")
                    {
                        if ((Convert.ToDecimal(txtShortFilm.Text.Trim()) + Convert.ToDecimal(txtAdmin.Text.Trim()) + Convert.ToDecimal(txtVideoSharing.Text.Trim()) + Convert.ToDecimal(txtPromoter.Text.Trim())) == Convert.ToDecimal(txtAddBudget.Text.Trim()))
                        {
                            DataSet objDataSet = MasterCode.RetrieveQuery("update tbl_Budget_Settings set Budget=" + txtAddBudget.Text.Trim() + ",Short_Film=" + txtShortFilm.Text.Trim() + ",Admin=" + txtAdmin.Text.Trim() + ",Promoter=" + txtPromoter.Text.Trim() + ",Video_Sharing=" + txtVideoSharing.Text.Trim() + " where Budget_Settings_Id=4");

                            ShowNotification("Budget Settings", "Updated Successfully..", NotificationType.success);
                            Display();
                            clear();
                        }
                        else
                        {
                            ShowNotification("Budget Settings", "Invalid Budget..!", NotificationType.error);
                        }
                    }
                    else
                    {
                        ShowNotification("Budget Settings", "Please Fill All Fields..!", NotificationType.error);
                    }
                }



                break;

            case "PromoterSave":
                //if (txtAddBudget.Text.Trim() != "" && txtAdmin.Text.Trim() != "" && txtShortFilm.Text.Trim() != "" && txtVideoSharing.Text.Trim() != "" && txtPromoter.Text.Trim() != "")
                //{
                //    if ((Convert.ToDecimal(txtShortFilm.Text.Trim()) + Convert.ToDecimal(txtAdmin.Text.Trim()) + Convert.ToDecimal(txtVideoSharing.Text.Trim()) + Convert.ToDecimal(txtPromoter.Text.Trim())) == Convert.ToDecimal(txtAddBudget.Text.Trim()))
                //    {
                //        DataSet objDataSet = MasterCode.RetrieveQuery("update tbl_Budget_Settings set Budget=" + txtAddBudget.Text.Trim() + ",Short_Film=" + txtShortFilm.Text.Trim() + ",Admin=" + txtAdmin.Text.Trim() + ",Promoter=" + txtPromoter.Text.Trim() + ",Video_Sharing=" + txtVideoSharing.Text.Trim() + " where Budget_Settings_Id=1");
                //        txtAddBudget.Enabled = false;
                //        txtShortFilm.Enabled = false;
                //        txtAdmin.Enabled = false;
                //        txtPromoter.Enabled = false;
                //        txtVideoSharing.Enabled = false;

                //        ShowNotification("Budget Settings with Promoter", "Updated Successfully..", NotificationType.success);
                //        Display();
                //    }
                //    else
                //        ShowNotification("Budget Settings with Promoter", "Invalid Budget..!", NotificationType.error);
                //}
                //else
                //    ShowNotification("Budget Settings with Promoter", "Please Fill All Fields..!", NotificationType.error);

                break;

            case "Edit":
                txtAddBudget.Enabled    = true;
                txtShortFilm.Enabled    = true;
                txtAdmin.Enabled        = true;
                txtVideoSharing.Enabled = true;
                break;

            case "PromoterEdit":
                //txtAddBudget.Enabled = true;
                //txtShortFilm.Enabled = true;
                //txtAdmin.Enabled = true;
                //txtPromoter.Enabled = true;
                //txtVideoSharing.Enabled = true;
                break;

            case "Clear":
                txtAddBudget.Text    = "";
                txtShortFilm.Text    = "";
                txtAdmin.Text        = "";
                txtPromoter.Text     = "";
                txtVideoSharing.Text = "";
                break;

            case "PromoterClear":
                //txtAddBudget.Text = "";
                //txtShortFilm.Text = "";
                //txtAdmin.Text = "";
                //txtPromoter.Text = "";
                //txtVideoSharing.Text = "";
                break;
            }
        }
        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);
            ShowNotification("State", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
    protected void btn_Click(object sender, EventArgs e)
    {
        try
        {
            Button btn = sender as Button;
            switch (btn.CommandName)
            {
            case "Save":

                if (txtURL.Text.Trim() != "" && lblID.Text.Trim() != "" && ddlLanguage.SelectedIndex != 0)
                {
                    Short_Film objShort_Film = new Short_Film();

                    objShort_Film.CreatedDate = DateTime.Now.AddHours(Connection.SetHours);
                    objShort_Film.UserId      = Convert.ToInt32(Session["UserId"].ToString());

                    objShort_Film.Short_film_Id = Convert.ToInt32(lblID.Text.Trim());

                    string   Url1      = txtURL.Text.Trim();
                    string[] SplitUrl1 = Url1.Split('/');
                    string   NewUrl1   = "";
                    if (SplitUrl1.Length != 0)
                    {
                        for (int i = 0; i < SplitUrl1.Length; i++)
                        {
                            if (i == 1)
                            {
                                NewUrl1 = NewUrl1 + "//player." + SplitUrl1[i].ToString();
                            }
                            else if (i == 3)
                            {
                                NewUrl1 = NewUrl1 + "/video/" + SplitUrl1[i].ToString();
                            }
                            else
                            {
                                NewUrl1 = NewUrl1 + SplitUrl1[i].ToString();
                            }
                        }
                    }

                    objShort_Film.Trailer  = NewUrl1;
                    objShort_Film.Language = ddlLanguage.SelectedValue.ToString();

                    DataSet objDataSet = Short_Film.Trailer_Send_To_DB(objShort_Film, (DataTable)ViewState["Artist"]);
                    if (objDataSet.Tables[0].Rows[0][0].ToString() == "1")
                    {
                        ShowNotification("Trailer", "Your trailer is uploaded successfully and we will inform you shortly once it got approved", NotificationType.success);

                        ddlTitle.SelectedIndex    = 0;
                        txtTag.Text               = "";
                        ddlLanguage.SelectedIndex = 0;
                        lblID.Text = "";

                        if (Session["UserName"] == "admin")
                        {
                            Titles_List(gvTitle, "select Title_Id,Title_Name,Isactive,Tag,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(Languages,',',1))FOR XML PATH (''))as Languages,CreatedById,Languages as Languages1 from tbl_Register_Title Order by Title_Name");
                        }
                        else
                        {
                            Titles_List(gvTitle, "select Title_Id,Title_Name,Isactive,Tag,(Select ','+Language_Name from tbl_admin_language where Language_Id in (select val from fn_String_To_Table(Languages,',',1))FOR XML PATH (''))as Languages,Languages as Languages1 from tbl_Register_Title where CreatedById='" + Session["UserId"].ToString() + "' Order by Title_Name");
                        }
                    }
                }
                else
                {
                    ShowNotification("Trailer", "Please Select Trailer..!", NotificationType.error);
                }
                break;

            case "Clear":
                ddlTitle.SelectedIndex    = 0;
                txtTag.Text               = "";
                ddlLanguage.SelectedIndex = 0;
                lblID.Text = "";
                break;

            case "Update":

                string ULanguesIds = ",";
                for (int i = 0; i < lstUpdateLanguage.Items.Count; i++)
                {
                    if (lstUpdateLanguage.Items[i].Selected)
                    {
                        ULanguesIds = ULanguesIds + lstUpdateLanguage.Items[i].Value.ToString() + ",";
                    }
                }
                btnClose.Focus();
                break;

            case "Seach":

                break;
            }
        }
        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);
            ShowNotification("Title", dispErrorMsg, NotificationType.error);
            SendLogFile.SendMail();
        }
    }
示例#29
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            if (txtUsernameForforgetpass.Text.Trim() != "")
            {
                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='fgPass'");
                    if (objDataSetChk.Tables[0].Rows[0]["Email"].ToString() == "True")
                    {
                        SendEmail.createEmailBody(objDataSet.Tables[0].Rows[0]["Name"].ToString(), objDataSet.Tables[0].Rows[0]["EmailId"].ToString(), objDataSet.Tables[0].Rows[0]["Mobile_No"].ToString(), objDataSet.Tables[0].Rows[0]["EmailId"].ToString(), objDataSet.Tables[0].Rows[0]["Password"].ToString(), @"ForgetPass.html");

                        //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>&nbsp;</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>&nbsp;</td></tr>" +
                        //              "</table></td></tr><tr><td>&nbsp;</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&nbsp;&nbsp;<br />nscreens.com&nbsp;&nbsp;</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("Forgot Password", "Password send successfully..", NotificationType.success);
                        txtUsernameForforgetpass.Text = "";
                    }
                    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 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());
                        }
                    }
                }
                else
                {
                    ShowNotification("Forgot Password", "Sorry, Invalid Email Address..!", NotificationType.error);
                }
            }
            else
            {
                ShowNotification("Forgot Password", "Please Enter EmailId..!", 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("Forgot Password", "Sorry, Mail not sent due to Network problem.. Please Try Again..!", NotificationType.error);
        }
    }
示例#30
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        try
        {
            if (txtUserName.Text.Trim() != "" && txtPassword.Text != "")
            {
                objDataSet = MasterCode.RetrieveQuery("select User_Id,Isactive,Username,UserCode,UserRights,Staff_Id from tbl_user where Username='******' and Password='******'");

                if (objDataSet.Tables[0].Rows.Count > 0)
                {
                    string IsActive = (objDataSet.Tables[0].Rows[0][1].ToString());
                    string UserIP   = Request.UserHostAddress;

                    if (IsActive == "True")
                    {
                        DataSet objDataSet1 = null;
                        if (objDataSet.Tables[0].Rows[0]["Username"].ToString() != "admin")
                        {
                            objDataSet1     = MasterCode.RetrieveQuery("Select Name from tbl_Register_User where Register_Id=" + objDataSet.Tables[0].Rows[0]["Staff_Id"].ToString());
                            Session["Name"] = objDataSet1.Tables[0].Rows[0]["Name"].ToString();
                        }
                        else
                        {
                            Session["Name"] = "admin";
                        }

                        Session["UserId"]   = Convert.ToInt32(objDataSet.Tables[0].Rows[0]["User_Id"].ToString());
                        Session["UserCode"] = objDataSet.Tables[0].Rows[0]["Usercode"].ToString();
                        Session["UserName"] = objDataSet.Tables[0].Rows[0]["Username"].ToString();

                        objMaster.UserName  = txtUserName.Text.Trim();
                        objMaster.Password  = txtPassword.Text.Trim();
                        objMaster.IPAddress = UserIP;
                        objMaster.DateTime  = DateTime.Now.AddHours(Connection.SetHours);
                        objMaster.UserId    = Convert.ToInt32(Session["UserId"].ToString());

                        DataSet objDataSetLoginId = MasterCode.InsertLoginDetails(objMaster);
                        if (objDataSetLoginId.Tables[0].Rows.Count > 0)
                        {
                            Session["LoginId"] = objDataSetLoginId.Tables[0].Rows[0][0].ToString();
                        }
                        DataTable menuData = new DataTable();
                        menuData = GetMenuData(objDataSet.Tables[0].Rows[0]["UserRights"].ToString());
                        AddTopMenuItems(menuData);
                        Session["Menu"] = menu.Replace("<ul></ul>", "");
                        //if (objDataSet.Tables[0].Rows[0]["User_Id"].ToString() == "1" || objDataSet.Tables[0].Rows[0]["User_Id"].ToString() == "2" || objDataSet.Tables[0].Rows[0]["User_Id"].ToString() == "3")
                        if (Session["RedirectURL"] == null)
                        {
                            Response.Redirect("Admin/frmHome.aspx", false);
                        }
                        else
                        {
                            Response.Redirect(Session["RedirectURL"].ToString(), false);
                            Session["RedirectURL"] = null;
                        }
                        //else
                        //    Response.Redirect("User/UserHome.aspx", false);
                    }
                    else
                    {
                        ShowNotification("Login", "Please Contact Administrator..!", NotificationType.error);
                    }
                }
                else
                {
                    DateTime Date = DateTime.Today;
                    objMaster.UserName  = txtUserName.Text.Trim();
                    objMaster.Password  = txtPassword.Text.Trim();
                    objMaster.IPAddress = Request.UserHostAddress;
                    objMaster.DateTime  = Date;

                    MasterCode.InsertFail(objMaster);

                    objDataSet = objMaster.GetCount(txtUserName.Text.Trim(), Request.UserHostAddress, Date);

                    if (objDataSet.Tables[0].Rows.Count >= 3)
                    {
                        objMaster.IsActive = "False";
                        objMaster.UserName = txtUserName.Text.Trim();
                        Session["count"]   = 0;

                        int b = objMaster.Block();
                        if (b != 0)
                        {
                            ShowNotification("Login", "Your Login is Blocked", NotificationType.error);
                            Session["UserId"] = "0";
                        }
                    }
                    else
                    {
                        ShowNotification("Login", "Invalid Login!", NotificationType.error);
                        Session["UserId"] = "0";
                    }
                }
            }
            else
            {
                ShowNotification("Login", "Please Enter 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("Login", "Database is not Connected Properly..!", NotificationType.error);
        }
    }