Example #1
0
 public void AddRecord()
 {
     try
     {
         string Sql   = "Select KeyId from KeywordInformation where KeywordName='" + txtKeyword.Text + "' ";
         string KeyId = Convert.ToString(cc.ExecuteScalar(Sql));
         if (KeyId == "" || KeyId == null)
         {
             KBLL.KeywordName1    = Convert.ToString(txtKeyword.Text);
             KBLL.KeywordSyntax1  = Convert.ToString(txtSyntax.Text);
             KBLL.KeywordPurpose1 = Convert.ToString(txtPurpose.Text);
             KBLL.KeyDiscip1      = Convert.ToString(txtDiscrip.Text);
             KBLL.WebsiteGroup1   = Convert.ToString(ddlWebSite.SelectedValue);
             KBLL.EntryDate1      = Convert.ToString(DateFormat);
             int status = KBLL.AddInfo(KBLL);
             if (status == 1)
             {
                 LoadData();
                 Clear();
                 Response.Write("<script>alert('Record Inserted.............!')</script>");
             }
             else
             {
             }
         }
     }
     catch (Exception ex)
     { }
 }
Example #2
0
    public void AddRecord()
    {
        string str = "select GID from [Come2myCityDB].[dbo].[tbl_BCreateGat] where GatName='" + ddlGID.SelectedItem.ToString() + "'";
        string sql = cc.ExecuteScalar(str);

        objBMemRegBLL.GID1      = Convert.ToString(sql);
        objBMemRegBLL.FName1    = Convert.ToString(txtFName.Text);
        objBMemRegBLL.LName1    = Convert.ToString(txtLName.Text);
        objBMemRegBLL.MobileNo1 = Convert.ToString(txtMobileNo.Text);

        objBMemRegBLL.Post1         = Convert.ToString(ddlPost.Text);
        objBMemRegBLL.DOJ1          = Convert.ToString(txtdate.Text);
        objBMemRegBLL.Subscription1 = Convert.ToString(txtSub.Text);
        objBMemRegBLL.Deposite1     = Convert.ToString(txtDeposit.Text);
        objBMemRegBLL.Loan1         = Convert.ToString(txtLoan.Text);
        objBMemRegBLL.UserId1       = Convert.ToString(Session["User"]);
        int Status = objBMemRegBLL.AddRecordBLL(objBMemRegBLL);

        if (Status == 1)
        {
            LoadGrid();
            clear();
            ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Event Added Successfully')", true);
        }
    }
Example #3
0
    public void insertrecord()
    {
        usrBLL.usrMobileNo = txtmobileno.Text;
        string sqlfetch = "select usrUserid from usermaster where usrMobileNo='" + usrBLL.usrMobileNo + "'";
        string userid   = cc.ExecuteScalar(sqlfetch);

        status = usrBLL.BLLIsExistUserRegistrationInitial(usrBLL);
        if (status == 0)
        {
            string sqlcheck = "select id from SMSstatus where Userid='" + userid + "' ";
            string id       = cc.ExecuteScalar(sqlcheck);
            if (id == null || id == "")
            {
                DateTime datetime  = DateTime.Now;
                string   smsstatus = "Deactive";

                string sql         = "insert into SMSstatus(Userid,SMS_status,sms_date)values('" + userid + "','" + smsstatus + "','" + datetime + "')";
                string insertvalue = cc.ExecuteScalar(sql);

                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('SMS menu is deactivated successfully')", true);
            }
            //else
            //{
            //    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('SMS menu is already deactivated to your account ')", true);

            //}
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('This number is not registered to www.myct.in')", true);
        }
        gridshow();
    }
Example #4
0
    public int BLLTestUserFriendRelative(CommonSqlQueryCode ur)
    {
        SqlConnection con1 = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
        int           flag = 0;

        try
        {
            string sql     = "select FriRelId from friendRelationmaster where Userid='" + ur.frnrelUserId + "'and FriendId='" + ur.frnrelFriendId + "'";
            string newflag = ccr.ExecuteScalar(sql);
            if (newflag.ToString() != "")
            {
                flag = Convert.ToInt32(ccr.ExecuteScalar(sql));
            }

            if (flag > 0)
            {
                flag = 1;
            }
            else
            {
                flag = 0;
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con1.Close();
        }
        return(flag);
    }
Example #5
0
    private void downloadfile(string id)
    {
        string        sql      = "select FileName from committeedetail where Committee_url='" + strMyUrl + "'";
        string        filename = cc.ExecuteScalar(sql);
        DirectoryInfo di       = new DirectoryInfo(Server.MapPath("~/downloadfileSMT/" + filename + ""));

        fileDownload("'" + filename + "'", di.ToString(), id);
    }
Example #6
0
 public void CountTotal()
 {
     try
     {
         string Sql = "SELECT count([SendFrom]) FROM [Come2MyCityDB].[come2mycity].[sendSMSstatus] where CONVERT(NVARCHAR(25), sendDateTime, 126) like '" + DateFormat + "%' ";
         lblTotal.Text = Convert.ToString(cc.ExecuteScalar(Sql));
     }
     catch (Exception ex)
     { }
 }
Example #7
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        string cls = Convert.ToString(txtClassAdd.Text);

        if (cls.ToString() != "")
        {
            string sqlFind = "select ClassId from ClassMaster where ClassName='" + cls.ToString() + "'";
            string find    = "";
            find = Convert.ToString(cc.ExecuteScalar(sqlFind));
            if (find.ToString() == "")
            {
                string addStr = "insert into ClassMaster (ClassName) values('" + cls.ToString() + "')";
                int    jjj    = cc.ExecuteNonQuery(addStr);
                if (jjj > 0)
                {
                    txtClassAdd.Text = "";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Class added.')", true);
                }
            }
            else
            {
                txtClassAdd.Text = "";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Class Already Added.')", true);
            }
        }
        else
        {
            txtClassAdd.Text = "";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Enter Class Name.')", true);
        }

        FillClassList();
        //CheckBox1.Checked = false;
        txtClassAdd.Text = "";
    }
Example #8
0
    private void PopulateRootLevelM()
    {
        string sql1 = "";

        UserName = Convert.ToString(Session["MarketingUser"]);
        SqlConnection cn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);

        if (UserName == "Admin")
        {
            sql1 = "select usrMobileNo as FullName,usrFirstName+''+usrLastName as name,id,userid,(select count(*) FROM TreeDemo WHERE parentID=sc.id) childnodecount FROM TreeDemo sc inner join usermaster" +
                   " on usrUserId =userid where  parentID=0";
            SqlCommand     cmd = new SqlCommand(sql1, cn);
            SqlDataAdapter da  = new SqlDataAdapter(cmd);
            DataTable      dt  = new DataTable();
            da.Fill(dt);
            PopulateNodesM(dt, TreeView1.Nodes);
        }
        else
        {
            string query  = "select roleid from AdminSubMarketingSubUser where friendid='" + UserName + "'";
            string roleid = cc.ExecuteScalar(query);
            if (roleid == "2")
            {
                sql1 = "select friendid from AdminSubMarketingSubUser where userid='" + UserName + "'";
                DataSet ds = cc.ExecuteDataset(sql1);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    string userid = Convert.ToString(dr["friendid"]);
                    sql1 = "select usrMobileNo as FullName,usrFirstName+''+usrLastName as name,id,userid,(select count(*) FROM TreeDemo WHERE parentID=sc.id) childnodecount FROM TreeDemo sc inner join usermaster on usrUserId =userid where userid='" + userid + "' and parentID=0";
                    SqlCommand     cmd = new SqlCommand(sql1, cn);
                    SqlDataAdapter da  = new SqlDataAdapter(cmd);
                    DataTable      dt  = new DataTable();
                    da.Fill(dt);
                    PopulateNodesM(dt, TreeView1.Nodes);
                }
            }
            else
            {
                string query1   = "select id from Treedemo where userid='" + UserName + "'";
                string parentid = cc.ExecuteScalar(query1);
                sql1 = "select friendid from AdminSubMarketingSubUser where userid='" + UserName + "'";
                DataSet ds = cc.ExecuteDataset(sql1);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    string userid = Convert.ToString(dr["friendid"]);
                    sql1 = "select usrMobileNo as FullName,usrFirstName+''+usrLastName as name,id,userid,(select count(*) FROM TreeDemo WHERE parentID=sc.id) childnodecount FROM TreeDemo sc inner join usermaster on usrUserId =userid where userid='" + userid + "' and parentID='" + parentid + "'";
                    SqlCommand     cmd = new SqlCommand(sql1, cn);
                    SqlDataAdapter da  = new SqlDataAdapter(cmd);
                    DataTable      dt  = new DataTable();
                    da.Fill(dt);
                    PopulateNodesM(dt, TreeView1.Nodes);
                }
            }
        }
    }
Example #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.ContentType = "image/jpg";


        string strMyUrl = System.Web.HttpContext.Current.Request.Url.ToString();
        //string strMyUrl = "http://www.myct.in/NCP/down.aspx?207935f2fd";

        string  fetchsql    = "select usr_url from frienddownloadlink where frnd_url='" + strMyUrl + "'";
        string  a           = cc.ExecuteScalar(fetchsql);
        string  fetchsql2   = "select folderuserid,actual_filename from uploaddetails where url='" + a + "' ";
        DataSet ds          = cc.ExecuteDataset(fetchsql2);
        string  foldername  = Convert.ToString(ds.Tables[0].Rows[0]["folderuserid"]);
        string  actualfname = Convert.ToString(ds.Tables[0].Rows[0]["actual_filename"]);

        string[] newurl       = strMyUrl.Split('?');
        string   firsturl     = newurl[0];
        string   userResource = "User_Resource/";

        firsturl = firsturl + userResource + newurl[1];

        DirectoryInfo di = new DirectoryInfo(Server.MapPath("~/User_Resource/" + foldername + ("/")));
        string        s6 = Server.MapPath("");
        int           i  = 0;

        foreach (FileInfo fi in di.GetFiles())
        {
            //if (System.IO.Path.GetExtension(di.Name).ToLower() != ".mp3" && System.IO.Path.GetExtension(di.Name).ToLower() != ".flv" && System.IO.Path.GetExtension(di.Name).ToLower() != ".avi" && System.IO.Path.GetExtension(di.Name).ToLower() != ".xlsx" && System.IO.Path.GetExtension(di.Name).ToLower() != ".pdf" && System.IO.Path.GetExtension(di.Name).ToLower() != ".jpg" && System.IO.Path.GetExtension(di.Name).ToLower() != ".png" && System.IO.Path.GetExtension(di.Name).ToLower() != ".gif" && System.IO.Path.GetExtension(di.Name).ToLower() != ".jpeg")
            if (System.IO.Path.GetExtension(di.Name).ToLower() != ".wav" && System.IO.Path.GetExtension(di.Name).ToLower() != ".mp4" && System.IO.Path.GetExtension(di.Name).ToLower() != ".txt" && System.IO.Path.GetExtension(di.Name).ToLower() != ".doc" && System.IO.Path.GetExtension(di.Name).ToLower() != ".xlsx" && System.IO.Path.GetExtension(di.Name).ToLower() != ".mp3" && System.IO.Path.GetExtension(di.Name).ToLower() != ".flv" && System.IO.Path.GetExtension(di.Name).ToLower() != ".avi" && System.IO.Path.GetExtension(di.Name).ToLower() != ".xls" && System.IO.Path.GetExtension(di.Name).ToLower() != ".pdf" && System.IO.Path.GetExtension(di.Name).ToLower() != ".jpg" && System.IO.Path.GetExtension(di.Name).ToLower() != ".png" && System.IO.Path.GetExtension(di.Name).ToLower() != ".gif" && System.IO.Path.GetExtension(di.Name).ToLower() != ".jpeg" && System.IO.Path.GetExtension(di.Name).ToLower() != ".csv")
            {
                string Sql = "insert into DownloadFile_Details(FileLink)values('" + di.FullName + "')";
                ds = cc.ExecuteDataset(Sql);
                if (fi.Name == actualfname)
                {
                    string sqlshow = "select flag from frienddownloadlink  where frnd_url='" + strMyUrl + "'";
                    string check   = cc.ExecuteScalar(sqlshow);
                    if (check == "Active")
                    {
                        fileDownload(fi.Name, di.FullName + fi.Name);
                        string updatequery = "update frienddownloadlink set flag='Deactive' where frnd_url='" + strMyUrl + "'";
                        int    deac        = cc.ExecuteNonQuery(updatequery);
                    }
                    else
                    {
                        Label1.Visible = true;
                        Label1.Text    = "You have already downloaded this file !!";
                        //Response.Write("You have already downloaded this file");
                    }
                }


                //fileDownload(fi.Name, Server.MapPath("~/User_Resource/02db0deb-c7b9-4843-ae4e-5d59834af43b/" + fi.Name));
            }
        }
    }
Example #10
0
    public int DALExistcompanyno(BLLCompanyDetails obj)
    {
        using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]))
        {
            try
            {
                string sql = "select companyid from companydetails where contactno='" + obj.Contactno + "' ";
                string id  = cc.ExecuteScalar(sql);
                if (id == "")
                {
                    status = 1;
                }
                else
                {
                    status = 0;
                }
            }


            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
        }
        return(status);
    }
Example #11
0
    public void GetAbstract()
    {
        try
        {
            string Sql = "select UDISE_StudentPresenty.SchoolCode,EntryDate, SUM(RegBoys) as RegBoys,SUM(RegGirls)as RegGirls,SUM(Present_B)as Present_B,SUM(Present_G)as Present_G " +
                         "from UDISE_StudentPresenty where UDISE_StudentPresenty.EntryDate='" + DateFormat + "' " +
                         "GROUP BY EntryDate,SchoolCode";
            ds = cc.ExecuteDataset(Sql);
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                SchoolCode = Convert.ToString(ds.Tables[0].Rows[i]["SchoolCode"]);
                EntryDate  = Convert.ToString(ds.Tables[0].Rows[i]["EntryDate"]);
                RegBoys    = Convert.ToString(ds.Tables[0].Rows[i]["RegBoys"]);
                RegGirls   = Convert.ToString(ds.Tables[0].Rows[i]["RegGirls"]);
                Present_B  = Convert.ToString(ds.Tables[0].Rows[i]["Present_B"]);
                Present_G  = Convert.ToString(ds.Tables[0].Rows[i]["Present_G"]);

                string AspPreSql = "Select EntryDate from UDISE_AbstractSchoolPresenty where SchoolCode='" + SchoolCode + "' and EntryDate='" + DateFormat + "'";
                string ChkEntry  = Convert.ToString(cc.ExecuteScalar(AspPreSql));
                if (ChkEntry == "" || ChkEntry == null)
                {
                    string AddStudPre = "Insert into UDISE_AbstractSchoolPresenty (SchoolCode,EntryDate,RegBoys,RegGirls,Present_B,Present_G)" +
                                        " values('" + SchoolCode + "','" + DateFormat + "','" + RegBoys + "','" + RegGirls + "','" + Present_B + "','" + Present_G + "')";
                    int a = cc.ExecuteNonQuery(AddStudPre);
                    if (a == 1)
                    {
                    }
                }
                else
                {
                    string  ChkEntryPre = "Select Sum(RegBoys)as RegBoys,Sum(RegGirls)as RegGirls,Sum(Present_B)as Present_B,Sum(Present_G)as Present_G from UDISE_StudentPresenty where SchoolCode='" + SchoolCode + "' and EntryDate ='" + DateFormat + "'";
                    DataSet ds1         = cc.ExecuteDataset(ChkEntryPre);
                    if (ds1.Tables[0].Rows.Count > 0)
                    {
                        string RegBoys1   = Convert.ToString(ds1.Tables[0].Rows[0]["RegBoys"]);
                        string RegGirls1  = Convert.ToString(ds1.Tables[0].Rows[0]["RegGirls"]);
                        string Present_B1 = Convert.ToString(ds1.Tables[0].Rows[0]["Present_B"]);
                        string Present_G1 = Convert.ToString(ds1.Tables[0].Rows[0]["Present_G"]);

                        string UpdateTotal = "Update UDISE_AbstractSchoolPresenty set RegBoys=" + RegBoys1 + " , RegGirls=" + RegGirls1 + ", Present_B=" + Present_B1 + ",Present_G=" + Present_G1 + "" +
                                             " where SchoolCode='" + SchoolCode + "' and EntryDate ='" + DateFormat + "'";
                        int b = cc.ExecuteNonQuery(UpdateTotal);
                        if (b == 1)
                        {
                        }
                    }
                }
            }
            ZeroAttendence();
        }
        catch (Exception ex)
        { }
    }
Example #12
0
    private string Profile(string Bstring, string MobileNo)
    {
        string[] stringArray        = Bstring.Split(new char[] { '#', '*' });
        string   nonInsertedValues  = string.Empty;
        string   nonInsertedValues1 = string.Empty;
        int      result;
        string   uid = System.Guid.NewGuid().ToString();
        string   st  = "select usrUserId from UserMaster where usrMobileNo='" + MobileNo + "'";

        uid = cc.ExecuteScalar(st);
        if (uid == "" || uid == null)
        {
            for (int i = 1; i < stringArray.Length; i += 13)
            {
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]);

                cmd.Parameters.Add(new SqlParameter("@usrFirstName", stringArray[i].ToString()));
                cmd.Parameters.Add(new SqlParameter("@usrLastName", stringArray[i + 1].ToString()));
                cmd.Parameters.Add(new SqlParameter("@usrMobileNo", stringArray[i + 2].ToString()));
                cmd.Parameters.Add(new SqlParameter("@usrEmailId", stringArray[i + 3].ToString()));
                cmd.Parameters.Add(new SqlParameter("@usrAddress", stringArray[i + 4].ToString()));
                cmd.Parameters.Add(new SqlParameter("@usrState", stringArray[i + 5].ToString()));
                cmd.Parameters.Add(new SqlParameter("@strDevId", stringArray[i + 6].ToString()));
                cmd.Parameters.Add(new SqlParameter("@usrDistrict", stringArray[i + 7].ToString()));
                cmd.Parameters.Add(new SqlParameter("@usrTaluka", stringArray[i + 8].ToString()));
                cmd.Parameters.Add(new SqlParameter("@usrCity", stringArray[i + 9].ToString()));
                cmd.Parameters.Add(new SqlParameter("@usrUserId", uid));


                cmd.CommandText = "uspMYCTUserMasterInsert";
                cmd.CommandType = CommandType.StoredProcedure;
                if (cmd.Connection.State == ConnectionState.Closed)
                {
                    cmd.Connection.Open();
                }
                result = cmd.ExecuteNonQuery();
                //string str = "select max(GID) from [Come2myCityDB].[dbo].[tbl_BCreateGat] ";
                //string str1 = cc.ExecuteScalar(str);
                //nonInsertedValues1 += str1 + "*";
            }
        }
        if (string.IsNullOrEmpty(nonInsertedValues))
        {
            string sql = CommonCode.OK.ToString();
            return(sql + nonInsertedValues1);
        }
        else
        {
            return(nonInsertedValues);
        }
    }
Example #13
0
    public void btnGetCoordinates()
    {
        Adress adrs = new Adress();
        string sql1 = "Select usrAddress from UserMaster where usrUserId='" + Convert.ToString(Session["User"]) + "' ";

        Address = Convert.ToString(cc.ExecuteScalar(sql1));

        adrs.Address = Address;
        adrs.GeoCode();
        lblLattitude.Text  = adrs.Latitude;
        lblLongtitude.Text = adrs.Longitude;
        AddControl();
    }
Example #14
0
    private string PWPlayer(string PWPString, string UserMobileNo)
    {
        int result;

        string[] StringArray        = PWPString.Split(new char[] { '#', '*' });
        string   nonInsertedValues  = string.Empty;
        string   nonInsertedValues1 = string.Empty;

        for (int i = 1; i < StringArray.Length; i += 13)
        {
            SqlCommand    cmd = new SqlCommand();
            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]);
            cmd.Connection = con;
            if (StringArray[i].ToString() == "0")
            {
                cmd.Parameters.Add(new SqlParameter("@MobileNo", StringArray[i + 1].ToString()));
                cmd.Parameters.Add(new SqlParameter("@FName", StringArray[i + 2].ToString()));
                cmd.Parameters.Add(new SqlParameter("@LName", StringArray[i + 3].ToString()));
                cmd.Parameters.Add(new SqlParameter("@Remark", StringArray[i + 4].ToString()));
                cmd.Parameters.Add(new SqlParameter("@Position", StringArray[i + 5].ToString()));
                cmd.Parameters.Add(new SqlParameter("@Experience", StringArray[i + 6].ToString()));
                cmd.Parameters.Add(new SqlParameter("@TeamRep", StringArray[i + 7].ToString()));
                cmd.Parameters.Add(new SqlParameter("@Summary", StringArray[i + 8].ToString()));
                cmd.Parameters.Add(new SqlParameter("@Duration", StringArray[i + 9].ToString()));
                cmd.Parameters.Add(new SqlParameter("@LinkPages", StringArray[i + 10].ToString()));
                cmd.Parameters.Add(new SqlParameter("@LoginMobileNo", UserMobileNo));
                cmd.Parameters.Add(new SqlParameter("@EntryDate", StringArray[i + 11].ToString()));
            }

            cmd.CommandText = "[come2mycity].[uspPWPInsertPlayer]";
            cmd.CommandType = CommandType.StoredProcedure;
            if (cmd.Connection.State == ConnectionState.Closed)
            {
                cmd.Connection.Open();
            }
            result = cmd.ExecuteNonQuery();
            string str  = "select max(PID) from [Come2myCityDB].[come2mycity].[PWP_tblPlayerInfo]";
            string str1 = cc.ExecuteScalar(str);
            nonInsertedValues1 += str1 + "*";
        }

        if (string.IsNullOrEmpty(nonInsertedValues))
        {
            string s = CommonCode.OK.ToString() + "*";
            return(s + nonInsertedValues1);
        }
        else
        {
            return(nonInsertedValues);
        }
    }
    private void InsertLongCodeRegistration()
    {
        try
        {
            if (rblText.SelectedItem.Text == "")
            {
                lblmisscalltype.Visible = true;
                Response.Write("<script>alert('Please Select Miss Call Type..!')</script>");
            }
            else
            {
                bllobjdatacollection.No_usefor        = rdbUserfor.SelectedItem.Value;
                bllobjdatacollection.Customername     = txtCustomerName.Text;
                bllobjdatacollection.Address          = txtCustomeraddress.Text;
                bllobjdatacollection.Customer_contact = txtmobileno.Text;
                bllobjdatacollection.SIMno            = txtsimno.Text;
                bllobjdatacollection.Mobileno         = txtContactNo.Text;
                string sql    = "select usrUserid from usermaster where usrMobileNo='" + txtContactNo.Text + "'";
                string userid = cc.ExecuteScalar(sql);
                bllobjdatacollection.IMEIMO        = txtIMINo.Text;
                bllobjdatacollection.Send_data     = ddlsenddata.SelectedValue;
                bllobjdatacollection.Regdate       = DateTime.Now.ToString();
                bllobjdatacollection.MissCallType1 = Convert.ToString(rblText.SelectedItem.Text);
                //bllobjdatacollection.ResponseMsg = txtMessage.Text;
                bllobjdatacollection.Customer_contact1 = txtContactNo2.Text;
                bllobjdatacollection.Customer_contact2 = txtContactNo3.Text;
                bllobjdatacollection.Customer_contact3 = txtContactNo4.Text;
                bllobjdatacollection.Customer_contact4 = txtContactNo5.Text;

                status = bllobjdatacollection.BLLInsertLongCodeRegistration(bllobjdatacollection);

                if (status == 1)
                {
                    string sql1 = "update [Come2myCityDB].[come2mycity].LongCodeRegistration set UsrUserid='" + userid + "' where IMEINO='" + txtIMINo.Text + "' and Sim_no='" + txtsimno.Text + "' and mobileno='" + txtContactNo.Text + "'";
                    string a    = cc.ExecuteScalar(sql1);
                    Longcodegridshow();
                    Response.Write("<script>alert('Record Inserted Successfully')</script>");
                }
                else
                {
                    Longcodegridshow();
                    Response.Write("<script>alert('Record Not Inserted ')</script>");
                }
                clearAll();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    public void Addrecord()
    {
        string str, result;

        if (txtCType.Text != "")
        {
            str = txtCType.Text;
            string sql = "select (ID) from [Come2myCityDB].[dbo].[tbl_Main_ID] where Name='" + str + "' ";
            result = cc.ExecuteScalar(sql);
        }
        else
        {
            str = DDLCType.SelectedItem.Text;
            string sql = "select (ID) from [Come2myCityDB].[dbo].[tbl_Main_ID] where Name='" + str + "' ";
            result = cc.ExecuteScalar(sql);
        }
        string str1, result1;

        if (txtCFDept.Text != "")
        {
            str1 = txtCFDept.Text;
            string sql1 = "select max(ID) from [Come2myCityDB].[dbo].[tbl_Main_ID] where Name='" + str1 + "' ";
            result1 = cc.ExecuteScalar(sql1);
        }
        else
        {
            str1 = DDLCFDept.SelectedItem.Text;
            string sql1 = "select max(ID) from [Come2myCityDB].[dbo].[tbl_Main_ID] where Name='" + str1 + "' ";
            result1 = cc.ExecuteScalar(sql1);
        }

        objECBLL.UserId1      = Convert.ToString(Session["User"]);
        objECBLL.CompType1    = Convert.ToString(result);
        objECBLL.Date1        = Convert.ToString(txtdate.Text);
        objECBLL.CompFDept1   = Convert.ToString(result1);
        objECBLL.CompName1    = Convert.ToString(txtCName.Text);
        objECBLL.CompSub1     = Convert.ToString(txtCSub.Text);
        objECBLL.CompDetails1 = Convert.ToString(txtCDetails.Text);
        objECBLL.Address1     = Convert.ToString(txtAddress.Text);
        objECBLL.MobileNo1    = Convert.ToString(txtMoblieNo.Text);
        int Status = objECBLL.AddrecordBLL(objECBLL);

        if (Status == 1)
        {
            Loadgrid();
            ////clear();
            ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Event Added Successfully')", true);
        }
    }
Example #17
0
    private void count()
    {
        try
        {
            string mono = Convert.ToString(Session["Mobile"]);

            string s = "select count(*) from MartketingSubuser where MUMono='" + mono + "' and Active='1'";
            string a = cc.ExecuteScalar(s);
            lblActiveCount.Text = "" + a.ToString();
        }
        catch (Exception ex)
        {
            string m = ex.Message;
        }
    }
Example #18
0
    private void downloadfile()
    {
        // Download http://www.myct.in/NCP/down.aspx?crtevnt http://www.myct.in/NCP/down.aspx?ict http://www.myct.in/NCP/down.aspx?w7o10 & ur login pswd fr myct.in= xxxxx
        //  if (strMyUrl == "http://localhost:50174/myctin/NCP.aspx?Win7&MS10")
        if (strMyUrl == "http://www.myct.in/NCP.aspx?crtevnt" || strMyUrl == "http://www.myct.in/ncp.aspx?crtevnt" || strMyUrl == "http://www.myct.in/NCP.aspx/crtevnt" || strMyUrl == "http://www.myct.in/ncp.aspx/crtevnt")
        {
            DirectoryInfo di = new DirectoryInfo(Server.MapPath("~/download files/current event.pdf"));

            fileDownload("current event.pdf", di.ToString());
        }
        // if (strMyUrl == "http://localhost:50174/myctin/NCP.aspx?Eevent")
        else if (strMyUrl == "http://www.myct.in/NCP.aspx?ict" || strMyUrl == "http://www.myct.in/NCP.aspx/ict" || strMyUrl == "http://www.myct.in/ncp.aspx?ict" || strMyUrl == "http://www.myct.in/ncp.aspx/ict")
        {
            DirectoryInfo di = new DirectoryInfo(Server.MapPath("~/download files/ICT.pdf"));
            fileDownload("ICT.pdf", di.ToString());
        }
        // if (strMyUrl == "http://localhost:50174/myctin/NCP.aspx?ebook")
        else if (strMyUrl == "http://www.myct.in/NCP.aspx?w7o10" || strMyUrl == "http://www.myct.in/NCP.aspx/w7o10" || strMyUrl == "http://www.myct.in/ncp.aspx?w7o10" || strMyUrl == "http://www.myct.in/ncp.aspx/w7o10")
        {
            DirectoryInfo di = new DirectoryInfo(Server.MapPath("~/download files/Test3.pdf"));

            fileDownload("Test3.pdf", di.ToString());
        }
        // else if (strMyUrl == "http://localhost:50438/myctin/ncp.aspx/pressnote")
        else if (strMyUrl == "http://www.myct.in/ncp.aspx/pressnote")
        {
            string        sql      = "select filename from committeedetail where Id=33";
            string        filename = cc.ExecuteScalar(sql);
            DirectoryInfo di       = new DirectoryInfo(Server.MapPath("~/download files/" + filename));
            fileDownload("'" + filename + "'", di.ToString());
        }
        else if (strMyUrl == "http://www.myct.in/ncp.aspx/videorelease")
        {
            string        sql      = "select filename from committeedetail where Id=35";
            string        filename = cc.ExecuteScalar(sql);
            DirectoryInfo di       = new DirectoryInfo(Server.MapPath("~/download files/" + filename));

            fileDownload("'" + filename + "'", di.ToString());
        }
        else if (strMyUrl == "http://www.myct.in/ncp.aspx/ncpmagazine")
        {
            string        sql      = "select filename from committeedetail where Id=34";
            string        filename = cc.ExecuteScalar(sql);
            DirectoryInfo di       = new DirectoryInfo(Server.MapPath("~/download files/" + filename));

            fileDownload("'" + filename + "'", di.ToString());
        }
    }
Example #19
0
    //protected void gvItem_RowDataBound(object sender, GridViewRowEventArgs e)
    //{
    //    DataSet ds = new DataSet();
    //    //string str =
    //    //            " with Event as( " +
    //    //            " select *from( " +
    //    //            " (SELECT ID,[MID] as m,[PreBalance],[LoanAmt],[DateOfIssue],[MInstalment],[DueDate] FROM [Come2myCityDB].[dbo].[tbl_BIssueLoan] where [UserId]='"+Session["User"]+"') as t" +
    //    //            " left join " +
    //    //            " [Come2myCityDB].[dbo].[tbl_BMRegistration] as t1 " +
    //    //            " on " +
    //    //            " t.m=t1.MID " +
    //    //            " ) " +
    //    //            " ) ";
    //    string str = "SELECT ID,[MID] as m,[PreBalance],[LoanAmt],[DateOfIssue],[MInstalment],[DueDate] FROM [Come2myCityDB].[dbo].[tbl_BIssueLoan] where MID='" + ddlSMember.SelectedValue + "'";
    //    ds = cc.ExecuteDataset(str);
    //    decimal str1 = Convert.ToInt32(ds.Tables[0].Rows[0]["LoanAmt"]);
    //    decimal str2 = Convert.ToInt32(ds.Tables[0].Rows[0]["DueDate"]);

    //    string sql = "select IntOnLoan FROM [Come2myCityDB].[dbo].[tbl_BSSGRuleSetting]";
    //    ds = cc.ExecuteDataset(sql);
    //    decimal sql1 = Convert.ToInt32(ds.Tables[0].Rows[0]["IntOnLoan"]);
    //    decimal cal = ((str1 * str2 * sql1) / 100);
    //    lblCal.Text = cal.ToString();


    //        //Label lbl = (Label)e.Row.FindControl("lblCal");
    //        //lbl.Text = cal.ToString();

    //    Label lbl = gvItem.Rows[rowIndex].FindControl("lblCal") as Label;
    //    lbl.Text = Convert.ToString(cal);

    //}
    public string Sum()
    {
        string str = "select Sum(cast(SubAmt as int)) from [Come2myCityDB].[dbo].[tbl_BSubInstalment] where UserId='" + Session["User"] + "' ";
        string st  = cc.ExecuteScalar(str);

        return(st);
    }
Example #20
0
    private void AddNew()
    {
        CommonCode cc = new CommonCode();

        try
        {
            if (txtRoleName.Text == "")
            {
                lblError.Visible = true;
                lblError.Text    = "Please Enter the Role Name";

                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please Enter the Role Name')", true);
            }
            else
            {
                string Sql = "Select Roleid from [Come2myCityDB].[come2mycity].submenuPermission where RoleName='" + txtRoleName.Text.ToString() + "'";
                string Id  = Convert.ToString(cc.ExecuteScalar(Sql));
                if (!(Id == null || Id == ""))
                {
                    lblError.Visible = true;
                    lblError.Text    = "This Name is already exist";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('This Name is already exist')", true);
                    lblError.Text = "";
                }
                else
                {
                    string  sql11   = "select roleid,referencerole from [Come2myCityDB].[come2mycity].submenuPermission where rolename='" + ddlRole.SelectedItem.Text + "' ";
                    DataSet ds      = cc.ExecuteDataset(sql11);
                    string  refrole = Convert.ToString(ds.Tables[0].Rows[0]["referencerole"]);
                    if (refrole == "")
                    {
                        string roleid = Convert.ToString(ds.Tables[0].Rows[0]["roleid"]);
                        refrole = roleid;
                    }
                    if (ddlRole.SelectedValue == "0")
                    {
                        refrole = "";
                    }

                    Sql = "Insert into [Come2myCityDB].[come2mycity].submenuPermission(RoleName,RoleDescription,PageAccessPerm,UnderRole,referencerole) Values ('" + txtRoleName.Text.ToString() + "','" + txtRoleName.Text.ToString() + "','','" + ddlRole.SelectedValue + "','" + refrole.ToString() + "') ";
                    int flag = cc.ExecuteNonQuery(Sql);
                    txtRoleName.Text        = "";
                    txtRoleDescription.Text = "";

                    lblError.Visible = true;
                    getinfo();
                    lblError.Text    = "Role Added Successfully";
                    lblError.Visible = false;

                    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Role added successfully')", true);
                    getRole();
                    getinfo();
                }
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Role not added')", true);
        }
    }
Example #21
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox txtBackReply = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtReply");
        Label   lblMobile    = (Label)GridView1.Rows[e.RowIndex].FindControl("lblMobileNo");
        string  sendTo       = lblMobile.Text.ToString().Substring(2, 10);
        string  sql          = "select usrFirstName from userMaster where usrMobileNo='" + sendTo.ToString() + "'";
        string  reply        = "";
        string  returnName   = "";

        returnName = cc.ExecuteScalar(sql);
        if (returnName != "")
        {
            reply = "Dear " + returnName.ToString() + "," + txtBackReply.Text.ToString() + " Thanks.via www.myct.in";
        }
        else
        {
            reply = "Dear customer," + txtBackReply.Text.ToString() + " Thanks.via www.myct.in";
        }
        string senderByCT = "myctin";

        cc.SendMessageTra(senderByCT, sendTo, reply);
        GridView1.EditIndex = -1;
        string KeyName = ddlSubGroupName.SelectedItem.ToString();

        loadGrid(KeyName);
    }
Example #22
0
 private void gvCommitteesshow()
 {
     try
     {
         string userid = Session["MarketingUser"].ToString();
         if (userid == "6dde8c3d-1895-4904-b332-764f63206fc0")
         {
             string  sql = "select Id,Committee_name,hiturl from committeedetail ";
             DataSet ds  = cc.ExecuteDataset(sql);
             gvCommittees.DataSource = ds.Tables[0];
             gvCommittees.DataBind();
         }
         else
         {
             string  sqlfetch = "select commitee_id from CommitteeRole where userid='" + userid + "'";
             string  commitee = cc.ExecuteScalar(sqlfetch);
             string  sql      = "select Committee_name,hiturl from committeedetail where Id in(" + commitee + ")";
             DataSet ds       = cc.ExecuteDataset(sql);
             gvCommittees.DataSource = ds.Tables[0];
             gvCommittees.DataBind();
         }
     }
     catch (Exception ex)
     {
     }
 }
Example #23
0
    //protected void btnUpdateContact_Click(object sender, EventArgs e)
    //{

    //    string Id = tmp.Value;
    //    urUserRegBLLObj.frnrelUserId = Convert.ToString(Session["User"]);
    //    urUserRegBLLObj.frnrelFriendId = Convert.ToString(Id);

    //    urUserRegBLLObj.FrnrelPrefix = Convert.ToString(ddlprefix.SelectedItem.Text);
    //    if (ddlprefix.SelectedItem.Text == null)
    //    {
    //        urUserRegBLLObj.FrnrelPrefix = "Dear";
    //    }
    //    urUserRegBLLObj.Frnrelinfix = Convert.ToString(ddlinfix.SelectedItem.Text);
    //    if (ddlinfix.SelectedItem.Text == null)
    //    {
    //        urUserRegBLLObj.Frnrelinfix = infix[0];
    //    }
    //    urUserRegBLLObj.Frnrelpostfix = Convert.ToString(ddlpostfix.SelectedItem.Text);
    //    if (ddlpostfix.SelectedItem.Text == null)
    //    {
    //        urUserRegBLLObj.Frnrelpostfix = " ";
    //    }

    //    try
    //    {
    //        status = urUserRegBLLObj.BLLPrefixUpdate(urUserRegBLLObj);
    //        if (status == 0)
    //        {
    //            //ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User already Exists')", true);
    //        }
    //    }
    //    catch (Exception ex)
    //    {
    //        throw ex;
    //    }

    //    string Sql = "Delete from friendGroupRelation where RelId=" + Id + "  ";
    //    Sql = Sql + " Update FriendRelationMaster set Relation='" + txtRelation.Text.ToString() + "' " +
    //        " where FriRelId=" + Id + " ";
    //    //sql1=Sql+"update "
    //    //for (int i = 0; i < chkGroup.Items.Count - 1; i++)
    //    //{
    //    //    if (chkGroup.Items[i].Selected == true)
    //    //    {
    //    //        Sql = Sql + " Insert into FriendGroupRelation (RelId, GroupId) Values " +
    //    //            " (" + Id + "," + chkGroup.Items[i].Value.ToString() + " ) ";
    //    //    }
    //    //}
    //    CommonCode cc = new CommonCode();
    //    int tmp1 = cc.ExecuteNonQuery(Sql);
    //    urUserRegBLLObj.usrUserId = Convert.ToString(Session["User"]);
    //   DataSet dtFriendRelList = urUserRegBLLObj.BLLFriendRelativeShowById(urUserRegBLLObj);
    //    gvRemoveFriend.DataSource = dtFriendRelList;
    //    gvRemoveFriend.DataBind();

    //    urUserRegBLLObj.frnrelUserId = Convert.ToString(Session["User"]);
    //    string query = "select * from FriendRelationMaster where UserId='" + urUserRegBLLObj.frnrelUserId.ToString() + "'";
    //    DataSet ds = cc.ExecuteDataset(query);
    //    foreach (DataRow dr in ds.Tables[0].Rows)
    //    {
    //        string userid = Convert.ToString(dr["UserId"]);
    //        string frienduserid = Convert.ToString(dr["FriendId"]);

    //    }


    //}



    public void LoadFriendGroup(UserRegistrationBLL ur)
    {
        //chkGroup
        DataTable dtFriendGroup = urUserRegBLLObj.BLLShowAllFriendGroup(urUserRegBLLObj);

        string Sql  = " Select GroupName from UserMaster where usrUserId='" + Convert.ToString(Session["User"]) + "' ";
        string Data = Convert.ToString(cc.ExecuteScalar(Sql));

        string[] tmp = Data.Split(',');
        int      i   = 0;

        foreach (DataRow dr in dtFriendGroup.Rows)
        {
            string tmpName = Convert.ToString(dr["GroupName"]);
            string tmpData = "";
            try
            {
                tmpData = tmp[i].ToString();
            }
            catch
            { }

            if (tmpData != "")
            {
                dr["GroupName"] = tmpData;
            }

            i++;
        }
    }
Example #24
0
    public void count()
    {
        string str = string.Empty;

        // string str = "select sum(EzeeDrugAppId) FROM [Come2myCityDB].[dbo].[EzeeDrugsAppDetail] where [keyword]='" + txtPName.Text + "' group by EzeeDrugAppId" ;
        // string str = "SELECT COUNT(EzeeDrugAppId) FROM [Come2myCityDB].[dbo].[EzeeDrugsAppDetail] WHERE [keyword]='" + ddlAllProjectName.SelectedValue + "' AND EntryDate LIKE '%" + txtDate.Text.Substring(0,7) + "%'";
        if (ddlAllProjectName.SelectedValue != "0" && txtDate.Text != "")
        {
            str = "select COUNT(*) " +
                  " FROM [Come2myCityDB].[dbo].[EzeeDrugsAppDetail] EDrug INNER JOIN [Come2myCityDB].[come2mycity].[DistrictMaster] DM  ON EDrug.[District] = DM.[DistrictId] " +
                  " where [keyword]='" + ddlAllProjectName.SelectedValue + "' AND EntryDate LIKE '%" + txtDate.Text.Substring(0, 7) + "%'";
        }
        else if (ddlAllProjectName.SelectedValue != "0" && txtDate.Text == "")
        {
            str = "select COUNT(*) " +
                  " FROM [Come2myCityDB].[dbo].[EzeeDrugsAppDetail] EDrug INNER JOIN [Come2myCityDB].[come2mycity].[DistrictMaster] DM  ON EDrug.[District] = DM.[DistrictId] " +
                  " where [keyword]='" + ddlAllProjectName.SelectedValue + "'";
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "anything", "alert('Please Select Project Name');", true);
        }
        DataSet ds = new DataSet();
        string  st = cc.ExecuteScalar(str);

        lblcount.Text = "All Registered Members Are : '" + st + "'";
    }
Example #25
0
    protected void btnSubmit1_Click(object sender, EventArgs e)
    {
        bllobjCompanyDetails.Userid = Session["MarketingUser"].ToString();
        string sql = "select id from companydetails where userid='" + bllobjCompanyDetails.Userid + "'";
        string cid = cc.ExecuteScalar(sql);

        bllobjCompanyDetails.Id = Convert.ToInt32(cid);
        bllobjCompanyDetails.AdvertiseFromdate = txtFrom.Text;
        bllobjCompanyDetails.AdvertiseTodate   = txtTo.Text;
        listitem();
        fileupload();
        string advstatus = "Active";

        bllobjCompanyDetails.Jobstatus = advstatus;
        status = bllobjCompanyDetails.BLLAdvertiseInsert(bllobjCompanyDetails);
        if (status == 1)
        {
            Response.Write("<script>(alert)('Advertisement is inserted successfully')</script>");
            viewadvertisement();
        }
        else
        {
            Response.Write("<script>(alert)('Advertisement is not inserted')</script>");
        }
    }
Example #26
0
    public void LoadPaidBal()
    {
        string usrIdSn = Convert.ToString(Session["User"]);
        string paidBal = "select paidCount from userMaster where usrUserId='" + usrIdSn.ToString() + "'";
        string balVal  = cc.ExecuteScalar(paidBal);

        if (balVal != "")
        {
            int bal = Convert.ToInt32(balVal);
            lblPaidBal.Text = Convert.ToString(bal) + " SMS";
        }
        else
        {
            lblPaidBal.Text = "0 SMS";
        }
    }
Example #27
0
 public int DALMiscalKeywordIsExist(KeywordBLL KB)
 {
     using (SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]))
     {
         try
         {
             string sql = "select keywordId from KeywordDefinition where KeywordName='" + KB.keywordName + "'";
             string id  = cc.ExecuteScalar(sql);
             if (id == "" || id == null)
             {
                 SqlParameter[] par = new SqlParameter[4];
                 par[0]           = new SqlParameter("@KeywordName", KB.keywordName);
                 par[1]           = new SqlParameter("@IMEINO", KB.IMEINO);
                 par[2]           = new SqlParameter("@Sim_no", KB.Simno);
                 par[3]           = new SqlParameter("@status", 5);
                 par[3].Direction = ParameterDirection.Output;
                 SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "MiscalKeywordNameIsExist", par);
                 status = (int)par[3].Value;
             }
             else
             {
                 status = 0;
             }
         }
         catch (Exception ex)
         {
         }
         finally
         {
             con.Close();
         }
     }
     return(status);
 }
Example #28
0
 public int DALGetstatus(JobSeekerdetailsBLL obj)
 {
     using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]))
     {
         try
         {
             string sql = "select id from JobSeekerDetails where userid='" + obj.Userid + "'";
             string id  = cc.ExecuteScalar(sql);
             if (id == "")
             {
                 status = 1;
             }
             else
             {
                 status = 0;
             }
         }
         catch (SqlException ex)
         {
             throw ex;
         }
         finally
         {
             con.Close();
         }
     }
     return(status);
 }
Example #29
0
    public void LoadGenaralBal()
    {
        string usrIdSn  = Convert.ToString(Session["User"]);
        string paidBal  = "select SMSbal from userMaster where usrUserId='" + usrIdSn.ToString() + "'";
        string balValue = cc.ExecuteScalar(paidBal);

        if (balValue != "")
        {
            int bal = Convert.ToInt32(balValue);
            lblQuickGeneralBalance.Text = "SMS Balance is: " + Convert.ToString(bal) + " SMS";
        }
        else
        {
            lblQuickGeneralBalance.Text = "SMS Balance is: 0 SMS";
        }
    }
Example #30
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        lblId.Text = Convert.ToString(e.CommandArgument);
        string id      = lblId.Text;
        string command = Convert.ToString(e.CommandName);

        if (command == "Calculate")
        {
            string  sql = "select MsgCharCount,msgcount from MiscalResponse where id='" + id + "'";
            DataSet ds  = cc.ExecuteDataset(sql);

            string count = Convert.ToString(ds.Tables[0].Rows[0]["MsgCharCount"]);
            if (count == "" || count == null)
            {
                count = "0";
            }
            string msgtotalcount = Convert.ToString(ds.Tables[0].Rows[0]["msgcount"]);
            if (msgtotalcount == "" || msgtotalcount == null)
            {
                msgtotalcount = "0";
            }
            lblMsgttlcount.Text = "Total Message Count: " + msgtotalcount;

            lblCount.Text = "Message Length: " + count;
            sql           = "select count(*) from MiscalResponseCounter where Message_id='" + id + "'";
            string usercount = cc.ExecuteScalar(sql);
            lblusercount.Text = "No. of user: "******"Total Calculation :" + calulation;
        }
    }