Пример #1
0
    public string PrdMsg(string compid)
    {
        PageConn pgcon = new PageConn();

        con     = pgcon.dynconn;
        connect = PageConn.licenseconn();
        string     strc = "SELECT CompanyId from CompanyMaster where CompanyLoginId='" + compid + "'";
        SqlCommand dac  = new SqlCommand(strc, connect);

        connect.Open();
        object enccompid = dac.ExecuteScalar();

        connect.Close();
        enccompid = encryptstrring(enccompid.ToString());
        //string str = "SELECT MP, CID, PID, V FROM Lmaster where CID='" + enccompid + "'";

        //SqlDataAdapter da = new SqlDataAdapter(str, conn);
        //DataTable dt = new DataTable();
        //da.Fill(dt);
        //string str1 = "Select MAX(InventoryMasterId) FROM InventoryMaster inner join InventoruSubSubCategory on InventoryMaster.InventorySubSubId=InventoruSubSubCategory.InventorySubSubId INNER JOIN InventorySubCategoryMaster ON InventoruSubSubCategory.InventorySubCatID = InventorySubCategoryMaster.InventorySubCatId INNER JOIN   InventoryCategoryMaster ON InventorySubCategoryMaster.InventoryCategoryMasterId = InventoryCategoryMaster.InventeroyCatId where InventoryCategoryMaster.compid='" + compid + "'";
        //SqlDataAdapter da1 = new SqlDataAdapter(str1, con);
        //DataTable dt1 = new DataTable();
        //da1.Fill(dt1);
        //if (dt.Rows[0][0].ToString() != "")
        //{
        //    if (dt1.Rows[0][0].ToString() != "")
        //    {
        //        if (dt.Rows[0][0].ToString() != "Unlimited")
        //        {
        //            // int LMastlimit = Convert.ToInt16(dt.Rows[0][0].ToString());
        //            int LMastlimit = Convert.ToInt32(decryptstring(dt.Rows[0][0].ToString()));
        //            LMastlimit = LMastlimit - 10;
        //            int InvMasterVal = Convert.ToInt16(dt1.Rows[0][0].ToString());

        //            if (InvMasterVal >= LMastlimit)
        //            {
        //                return "Your Inventory Limit is : " + (LMastlimit + 10) + "Now !! You can enter " + ((LMastlimit + 10) - InvMasterVal) + " products.";
        //            }
        //            else
        //            {
        //                return "";
        //            }
        //        }
        //        else
        //        {
        //            return "";
        //        }
        //    }
        //    else
        //    {
        //        return "";
        //    }
        //}
        //else
        //{
        //    return "";
        //}

        return("");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //Session["pnl1"] = "8";
        PageConn pgcon = new PageConn();

        connection = pgcon.dynconn;
        if (!IsPostBack)
        {
            Session["pagename"] = "ForgotPassword.aspx";

            string str = "SELECT CompanyLoginId,CompanyName from CompanyMaster where Websiteurl='" + Request.Url.Host.ToString() + "' and active='1'";

            SqlCommand     cmd = new SqlCommand(str, PageConn.licenseconn());
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataTable      dt  = new DataTable();
            adp.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                Session["Comid"]         = Convert.ToString(dt.Rows[0]["CompanyLoginId"]);
                ViewState["companyname"] = dt.Rows[0]["CompanyName"].ToString();
            }
            string         str1 = "Select ProductMaster.ProductName from ProductMaster inner join CompanyMaster on CompanyMaster.ProductId = ProductMaster.ProductId where CompanyMaster.CompanyLoginId='" + Session["Comid"] + "'";
            SqlCommand     cmd1 = new SqlCommand(str1, PageConn.licenseconn());
            SqlDataAdapter adpt = new SqlDataAdapter(cmd1);
            DataTable      dt1  = new DataTable();
            adpt.Fill(dt1);
            if (dt1.Rows.Count > 0)
            {
                Session["productname"] = dt1.Rows[0]["ProductName"].ToString();
            }
        }
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string assss = "32";

        assss = PageMgmt.Encrypted("Inventorycategorymaster.aspx");
        assss = PageMgmt.Decrypted("lpSVW07ER8Q=");

        Session.Clear();
        if (!IsPostBack)
        {
            lblmsg.Visible = false;
        }



        con = PageConn.licenseconn();


//        string str = @" DECLARE @Pivot_Column [nvarchar](max);
//                        DECLARE @Query [nvarchar](max);
//                        SELECT @Pivot_Column= COALESCE(@Pivot_Column+',','')+ QUOTENAME(CategoryName) FROM
//                        (SELECT DISTINCT [CategoryName] FROM PageAccessToPricePlanCategory Where CategoryName IS NOT NULL)Tab
//                        SELECT @Query='SELECT PageId,PageName, '+@Pivot_Column+'FROM
//                        (SELECT PageId,PageName, [CategoryName] , Id   FROM PageAccessToPricePlanCategory )Tab1
//                        PIVOT
//                        (
//                        SUM(Id) FOR CategoryName IN ('+@Pivot_Column+')) AS Tab2
//                        ORDER BY Tab2.PageName'
//                        EXEC  sp_executesql  @Query ";//
//        SqlCommand cmd = new SqlCommand(str, con);
//        SqlDataAdapter adp = new SqlDataAdapter(cmd);
//        DataTable dt = new DataTable();
//        adp.Fill(dt);
    }
Пример #4
0
    public static string GetA(String CompanyLoginId)
    {
        string         Valuesof_C    = "";
        DateTime       todaydatefull = DateTime.Now;
        string         strdt         = todaydatefull.ToString("MM-dd-yyyy");
        DateTime       startDate     = DateTime.Parse(strdt);
        DateTime       datevalue     = (Convert.ToDateTime(startDate.ToString("MM-dd-yyyy")));
        String         DD            = datevalue.Day.ToString();
        String         MM            = datevalue.Month.ToString();
        String         YYYY          = datevalue.Year.ToString();
        string         dateid        = DD + "" + MM + "" + YYYY;
        string         strcln        = " Select * From CompanyABCDetail Where CompanyLoginId='" + CompanyLoginId + "' and Z='" + dateid + "' and F1 IS NOT NULL and F2 IS NOT NULL and F3 IS NOT NULL and F4 IS NOT NULL and F5 IS NOT NULL and E1 IS NOT NULL and E2 IS NOT NULL and E3 IS NOT NULL and E4 IS NOT NULL and E5 IS NOT NULL  ";
        SqlCommand     cmdcln        = new SqlCommand(strcln, PageConn.licenseconn());
        DataTable      dtcln         = new DataTable();
        SqlDataAdapter adpcln        = new SqlDataAdapter(cmdcln);

        adpcln.Fill(dtcln);
        if (dtcln.Rows.Count > 0)
        {
            string Z  = dtcln.Rows[0]["Z"].ToString();
            string C1 = PageConnXYZXYZ.BtoE(dtcln.Rows[0]["D1"].ToString(), dtcln.Rows[0]["E1"].ToString(), Convert.ToInt64(dtcln.Rows[0]["F1"].ToString()), DD, MM, YYYY);
            string C2 = PageConnXYZXYZ.BtoE(dtcln.Rows[0]["D2"].ToString(), dtcln.Rows[0]["E2"].ToString(), Convert.ToInt64(dtcln.Rows[0]["F2"].ToString()), DD, MM, YYYY);
            string C3 = PageConnXYZXYZ.BtoE(dtcln.Rows[0]["D3"].ToString(), dtcln.Rows[0]["E3"].ToString(), Convert.ToInt64(dtcln.Rows[0]["F3"].ToString()), DD, MM, YYYY);
            string C4 = PageConnXYZXYZ.BtoE(dtcln.Rows[0]["D4"].ToString(), dtcln.Rows[0]["E4"].ToString(), Convert.ToInt64(dtcln.Rows[0]["F4"].ToString()), DD, MM, YYYY);
            string C5 = PageConnXYZXYZ.BtoE(dtcln.Rows[0]["D5"].ToString(), dtcln.Rows[0]["E5"].ToString(), Convert.ToInt64(dtcln.Rows[0]["F5"].ToString()), DD, MM, YYYY);
            Valuesof_C = C1 + C2 + C3 + C4 + C5;
        }
        else
        {
        }
        return(Valuesof_C);
    }
Пример #5
0
    //HttpCookieCollection cook;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(con.ConnectionString) == "")
        {
            PageConn pgcon = new PageConn();
            con = pgcon.dynconn;
        }
        if (Convert.ToString(PageConn.busdatabase) == "")
        {
            PageConn.licenseconn();
        }
        con1 = PageConn.licenseconn();

        if (PageConn.bidname == "")
        {
            PageConn.busclient();
        }

        string strData = Request.Url.LocalPath.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["pagename"] = page.ToString();



        String pageurl = Request.Url.AbsoluteUri;



        HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(false);
        HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        HttpContext.Current.Response.Cache.SetNoStore();
        Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
        Response.Cache.SetValidUntilExpires(true);
        if (!IsPostBack)
        {
            ddlcountry.Items.Clear();
            DataTable dtc = select("select distinct CountryId,CountryName,Country_Code from CountryMaster Order by CountryName ");
            if (dtc.Rows.Count > 0)
            {
                ddlcountry.DataSource     = dtc;
                ddlcountry.DataTextField  = "CountryName";
                ddlcountry.DataValueField = "CountryId";
                ddlcountry.DataBind();
            }
            ddlcountry.Items.Insert(0, "Select Country");
            ddlcountry.Items[0].Value = "0";
            ddlcountry_SelectedIndexChanged(sender, e);
            PopulateMenu();
        }
    }
    //HttpCookieCollection cook;
    protected void Page_Load(object sender, EventArgs e)
    {
        int mast = 0;

        //PageConn pgcon = new PageConn();
        //con = pgcon.dynconn;
        if (Convert.ToString(con.ConnectionString) == "")
        {
            PageConn pgcon = new PageConn();
            con = pgcon.dynconn;
        }
        if (Convert.ToString(PageConn.busdatabase) == "")
        {
            PageConn.licenseconn();
        }
        con1 = PageConn.licenseconn();

        if (Convert.ToString(PageConn.bidname) == "")
        {
            PageConn.busclient();
        }

        string strData = Request.Url.LocalPath.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["pagename"] = page.ToString();



        String pageurl = Request.Url.AbsoluteUri;

        if (Convert.ToString(Session["Devl"]) == "yes")
        {
            if (!IsPostBack)
            {
                FillLogos();

                HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(false);
                HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                HttpContext.Current.Response.Cache.SetNoStore();
                Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
                Response.Cache.SetValidUntilExpires(true);
            }
        }
        else
        {
            Response.Redirect("~/ShoppingCart/Developer/DeveloperLogin.aspx");
        }
    }
Пример #7
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "pg")
        {
            String         strcln = " SELECT PageId,PageName From PageMaster where PageId='" + e.CommandArgument.ToString() + "'";
            SqlCommand     cmdcln = new SqlCommand(strcln, PageConn.licenseconn());
            SqlDataAdapter da     = new SqlDataAdapter(cmdcln);
            DataTable      dt     = new DataTable();
            da.Fill(dt);
            string nm = dt.Rows[0]["PageName"].ToString();

            string te = nm.ToString();
            ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open('" + te + "');", true);
        }
    }
Пример #8
0
    public static string GetForeinkeyName(String TableId)
    {
        string         ForeinKey_PricplanID = GetTableID("PricePlanMaster");
        string         ForeignFieldWhere    = "";
        string         strcln = " Select * From tablefielddetail Where TableId='" + TableId + "' and foreignkeytblid='" + ForeinKey_PricplanID + "' ";
        SqlCommand     cmdcln = new SqlCommand(strcln, PageConn.licenseconn());
        DataTable      dtcln  = new DataTable();
        SqlDataAdapter adpcln = new SqlDataAdapter(cmdcln);

        adpcln.Fill(dtcln);
        if (dtcln.Rows.Count > 0)
        {
            ForeignFieldWhere = dtcln.Rows[0]["feildname"].ToString();
        }
        return(ForeignFieldWhere);
    }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        con = PageConn.licenseconn();
        //Livelocal = PageConn.livelocal();
        //connection = PageConn.livelocal();
        PageConn pgcon = new PageConn();

        jobcenterconn   = pgcon.dynconn;
        lblVersion.Text = "This PageVersion Is V1  Date:27-Oct-2015 Develop By @Pk";
        if (!IsPostBack)
        {
            FillMailType();
            fillgrid();
        }
        // fillgrid();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     con1 = PageConn.licenseconn();
     if (Session["Comid"] == null)
     {
         Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
     }
     if (!IsPostBack)
     {
         txtDate.Text   = System.DateTime.Now.ToShortDateString();
         txttodate.Text = System.DateTime.Now.ToShortDateString();
         getwhid();
         newrequest();
         fillusertype();
         fillgrid();
     }
 }
Пример #11
0
    public static string AAAAAAA_Record(String TAbleName, string Record, string ServerId)
    {
        string        foreignwhere = "";
        SqlConnection liceco       = new SqlConnection();

        liceco = PageConn.licenseconn();
        if (liceco.State.ToString() != "Open")
        {
            liceco.Open();
        }

        string     str = " insert into  Satelite_ServerFristTimeInsertedRecord(TAbleName,Record,ServerId) values ('" + TAbleName + "','" + Record + "','" + ServerId + "') ";
        SqlCommand cmd = new SqlCommand(str, liceco);

        cmd.ExecuteNonQuery();
        liceco.Close();
        return(foreignwhere);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        connection = pgcon.dynconn;

        if (!IsPostBack)
        {
            lblmsg.Text = "";
            string str = "SELECT CompanyLoginId from CompanyMaster where Websiteurl='" + Request.Url.Host.ToString() + "' and active='1'";

            SqlCommand     cmd = new SqlCommand(str, PageConn.licenseconn());
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataTable      dt  = new DataTable();
            adp.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                Session["Comid"] = Convert.ToString(dt.Rows[0]["CompanyLoginId"]);
            }

            string         strmaxid = "Select UserId from PasswordResetRequestTbl where ID='" + ClsEncDesc.Decrypted(Request.QueryString["to"]) + "'";
            SqlCommand     cmdmax   = new SqlCommand(strmaxid, connection);
            SqlDataAdapter adptmax  = new SqlDataAdapter(cmdmax);
            DataSet        dsmax    = new DataSet();
            adptmax.Fill(dsmax);
            ViewState["maxuserid"] = dsmax.Tables[0].Rows[0]["UserId"].ToString();
            string         str1 = " Select  Distinct CompanyMaster.Compid,CompanyWebsitMaster.MasterEmailId, CompanyWebsitMaster.OutGoingMailServer,CompanyWebsitMaster.WebMasterEmail,CompanyWebsitMaster.EmailMasterLoginPassword, User_master.EmailID,User_master.UserID,CompanyMaster.CompanyLogo,CompanyMaster.CompanyName,CompanyAddressMaster.Email,CompanyAddressMaster.Fax,CompanyAddressMaster.Phone from User_master inner join Party_master on  Party_master.PartyID=User_master.PartyID inner join WareHouseMaster on WareHouseMaster.WareHouseId=Party_master.Whid inner join CompanyMaster on CompanyMaster.Compid=WareHouseMaster.comid inner join CompanyAddressMaster on CompanyAddressMaster.CompanyMasterId=CompanyMaster.CompanyId inner join CompanyWebsitMaster on CompanyWebsitMaster.WHId=WareHouseMaster.WareHouseId where User_master.UserID='" + ViewState["maxuserid"] + "'";
            SqlCommand     cmd1 = new SqlCommand(str1, connection);
            SqlDataAdapter adp1 = new SqlDataAdapter(cmd1);
            DataTable      dt1  = new DataTable();
            adp1.Fill(dt1);
            if (dt1.Rows.Count > 0)
            {
                ViewState["UserID"] = Convert.ToString(dt1.Rows[0]["UserID"]);
                Session["Comid"]    = Convert.ToString(dt1.Rows[0]["Compid"]);
                if (Convert.ToString(dt1.Rows[0]["CompanyLogo"]) != "")
                {
                    img1.ImageUrl = "ShoppingCart/images/" + Convert.ToString(dt1.Rows[0]["CompanyLogo"]);
                }
            }
            fillquestion();
        }
    }
Пример #13
0
    //
    public static string SatelliteSyncronisationrequiringTablesMaster_WherePKIDName(String TableId)
    {
        string         PKIDName        = "";
        string         foreignkeytblid = "";
        string         strcln          = " Select * From SatelliteSyncronisationrequiringTablesMaster_SerWhere Where TableId='" + TableId + "' ";
        SqlCommand     cmdcln          = new SqlCommand(strcln, PageConn.licenseconn());
        DataTable      dtcln           = new DataTable();
        SqlDataAdapter adpcln          = new SqlDataAdapter(cmdcln);

        adpcln.Fill(dtcln);
        if (dtcln.Rows.Count > 0)
        {
            PKIDName = dtcln.Rows[0]["PKIdName"].ToString();
        }
        else
        {
        }
        return(PKIDName);
    }
Пример #14
0
    public static string GetTableID(String TableName)
    {
        string         foreignwhere    = "";
        string         foreignkeytblid = "";
        string         strcln          = " Select * From ClientProductTableMaster Where TableName='" + TableName + "'  and VersionInfoId='32'";
        SqlCommand     cmdcln          = new SqlCommand(strcln, PageConn.licenseconn());
        DataTable      dtcln           = new DataTable();
        SqlDataAdapter adpcln          = new SqlDataAdapter(cmdcln);

        adpcln.Fill(dtcln);
        if (dtcln.Rows.Count > 0)
        {
            foreignkeytblid = dtcln.Rows[0]["Id"].ToString();
        }
        else
        {
        }
        return(foreignkeytblid);
    }
Пример #15
0
    public static string SatelliteSyncronisationrequiringTablesMaster_Where(String TableId)
    {
        string         foreignwhere    = "";
        string         foreignkeytblid = "";
        string         strcln          = " Select * From SatelliteSyncronisationrequiringTablesMaster_Where Where TableId='" + TableId + "' ";
        SqlCommand     cmdcln          = new SqlCommand(strcln, PageConn.licenseconn());
        DataTable      dtcln           = new DataTable();
        SqlDataAdapter adpcln          = new SqlDataAdapter(cmdcln);

        adpcln.Fill(dtcln);
        if (dtcln.Rows.Count > 0)
        {
            foreignkeytblid = dtcln.Rows[0]["Select_Query"].ToString() + " and " + dtcln.Rows[0]["WhereCondi"].ToString();
        }
        else
        {
        }
        return(foreignkeytblid);
    }
Пример #16
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        string         portalid = "3018";
        string         strcheck = "  Select * From MasteradminLogin where Emailaddress='" + TextBox1.Text + "'";
        SqlCommand     cmdcheck = new SqlCommand(strcheck, PageConn.licenseconn());
        SqlDataAdapter adpcheck = new SqlDataAdapter(cmdcheck);
        DataTable      dtcheck  = new DataTable();

        adpcheck.Fill(dtcheck);
        if (dtcheck.Rows.Count > 0)
        {
            string str21 = "  select distinct  PortalMasterTbl.* from  CompanyMaster inner join PricePlanMaster  on CompanyMaster.PricePlanId=PricePlanMaster.PricePlanId inner join VersionInfoMaster on VersionInfoMaster.VersionInfoId=PricePlanMaster.VersionInfoMasterId inner join ProductMaster on VersionInfoMaster.ProductId=ProductMaster.ProductId inner join ClientMaster on ProductMaster.ClientMasterId=ClientMaster.ClientMasterId inner join Priceplancategory on Priceplancategory.ID=PricePlanMaster.PriceplancatId inner join PortalMasterTbl on PortalMasterTbl.Id=Priceplancategory.PortalId   inner join OrderMaster on CompanyMaster.CompanyLoginId=OrderMaster.CompanyLoginId inner join  OrderPaymentSatus on OrderMaster.OrderId=OrderPaymentSatus.OrderId  inner join StateMasterTbl on StateMasterTbl.StateId=PortalMasterTbl.StateId inner join CountryMaster on StateMasterTbl.CountryId=CountryMaster.CountryId  WHERE(PortalMasterTbl.Id=7)  ";
            str21 = " Select * From PortalMasterTbl where id='" + portalid + "' ";
            SqlCommand     cmd45 = new SqlCommand(str21, PageConn.licenseconn());
            SqlDataAdapter adp45 = new SqlDataAdapter(cmd45);
            DataTable      dt21  = new DataTable();
            adp45.Fill(dt21);

            string aa          = "";
            string bb          = "";
            string cc          = "";
            string ff          = "";
            string ee          = "";
            string dd          = "";
            string ext         = "";
            string tollfree    = "";
            string tollfreeext = "";
            if (dt21.Rows.Count > 0)
            {
                if (Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != null)
                {
                    ext = "ext " + dt21.Rows[0]["Supportteamphonenoext"].ToString();
                }

                if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
                {
                    tollfree = dt21.Rows[0]["Tollfree"].ToString();
                }

                if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
                {
                    tollfreeext = "ext " + dt21.Rows[0]["Tollfreeext"].ToString();
                }


                aa = "" + dt21.Rows[0]["Supportteammanagername"].ToString() + "- Support Manager";
                bb = "" + dt21.Rows[0]["PortalName"].ToString() + " ";
                cc = "" + dt21.Rows[0]["Supportteamphoneno"].ToString() + "  " + ext + " ";
                dd = "" + tollfree + " " + tollfreeext + " ";
                ee = "" + dt21.Rows[0]["Portalmarketingwebsitename"].ToString() + "";
                // ff = "" + dt21.Rows[0]["City"].ToString() + " " + dt21.Rows[0]["StateName"].ToString() + " " + dt21.Rows[0]["CountryName"].ToString() + " " + dt21.Rows[0]["Zip"].ToString() + " ";
            }

            string file  = "busiwiz.png";
            string name  = "";
            string body1 = "<br>  <img src=\"http://license.busiwiz.com//images/" + file + "\" \"border=\"0\" Width=\"90\" Height=\"80\" / > <br> Dear Master Admin, <br><br>  You Are requested For User Id and Password Are Below<br<br>" +
                           "  <br/><br/> Link : <a href=http://license.busiwiz.com/Admin/AdminLogin.aspx target=_blank>Login Here</a>  <br>User ID : " + dtcheck.Rows[0]["MasterUserid"].ToString() + " <br>Password : "******"MasterPassword"].ToString() + "<br>Thank you,<br>" + aa + "<br>" + bb + "<br>" + cc + "<br>" + ee + "";
            if (dt21.Rows.Count > 0)
            {
                try
                {
                    string email       = Convert.ToString(dt21.Rows[0]["UserIdtosendmail"]);
                    string displayname = Convert.ToString("LicenseTeam");
                    string password    = Convert.ToString(dt21.Rows[0]["Password"]);
                    string outgo       = Convert.ToString(dt21.Rows[0]["Mailserverurl"]);
                    string body        = body1;
                    string Subject     = "Information of MasterAdmin Login Information of Licnese.busiwiz.com";


                    MailAddress to       = new MailAddress("" + TextBox1.Text + "");//(tomail);//[email protected]("*****@*****.**");//
                    MailAddress from     = new MailAddress(email, "LicenseTeam");
                    MailMessage objEmail = new MailMessage(from, to);
                    objEmail.Subject = Subject.ToString();
                    objEmail.Body    = body.ToString();

                    objEmail.IsBodyHtml = true;
                    objEmail.Priority   = MailPriority.High;
                    SmtpClient client = new SmtpClient();
                    client.Credentials = new NetworkCredential(email, password);
                    client.Host        = outgo;
                    client.Send(objEmail);
                    lbl_msg.Visible = true;
                    lbl_msg.Text    = "You will then receive an e-mail message with your forgotten User IDs";
                }
                catch {
                    lbl_msg.Visible = true;
                    lbl_msg.Text    = "Main Not Send Check Internet Connetion or Try Again";
                }
            }
        }
    }
Пример #17
0
    public void page_error()
    {
        if (Session["Comid"] != null)
        {
            string err = "";
            lblerrms.Text = "Sorry this page has some error.Kindly report to webmaster.You need to login again to the application";

            string         Strerr = "select ProductMaster.ProductName,PricePlanName, CompanyMaster.PlanId from CompanyMaster inner join PricePlanMaster on PricePlanMaster.PricePlanId=CompanyMaster.PlanId inner join VersionInfoMaster on VersionInfoMaster.VersionInfoId=PricePlanMaster.VersionInfoMasterId inner join ProductMaster on ProductMaster.ProductId=VersionInfoMaster.ProductId  where CompanyLoginId='" + Session["Comid"].ToString() + "'";
            SqlCommand     cidco  = new SqlCommand(Strerr, PageConn.licenseconn());
            SqlDataAdapter adc    = new SqlDataAdapter();
            DataTable      dts    = new DataTable();
            if (dts.Rows.Count > 0)
            {
                err += err + "<br><b>Product Name :</b>" + dts.Rows[0]["ProductName"];
                err += err + "<br><b>Price Name :</b>" + dts.Rows[0]["PricePlanName"];
                err += err + "<br><b>Company Id :</b>" + Session["Comid"];
            }
            err = err + "<br><b>Error Caught in Page :</b>" + Request.Url.ToString();
            string bodytext = "<br><br><span style=\"font-size:14px; font-family:Calibri; text-align:left\">Thanks</span>";

            StringBuilder support = new StringBuilder();
            support.Append("<table style=\"font-size:14px; font-family:Calibri; text-align:left\" width=\"100%\"> ");
            support.Append("<tr>Support Team</span></b>");
            support.Append("<tr>Busiwiz.com</span></b>");
            support.Append("<br></table> ");

            string bodyformate = "" + err + "<br>" + bodytext + "<br>" + support;
            // Server.ClearError();
            try
            {
                MailAddress to       = new MailAddress("*****@*****.**");
                MailAddress from     = new MailAddress("*****@*****.**");
                MailMessage objEmail = new MailMessage(from, to);
                objEmail.Subject = "Page Error Message";

                objEmail.Body       = bodyformate.ToString();
                objEmail.IsBodyHtml = true;
                objEmail.Priority   = MailPriority.High;

                SmtpClient client = new SmtpClient();
                client.Credentials = new NetworkCredential("*****@*****.**", "Jk2012++");
                client.Host        = "mail.aacpa.us";
                client.Send(objEmail);
            }
            catch (Exception e)
            {
            }
            Session.Clear();
            Session.Abandon();
            Response.AddHeader("Pragma", "no-cache");
            Response.Cache.SetAllowResponseInBrowserHistory(false);
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetNoStore();
            Response.Expires = -1;
        }
        else
        {
            lblerrms.Text = "Your session timeout limit has been reached login required.....";
        }

        //  Exception objerr = Server.GetLastError().GetBaseException();
        //  string err = "<b> Error Caught in Page_Error event</b><br><br>" +
        //      "<br><b>Error In :</b>" + Request.Url.ToString() +
        //          "<br><b>Error Message:</b>" + objerr.Message.ToString() +
        //          "<br><b>Stack Trace :</b><br>" +
        //          objerr.StackTrace.ToString();
        ////  Response.Write(err.ToString());
        //  Server.ClearError();
    }
    //public void Companyid()
    //{
    //    con.Open();
    //    SqlCommand cmd = new SqlCommand("select Companyid from CompanyAboutUSInputTBL where ID ='" + ViewState["id"] + "'", con);

    //}
    public void Sendmail2()// admin to comp
    {
        try
        {
            //string str2 = "select Party_master.id,Email,CompanyAboutUSInputTBL.Companyid,CompanyMaster.CompanyName  from CompanyMaster inner join Party_master on Party_master.id=CompanyMaster.Compid inner join CompanyAboutUsInputTBL on CompanyAboutUsInputTBL.Companyid=CompanyMaster.Compid where CompanyAboutUsInputTBL.Companyid='" + ViewState["id"] + "'";
            string str2 = "select Party_master.id,Email,CompanyAboutUSInputTBL.Companyid,CompanyMaster.CompanyName  from CompanyMaster inner join Party_master on Party_master.id=CompanyMaster.Compid inner join CompanyAboutUsInputTBL on CompanyAboutUsInputTBL.Companyid=CompanyMaster.Compid where Party_master.id=compid ";
            //string str2 = "select CompanyMaster.CompanyName,Email,VacancyPositionTitle from CompanyMaster inner join Party_master on  Party_master.id=CompanyMaster.Compid inner join VacancyPositionTitleMaster on VacancyPositionTitleMaster.ID=VacancyMasterTbl.vacancypositiontitleid where VacancyMasterTbl.ID='" + Session["id"] + "'";
            SqlCommand     cmd1 = new SqlCommand(str2, con);
            SqlDataAdapter adp1 = new SqlDataAdapter(cmd1);
            DataTable      dt11 = new DataTable();
            adp1.Fill(dt11);

            //// string str3 = "  select comid,VacancyTypeMaster.Name,VacancyPositionTitleMaster.VacancyPositionTitle,noofvacancy,vacancyduration,QualificationRequirements from VacancyMasterTbl inner join VacancyTypeMaster on VacancyTypeMaster.ID =VacancyMasterTbl.vacancypositiontypeid  inner join VacancyPositionTitleMaster on VacancyPositionTitleMaster.ID=vacancypositiontitleid inner join VacancyDetailTbl on VacancyMasterTbl.ID=VacancyDetailTbl.vacancymasterid where VacancyMasterTbl.ID=" + Session["id"] + "";
            // SqlCommand cmd3 = new SqlCommand(str3, con);
            // SqlDataAdapter adp = new SqlDataAdapter(cmd3);
            // DataTable dt35 = new DataTable();
            // adp.Fill(dt35);


            string         str21 = "  select distinct  PortalMasterTbl.* from  CompanyMaster inner join PricePlanMaster  on CompanyMaster.PricePlanId=PricePlanMaster.PricePlanId inner join VersionInfoMaster on VersionInfoMaster.VersionInfoId=PricePlanMaster.VersionInfoMasterId inner join ProductMaster on VersionInfoMaster.ProductId=ProductMaster.ProductId inner join ClientMaster on ProductMaster.ClientMasterId=ClientMaster.ClientMasterId inner join Priceplancategory on Priceplancategory.ID=PricePlanMaster.PriceplancatId inner join PortalMasterTbl on PortalMasterTbl.Id=Priceplancategory.PortalId   inner join OrderMaster on CompanyMaster.CompanyLoginId=OrderMaster.CompanyLoginId inner join  OrderPaymentSatus on OrderMaster.OrderId=OrderPaymentSatus.OrderId inner join StateMasterTbl on StateMasterTbl.StateId=PortalMasterTbl.StateId inner join CountryMaster on StateMasterTbl.CountryId=CountryMaster.CountryId  WHERE(PortalMasterTbl.Id=7)  ";
            SqlCommand     cmd45 = new SqlCommand(str21, PageConn.licenseconn());
            SqlDataAdapter adp45 = new SqlDataAdapter(cmd45);
            DataTable      dt21  = new DataTable();
            adp45.Fill(dt21);

            string aa          = "";
            string bb          = "";
            string cc          = "";
            string ff          = "";
            string ee          = "";
            string dd          = "";
            string ext         = "";
            string tollfree    = "";
            string tollfreeext = "";
            if (dt21.Rows.Count > 0)
            {
                if (Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != null)
                {
                    ext = "ext " + dt21.Rows[0]["Supportteamphonenoext"].ToString();
                }

                if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
                {
                    tollfree = dt21.Rows[0]["Tollfree"].ToString();
                }

                if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
                {
                    tollfreeext = "ext " + dt21.Rows[0]["Tollfreeext"].ToString();
                }


                aa = "" + dt21.Rows[0]["Supportteammanagername"].ToString() + "- Support Manager";
                bb = "" + dt21.Rows[0]["PortalName"].ToString() + " ";
                cc = "" + dt21.Rows[0]["Supportteamphoneno"].ToString() + "  " + ext + " ";
                dd = "" + tollfree + " " + tollfreeext + " ";
                ee = "" + dt21.Rows[0]["Portalmarketingwebsitename"].ToString() + "";
                // ff = "" + dt21.Rows[0]["City"].ToString() + " " + dt21.Rows[0]["StateName"].ToString() + " " + dt21.Rows[0]["CountryName"].ToString() + " " + dt21.Rows[0]["Zip"].ToString() + " ";
            }
            string tomail = dt11.Rows[0]["Email"].ToString();
            if (dt21.Rows.Count > 0)
            {
                string file = "job-center-logo.jpg";
                //string body1 =   "Dear " + dt11.Rows[0]["CompanyName"].ToString() + " <br><br> The altrations you are requestedto be made to our company's ijobcenter.com " + " website About Us have been rejected for following reasons: <br>"
                //   +TextBox3.Text+ " <br> <br>" + "Please make the appropraite changes to the alterations you are requesting and submit the request again.<br><br> " + "Thank you,<br><br>" ;

                string email       = Convert.ToString(dt21.Rows[0]["UserIdtosendmail"]);
                string displayname = Convert.ToString("IJobCenter");
                string password    = Convert.ToString(dt21.Rows[0]["Password"]);
                string outgo       = Convert.ToString(dt21.Rows[0]["Mailserverurl"]);
                string body        = "Dear " + dt11.Rows[0]["CompanyName"].ToString() + " <br><br> The altrations you are requested to be made to our company's ijobcenter.com <br/>" + " website have been rejected for following reasons: <br/><br/>"
                                     + TextBox3.Text + " <br> <br><br> <br>" + "Please make the appropraite changes to the alterations you are requesting and submit the request again.<br><br> " + "Thank you,<br><br>"; //body1;
                string Subject = "About Us Rejected";


                MailAddress to       = new MailAddress(tomail);//[email protected]("*****@*****.**");//
                MailAddress from     = new MailAddress(email, displayname);
                MailMessage objEmail = new MailMessage(from, to);
                objEmail.Subject = Subject.ToString();
                objEmail.Body    = body.ToString();


                //string path = "http://members.ijobcenter.com/Account/jobcenter/UploadedDocuments/"+dt15.Rows[0][0].ToString()+"";
                //System.Net.Mail.Attachment attachment;
                //attachment = new System.Net.Mail.Attachment(path);
                //objEmail.Attachments.Add(attachment);

                objEmail.IsBodyHtml = true;
                objEmail.Priority   = MailPriority.High;
                SmtpClient client = new SmtpClient();
                client.Credentials = new NetworkCredential(email, password);
                client.Host        = outgo;
                client.Send(objEmail);
            }
        }
        catch
        {
        }
    }
Пример #19
0
    public void sendmail()
    {
        string         str21 = "  select distinct  PortalMasterTbl.* from  CompanyMaster inner join PricePlanMaster  on CompanyMaster.PricePlanId=PricePlanMaster.PricePlanId inner join VersionInfoMaster on VersionInfoMaster.VersionInfoId=PricePlanMaster.VersionInfoMasterId inner join ProductMaster on VersionInfoMaster.ProductId=ProductMaster.ProductId inner join ClientMaster on ProductMaster.ClientMasterId=ClientMaster.ClientMasterId inner join Priceplancategory on Priceplancategory.ID=PricePlanMaster.PriceplancatId inner join PortalMasterTbl on PortalMasterTbl.Id=Priceplancategory.PortalId   inner join OrderMaster on CompanyMaster.CompanyLoginId=OrderMaster.CompanyLoginId inner join  OrderPaymentSatus on OrderMaster.OrderId=OrderPaymentSatus.OrderId  inner join StateMasterTbl on StateMasterTbl.StateId=PortalMasterTbl.StateId inner join CountryMaster on StateMasterTbl.CountryId=CountryMaster.CountryId  WHERE(PortalMasterTbl.Id=7)  ";
        SqlCommand     cmd45 = new SqlCommand(str21, PageConn.licenseconn());
        SqlDataAdapter adp45 = new SqlDataAdapter(cmd45);
        DataTable      dt21  = new DataTable();

        adp45.Fill(dt21);

        string aa          = "";
        string bb          = "";
        string cc          = "";
        string ff          = "";
        string ee          = "";
        string dd          = "";
        string ext         = "";
        string tollfree    = "";
        string tollfreeext = "";


        if (Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != null)
        {
            ext = "ext " + dt21.Rows[0]["Supportteamphonenoext"].ToString();
        }

        if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
        {
            tollfree = dt21.Rows[0]["Tollfree"].ToString();
        }

        if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
        {
            tollfreeext = "ext " + dt21.Rows[0]["Tollfreeext"].ToString();
        }
        if (dt21.Rows.Count > 0)
        {
            aa = "" + dt21.Rows[0]["Supportteammanagername"].ToString() + "- Support Manager";
            bb = "" + dt21.Rows[0]["PortalName"].ToString() + " ";
            cc = "" + dt21.Rows[0]["Supportteamphoneno"].ToString() + "  " + ext + " ";
            dd = "" + tollfree + " " + tollfreeext + " ";
            ee = "" + dt21.Rows[0]["Portalmarketingwebsitename"].ToString() + "";
        }
        if (dt21.Rows.Count > 0)
        {
            //ViewState["vacid"] = Session["vacanyid"].ToString();
            string file  = "job-center-logo.jpg";
            string body1 = "<br>  <img src=\"http://members.ijobcenter.com/images/" + file + "\" \"border=\"0\" Width=\"90\" Height=\"80\" / > <br>Dear Admin, <br><br>The following message was posted to " + TextBox2.Text + " by " + TextBox1.Text + ". Please review the particulars of the message for authorization.  <br><br>Name: " + TextBox1.Text + " <br>Company Name: " + TextBox2.Text + "<br>Phone No.: " + TextBox3.Text + "<br>Email: " + TextBox4.Text + "<br>Message : " + TextBox5.Text + "<br><br>" +
                           " If you wish to approve this message and permit its posting click <a href=http://www.ijobcenter.com/MessageAuthorizationConfirmation.aspx?id=" + ClsEncDesc.Encrypted(ViewState["id"].ToString()) + " target=_blank > here </a>  or copy and paste the following URL into your internet browser.<br><br>http://www.ijobcenter.com/MessageAuthorizationConfirmation.aspx?id=" + ClsEncDesc.Encrypted(ViewState["id"].ToString()) + " <br><br>If you wish to reject this message and discard its posting click <a href=http://www.ijobcenter.com/MessageAuthorizationConfirmation.aspx?id1=" + ClsEncDesc.Encrypted(ViewState["id"].ToString()) + " target=_blank > here </a>   or copy and paste the following URL into your internet browser.<br><br>http://www.ijobcenter.com/MessageAuthorizationConfirmation.aspx?id1=" + ClsEncDesc.Encrypted(ViewState["id"].ToString()) + " <br><br>Thank you,</span><br><br>IJobCenter Support Team<br>" + aa + "<br>" + bb + "<br>" + cc + "<br>" + ee + "";

            string email       = Convert.ToString(dt21.Rows[0]["UserIdtosendmail"]);
            string displayname = Convert.ToString("IJobCenter");
            string password    = Convert.ToString(dt21.Rows[0]["Password"]);
            string outgo       = Convert.ToString(dt21.Rows[0]["Mailserverurl"]);
            string body        = body1;
            string Subject     = "Enquiry For Ijobcenter";

            MailAddress to       = new MailAddress("*****@*****.**");
            MailAddress from     = new MailAddress(email, displayname);
            MailMessage objEmail = new MailMessage(from, to);
            objEmail.Subject    = Subject.ToString();
            objEmail.Body       = body.ToString();
            objEmail.IsBodyHtml = true;
            objEmail.Priority   = MailPriority.High;
            SmtpClient client = new SmtpClient();
            client.Credentials = new NetworkCredential(email, password);
            client.Host        = outgo;
            client.Send(objEmail);
            clr();
            // Response.Write("<script>alert('Successfully Receive your Message!!')</script> ");
        }
    }
    //public string getWelcometext()
    //{


    //    string str = "SELECT EmailContentMaster.EmailContent, EmailContentMaster.EntryDate, CompanyWebsitMaster.SiteUrl, EmailTypeMaster.EmailTypeId " +
    //                " FROM CompanyWebsitMaster INNER JOIN " +
    //                  " EmailContentMaster ON CompanyWebsitMaster.CompanyWebsiteMasterId = EmailContentMaster.CompanyWebsiteMasterId INNER JOIN " +
    //                  " EmailTypeMaster ON EmailContentMaster.EmailTypeId = EmailTypeMaster.EmailTypeId " +
    //                " WHERE     (EmailTypeMaster.EmailTypeId = 1)  and (EmailTypeMaster.Compid='" + Session["Comid"].ToString() + "')" +
    //                " ORDER BY EmailContentMaster.EntryDate DESC ";
    //    SqlCommand cmd = new SqlCommand(str, connection);

    //    SqlDataAdapter adp = new SqlDataAdapter(cmd);
    //    DataTable ds = new DataTable();
    //    adp.Fill(ds);
    //    string welcometext = "";
    //    if (ds.Rows.Count > 0)
    //    {
    //        welcometext = ds.Rows[0]["EmailContent"].ToString();

    //    } return welcometext;

    //}
    public void sendmail(string To)
    {
        string         str = " Select  Distinct CompanyMaster.Compid,CompanyWebsitMaster.MasterEmailId,CompanyWebsitMaster.SiteUrl,CompanyWebsitMaster.Sitename, CompanyWebsitMaster.OutGoingMailServer,CompanyWebsitMaster.WebMasterEmail,CompanyWebsitMaster.EmailMasterLoginPassword, User_master.EmailID,User_master.UserID,CompanyMaster.CompanyLogo,CompanyMaster.CompanyName,CompanyAddressMaster.Email,CompanyAddressMaster.Fax,CompanyAddressMaster.Phone from User_master inner join Party_master on  Party_master.PartyID=User_master.PartyID inner join WareHouseMaster on WareHouseMaster.WareHouseId=Party_master.Whid inner join CompanyMaster on CompanyMaster.Compid=WareHouseMaster.comid inner join CompanyAddressMaster on CompanyAddressMaster.CompanyMasterId=CompanyMaster.CompanyId inner join CompanyWebsitMaster on CompanyWebsitMaster.WHId=WareHouseMaster.WareHouseId where User_master.EmailID='" + To + "'";
        SqlCommand     cmd = new SqlCommand(str, connection);
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        DataTable      dt  = new DataTable();

        adp.Fill(dt);
        if (dt.Rows.Count > 0)
        {
            StringBuilder strhead = new StringBuilder();
            strhead.Append("<table style=\"font-size:14px; font-family:Calibri\" width=\"100%\"> ");
            strhead.Append("<tr><td align=\"left\"> <img src=\"ShoppingCart/images/" + Convert.ToString(dt.Rows[0]["CompanyLogo"]) + "\" \"border=\"0\" Width=\"176px\" Height=\"106px\" / > </td><td align=\"right\"><b><span style=\"color: #996600\">" + Convert.ToString(dt.Rows[0]["CompanyName"]) + "</span></b><Br><b>" + dt.Rows[0]["Sitename"].ToString() + "</b><BR><b>Phone Number:</b>" + Convert.ToString(dt.Rows[0]["Phone"]) + "<Br><b>Fax Number:</b>" + Convert.ToString(dt.Rows[0]["Fax"]) + "<Br><b>Email:</b>" + Convert.ToString(dt.Rows[0]["Email"]) + "<Br><b>Website:</b>" + dt.Rows[0]["SiteUrl"].ToString() + " </td></tr>  ");
            strhead.Append("<br><br></table> ");
            // StringBuilder strAddress = new StringBuilder();

            //string body = " <br><br><left>Did you Request a password reset for your account ("+To+")?</left><br><br> ";
            //body =body + "if you requested this password reset, go here:<br>";
            //body = body + "<a href=http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/Resetpassword.aspx?to="+To+">http://" +Request.Url.Host.ToString()+"/Shoppingcart/admin/Resetpassword.aspx?to="+To+"</a><br>";

            SqlDataAdapter daas = new SqlDataAdapter("select employeename from employeemaster inner join User_master on User_master.PartyID=EmployeeMaster.PartyID where username='******'", connection);
            DataTable      dtss = new DataTable();
            daas.Fill(dtss);

            string employeenameee = "";
            if (dtss.Rows.Count > 0)
            {
                employeenameee = Convert.ToString(dtss.Rows[0]["employeename"]);
            }
            else
            {
                employeenameee = "";
            }

            string         sel  = "select max(PartyID) as PartyID from Party_master where Id='" + Convert.ToInt32(Session["Comid"]) + "'";
            SqlCommand     cmd5 = new SqlCommand(sel, connection);
            SqlDataAdapter da5  = new SqlDataAdapter(cmd5);
            DataSet        ds5  = new DataSet();
            da5.Fill(ds5);

            SqlDataAdapter daas3 = new SqlDataAdapter("select EmployeeNo from EmployeePayrollMaster inner join employeemaster on  employeemaster.EmployeeMasterID=EmployeePayrollMaster.EmpId inner join User_master  on User_master.PartyID=EmployeeMaster.PartyID where username='******'", connection);
            DataTable      dtss3 = new DataTable();
            daas3.Fill(dtss3);

            string employeenum = "";
            if (dtss3.Rows.Count > 0)
            {
                employeenum = Convert.ToString(dtss3.Rows[0]["EmployeeNo"]);
            }
            else
            {
                employeenum = "";
            }

            SqlDataAdapter daas4 = new SqlDataAdapter("select Employeecode from EmployeeBarcodeMaster inner join employeemaster on employeemaster.EmployeeMasterID=EmployeeBarcodeMaster.Employee_Id inner join User_master on User_master.PartyID=EmployeeMaster.PartyID where username='******'", connection);
            DataTable      dtss4 = new DataTable();
            daas4.Fill(dtss4);

            string employeecodee = "";
            if (dtss4.Rows.Count > 0)
            {
                employeecodee = Convert.ToString(dtss4.Rows[0]["Employeecode"]);
            }
            else
            {
                employeecodee = "";
            }

            ViewState["partyidforemail"] = Convert.ToInt32(ds5.Tables[0].Rows[0]["PartyId"].ToString());

            string         accountdetailofparty = "select Party_master.*,CountryMaster.CountryName,StateMasterTbl.StateName,CityMasterTbl.CityName from Party_master  left outer join CountryMaster on CountryMaster.CountryId=Party_master.Country left outer join StateMasterTbl on StateMasterTbl.StateId=Party_master.State left outer join CityMasterTbl on CityMasterTbl.CityId=Party_master.City inner join User_master on User_master.PartyID=Party_master.PartyID where Party_master.id='" + Convert.ToInt32(Session["Comid"]) + "' and Party_master.PartyID='" + ViewState["partyidforemail"] + "' ";
            SqlCommand     cmdpartydetail       = new SqlCommand(accountdetailofparty, connection);
            SqlDataAdapter adppartydetail       = new SqlDataAdapter(cmdpartydetail);
            DataTable      dspartydetail        = new DataTable();
            string         Accountdetail12      = "";
            adppartydetail.Fill(dspartydetail);

            string country = Convert.ToString(dspartydetail.Rows[0]["CountryName"]);
            string state   = Convert.ToString(dspartydetail.Rows[0]["StateName"]);
            string city    = Convert.ToString(dspartydetail.Rows[0]["CityName"]);
            string zipcode = Convert.ToString(dspartydetail.Rows[0]["Zipcode"]);
            string address = Convert.ToString(dspartydetail.Rows[0]["Address"]);
            string phonnum = Convert.ToString(dspartydetail.Rows[0]["Phoneno"]);
            string emaail  = Convert.ToString(dspartydetail.Rows[0]["Email"]);


            //if (dspartydetail.Rows.Count > 0)
            //{
            Accountdetail12 = "<br><br>Below are your contact details. If you find any information that is incorrect, please change them from My Personal Profile page.<br> <br>Employee Name: " + employeenameee + "<br>Employee Number: " + employeenum + "<br>Employee Code: " + employeecodee + " <br>Address: " + address + " <br>City, State/Province, Country : " + country + "," + state + "," + city + "<br>ZIP/Postal Code: " + zipcode + "<br>Phone Number: " + phonnum + "<br>Email: " + emaail + " ";
            //<strong><span style=\"color: #996600\"></span></strong>
            //}

            string loginurl = Request.Url.Host.ToString() + "/Shoppingcart/Admin/ResetPasswordUser.aspx";

            SqlDataAdapter daas1 = new SqlDataAdapter("select username,password from Login_master where username='******'", connection);
            DataTable      dtss1 = new DataTable();
            daas1.Fill(dtss1);



            if (dtss1.Rows.Count > 0)
            {
                string pwd = dtss1.Rows[0]["password"].ToString();
                pwd1 = ClsEncDesc.Decrypted(pwd);
            }

            string body = " <br><br><span style=\"font-size:14px; font-family:Calibri; text-align:left\">Dear " + employeenameee + ", </span><br><br> ";
            body = body + "<br><br><span style=\"font-size:14px; font-family:Calibri; text-align:left\">You have requested to change your login information. Please click <a href=http://itimekeeper.com/shoppingcart/admin/resetpassworduser.aspx target=_blank > here</a> to change your information now, or click on the link below.</span><br> ";
            body = body + "<br><br><span style=\"font-size:14px; font-family:Calibri; text-align:left\">http://" + loginurl + " </span><br><br> ";
            body = body + "<table style=\"font-size:14px; font-family:Calibri\"><tr><td><left>Company Name : " + Convert.ToString(dt.Rows[0]["CompanyName"]) + "</left><br></td></tr>";
            //body = body + "<tr><td><left>Login URL: </left></td><td><left>: " + loginurl + "</left><br></td></tr>";
            body = body + "<tr><td><left>Company ID : " + Session["Comid"] + "</left><br></td></tr>";
            body = body + "<tr><td><left>Temporary User ID : " + dtss1.Rows[0]["username"].ToString() + "</left><br></td></tr>";
            body = body + "<tr><td><left>Temporary Password : "******"</left><br><br></td></tr>";
            body = body + "<tr><td><left>Please ensure that you change your user ID and password as soon as possible, for your own account security.</left><br><br></td></tr>";
            body = body + "<tr><td><left>" + Accountdetail12 + "</left></td></tr>";
            //body = body + "<span style=\"font-size:14px; font-family:Calibri; text-align:left\">To change the password, please click on the link below</span><br>";
            //body = body + "<a href=http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/Resetpassword.aspx?to=" + ClsEncDesc.Encrypted(ViewState["maxid"].ToString()) + ">http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/Resetpassword.aspx?to=" + ClsEncDesc.Encrypted(ViewState["maxid"].ToString()) + "</a><br><br>";
            //body = body + "<span style=\"font-size:14px; font-family:Calibri; text-align:left\">If you have not sent any such password change request,just ignore this email.</span><br><br>";
            //body = body + "<span style=\"font-size:14px; font-family:Calibri; text-align:left\">If you have any other technical question, Please do not hesitate to contact by email our technical</span><br>";
            //body = body + "<span style=\"font-size:14px; font-family:Calibri; text-align:left\">Support team at [email protected]</span><br><br>";



            string bodytext = "<br><span style=\"font-size:14px; font-family:Calibri; text-align:left\">Thank you and have a great day.<br><br>Sincerely,<br><br>The Admin Team at " + Convert.ToString(dt.Rows[0]["CompanyName"]) + "</span>";
            // " + dt.Rows[0]["Sitename"].ToString() + "
            StringBuilder support = new StringBuilder();
            support.Append("<table style=\"font-size:14px; font-family:Calibri; text-align:left\" width=\"100%\"> ");
            support.Append("<tr><td align=\"left\"><b><span style=\"color: #996600\">" + Session["productname"] + "</span></b>");
            support.Append("<br></table> ");
            string bodyformate = "" + strhead + "<br>" + body + "<br>" + bodytext + "<br>" + support + "";
            try
            {
                string         strdy = " SELECT ClientMaster.OutgoingServerUserID,ClientMaster.OurgoingServerSMTP,ClientMaster.OutgoingServerPassword from CompanyMaster inner join ProductMaster on ProductMaster.ProductId=CompanyMaster.ProductId inner join ClientMaster on ClientMaster.ClientMasterId=ProductMaster.ClientMasterId where CompanyMaster.CompanyLoginId='" + Convert.ToString(dt.Rows[0]["Compid"]) + "'";
                SqlCommand     cmddy = new SqlCommand(strdy, PageConn.licenseconn());
                SqlDataAdapter adpdy = new SqlDataAdapter(cmddy);
                DataTable      dtdy  = new DataTable();
                adpdy.Fill(dtdy);
                if (dtdy.Rows.Count > 0)
                {
                    MailAddress to       = new MailAddress(To);
                    MailAddress from     = new MailAddress(dtdy.Rows[0]["OutgoingServerUserID"].ToString());
                    MailMessage objEmail = new MailMessage(from, to);
                    objEmail.Subject = "" + Session["productname"] + " - " + Convert.ToString(dt.Rows[0]["CompanyName"]) + " - Request for Password Reset";

                    objEmail.Body       = bodyformate.ToString();
                    objEmail.IsBodyHtml = true;
                    objEmail.Priority   = MailPriority.High;

                    SmtpClient client = new SmtpClient();
                    client.Credentials = new NetworkCredential(dtdy.Rows[0]["OutgoingServerUserID"].ToString(), dtdy.Rows[0]["OutgoingServerPassword"].ToString());
                    client.Host        = dtdy.Rows[0]["OurgoingServerSMTP"].ToString();
                    client.Send(objEmail);
                    lblmsg.Visible       = true;
                    lblmsg.Text          = "You will get your password by Email";
                    txtuname.Text        = "";
                    Panel2.Visible       = false;
                    ImageButton6.Visible = false;
                }
            }
            catch (Exception e)
            {
                lblmsg.Visible = true;
                //lblmsg.Text = e.ToString();
                lblmsg.Text = "Email Id or User Name is invalid for this Company";
            }
        }
    }
    public void sendmail()
    {
        string         ss   = "  select CompanyName from CompanyMaster where Compid='" + ViewState["comid"] + "'";
        SqlDataAdapter da34 = new SqlDataAdapter(ss, con);
        DataTable      dt34 = new DataTable();

        da34.Fill(dt34);



        string         cand = "SELECT CandidateMaster.FirstName, Party_master.Email  FROM  CandidateMaster INNER JOIN Party_master ON CandidateMaster.PartyID = Party_master.PartyID  WHERE CandidateMaster.CandidateId =" + Session["candid"] + " ";
        SqlDataAdapter da1  = new SqlDataAdapter(cand, con);
        DataTable      dt1  = new DataTable();

        da1.Fill(dt1);
        ViewState["Name"] = dt1.Rows[0][0].ToString();
        string mailto = dt1.Rows[0][1].ToString();//"*****@*****.**"; //



        try
        {
            string         str21 = "  select distinct  PortalMasterTbl.* from  CompanyMaster inner join PricePlanMaster  on CompanyMaster.PricePlanId=PricePlanMaster.PricePlanId inner join VersionInfoMaster on VersionInfoMaster.VersionInfoId=PricePlanMaster.VersionInfoMasterId inner join ProductMaster on VersionInfoMaster.ProductId=ProductMaster.ProductId inner join ClientMaster on ProductMaster.ClientMasterId=ClientMaster.ClientMasterId inner join Priceplancategory on Priceplancategory.ID=PricePlanMaster.PriceplancatId inner join PortalMasterTbl on PortalMasterTbl.Id=Priceplancategory.PortalId   inner join OrderMaster on CompanyMaster.CompanyLoginId=OrderMaster.CompanyLoginId inner join  OrderPaymentSatus on OrderMaster.OrderId=OrderPaymentSatus.OrderId  inner join StateMasterTbl on StateMasterTbl.StateId=PortalMasterTbl.StateId inner join CountryMaster on StateMasterTbl.CountryId=CountryMaster.CountryId  WHERE(PortalMasterTbl.Id=7)  ";
            SqlCommand     cmd45 = new SqlCommand(str21, PageConn.licenseconn());
            SqlDataAdapter adp45 = new SqlDataAdapter(cmd45);
            DataTable      dt21  = new DataTable();
            adp45.Fill(dt21);

            string aa          = "";
            string bb          = "";
            string cc          = "";
            string ff          = "";
            string ee          = "";
            string dd          = "";
            string ext         = "";
            string tollfree    = "";
            string tollfreeext = "";


            if (Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != null)
            {
                ext = "ext " + dt21.Rows[0]["Supportteamphonenoext"].ToString();
            }

            if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
            {
                tollfree = dt21.Rows[0]["Tollfree"].ToString();
            }

            if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
            {
                tollfreeext = "ext " + dt21.Rows[0]["Tollfreeext"].ToString();
            }
            if (dt21.Rows.Count > 0)
            {
                aa = "" + dt21.Rows[0]["Supportteammanagername"].ToString() + "- Support Manager";
                bb = "" + dt21.Rows[0]["PortalName"].ToString() + " ";
                cc = "" + dt21.Rows[0]["Supportteamphoneno"].ToString() + "  " + ext + " ";
                dd = "" + tollfree + " " + tollfreeext + " ";
                ee = "" + dt21.Rows[0]["Portalmarketingwebsitename"].ToString() + "";
            }
            if (dt21.Rows.Count > 0)
            {
                string file  = "jobcenterlogo.jpg";
                string body1 = "<br><img src=\"http://http://www.ijobcenter.com/Images/" + file + "\" \"border=\"0\" Width=\"90\" Height=\"80\" / >  <br>  Dear " + ViewState["Name"] + " <br><br>" + dt34.Rows[0][0].ToString() + " has rejected your applied vacancy " + ViewState["vacancyname"] + ". <br><br>Thank you,</span><br><br>IJobCenter Support Team<br>" + aa + "<br>" + bb + "<br>" + cc + "<br>" + ee + "";

                string email       = Convert.ToString(dt21.Rows[0]["UserIdtosendmail"]);
                string displayname = Convert.ToString("IJobCenter");
                string password    = Convert.ToString(dt21.Rows[0]["Password"]);
                string outgo       = Convert.ToString(dt21.Rows[0]["Mailserverurl"]);
                string body        = body1;
                string Subject     = "Reject your applied vacancy";

                MailAddress to       = new MailAddress(mailto);
                MailAddress from     = new MailAddress(email, displayname);
                MailMessage objEmail = new MailMessage(from, to);
                objEmail.Subject    = Subject.ToString();
                objEmail.Body       = body.ToString();
                objEmail.IsBodyHtml = true;
                objEmail.Priority   = MailPriority.High;
                SmtpClient client = new SmtpClient();
                client.Credentials = new NetworkCredential(email, password);
                client.Host        = outgo;
                client.Send(objEmail);
            }
        }


        catch
        {
            lblmsg.Text = "Error..... ";
        }
    }
    public void sendmailtoAdmin() // mail send to [email protected] admin
    {
        // Session["Comid"] = "d1989";
        string ADDRESSEX = "";
        string logg      = "";
        string business  = "";

        if (Request.QueryString["Id"] != null)
        {
            ADDRESSEX = "SELECT distinct CompanyMaster.CompanyLogo, CompanyMaster.CompanyName,CompanyWebsitMaster.Sitename,CompanyWebsitMaster.MasterEmailId,CompanyWebsitMaster.EmailMasterLoginPassword,CompanyWebsitMaster.OutGoingMailServer, CompanyWebsitMaster.EmailSentDisplayName,CompanyWebsitMaster.SiteUrl,CompanyWebsiteAddressMaster.Address1,CompanyWebsiteAddressMaster.Address2,CompanyWebsiteAddressMaster.Phone1, CompanyWebsiteAddressMaster.Phone2, CompanyWebsiteAddressMaster.TollFree1, CompanyWebsiteAddressMaster.Fax,CompanyWebsiteAddressMaster.Email,CompanyMaster.CompanyId,CompanyWebsitMaster.WHid FROM  CompanyMaster LEFT OUTER JOIN AddressTypeMaster RIGHT OUTER JOIN CompanyWebsiteAddressMaster ON AddressTypeMaster.AddressTypeMasterId = CompanyWebsiteAddressMaster.AddressTypeMasterId RIGHT OUTER JOIN CompanyWebsitMaster ON CompanyWebsiteAddressMaster.CompanyWebsiteMasterId = CompanyWebsitMaster.CompanyWebsiteMasterId ON CompanyMaster.CompanyId = CompanyWebsitMaster.CompanyId where  WHId='1'";
            ADDRESSEX = "SELECT Id, ProductId, PortalName, DefaultPagename, LogoPath, EmailDisplayname, EmailId, UserIdtosendmail, Password, Mailserverurl, Supportteamemailid, Supportteamphoneno, Supportteammanagername, Portalmarketingwebsitename, Address1, Address2, CountryId, StateId, City, Zip, PhoneNo, Fax, Status, Supportteamphonenoext, Tollfree, Tollfreeext, CompanyCreationOption, DatabaseURL, DatabaseName, PortNo, UserID, UserPassword, PortalRunningCompanyID, Colorportal FROM   dbo.PortalMasterTbl WHERE (ProductId = '2056') AND(Id = '7')";
            logg      = "select LogoUrl from CompanyWebsitMaster where whid='1'";

            business = "select Warehousemaster.Name,CompanyWebsiteAddressMaster.Address1,CompanyWebsiteAddressMaster.Address2,CompanyWebsiteAddressMaster.Phone1,CompanyWebsiteAddressMaster.Email From Warehousemaster inner join CompanyWebsiteAddressMaster on CompanyWebsiteAddressMaster.CompanyWebsiteMasterId=Warehousemaster.WarehouseID where WarehouseID='1'";
        }
        else
        {
            ADDRESSEX = "SELECT distinct CompanyMaster.CompanyLogo, CompanyMaster.CompanyName,CompanyWebsitMaster.Sitename,CompanyWebsitMaster.MasterEmailId,CompanyWebsitMaster.EmailMasterLoginPassword,CompanyWebsitMaster.OutGoingMailServer, CompanyWebsitMaster.EmailSentDisplayName,CompanyWebsitMaster.SiteUrl,CompanyWebsiteAddressMaster.Address1,CompanyWebsiteAddressMaster.Address2,CompanyWebsiteAddressMaster.Phone1, CompanyWebsiteAddressMaster.Phone2, CompanyWebsiteAddressMaster.TollFree1, CompanyWebsiteAddressMaster.Fax,CompanyWebsiteAddressMaster.Email,CompanyMaster.CompanyId,CompanyWebsitMaster.WHid FROM  CompanyMaster LEFT OUTER JOIN AddressTypeMaster RIGHT OUTER JOIN CompanyWebsiteAddressMaster ON AddressTypeMaster.AddressTypeMasterId = CompanyWebsiteAddressMaster.AddressTypeMasterId RIGHT OUTER JOIN CompanyWebsitMaster ON CompanyWebsiteAddressMaster.CompanyWebsiteMasterId = CompanyWebsitMaster.CompanyWebsiteMasterId ON CompanyMaster.CompanyId = CompanyWebsitMaster.CompanyId where WHId='1'";
            ADDRESSEX = " SELECT Id, ProductId, PortalName, DefaultPagename, LogoPath, EmailDisplayname, EmailId, UserIdtosendmail, Password, Mailserverurl, Supportteamemailid, Supportteamphoneno, Supportteammanagername, Portalmarketingwebsitename, Address1, Address2, CountryId, StateId, City, Zip, PhoneNo, Fax, Status, Supportteamphonenoext, Tollfree, Tollfreeext, CompanyCreationOption, DatabaseURL, DatabaseName, PortNo, UserID, UserPassword, PortalRunningCompanyID, Colorportal FROM   dbo.PortalMasterTbl WHERE (ProductId = '2056') AND(Id = '7')";

            logg = "select LogoUrl from CompanyWebsitMaster where whid='1'";

            business = "select Warehousemaster.Name,CompanyWebsiteAddressMaster.Address1,CompanyWebsiteAddressMaster.Address2,CompanyWebsiteAddressMaster.Phone1,CompanyWebsiteAddressMaster.Email From Warehousemaster inner join CompanyWebsiteAddressMaster on CompanyWebsiteAddressMaster.CompanyWebsiteMasterId=Warehousemaster.WarehouseID where WarehouseID='1'";
        }


        SqlCommand     cmd = new SqlCommand(ADDRESSEX, PageConn.licenseconn());
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        DataTable      ds  = new DataTable();

        adp.Fill(ds);

        SqlDataAdapter dalog = new SqlDataAdapter(logg, con);
        DataTable      dtlog = new DataTable();

        dalog.Fill(dtlog);

        SqlDataAdapter dabus = new SqlDataAdapter(business, con);
        DataTable      dtbus = new DataTable();

        dabus.Fill(dtbus);

        StringBuilder HeadingTable = new StringBuilder();

        HeadingTable.Append("<table width=\"100%\"> ");

        string file = "job-center-logo-changes 33.png";

        HeadingTable.Append("<tr><td width=\"50%\" style=\" align=\"left\" > <img src=\"http://" + Request.Url.Host.ToString() + "/images/" + file + "\" \"border=\"0\" Width=\"90\" Height=\"80\" / > </td></tr>  ");

        HeadingTable.Append("</table> ");


        //    string loginurl = "";//Request.Url.Host.ToString() + "/Shoppingcart/Admin/ResetPasswordUser.aspx";
        //string accountdetailofparty = "SELECT DISTINCT max(ID)  dbo.VacancyMasterTbl.ID, dbo.VacancyMasterTbl.BusinessID, dbo.VacancyMasterTbl.DesignationID, dbo.VacancyMasterTbl.vacancypositiontypeid, dbo.VacancyMasterTbl.vacancypositiontitleid,                          dbo.VacancyMasterTbl.noofvacancy, dbo.VacancyMasterTbl.startdate, dbo.VacancyMasterTbl.enddate, dbo.VacancyMasterTbl.currencyid, dbo.VacancyMasterTbl.salaryamount,                          dbo.VacancyMasterTbl.salaryperperiodid, dbo.VacancyMasterTbl.worktimings, dbo.VacancyMasterTbl.hours, dbo.VacancyMasterTbl.hoursperperiodid, dbo.VacancyMasterTbl.vacancyftptid,                          dbo.VacancyMasterTbl.status, dbo.VacancyMasterTbl.contactname, dbo.VacancyMasterTbl.contactEmail, dbo.VacancyMasterTbl.contactphoneno, dbo.VacancyMasterTbl.contactAddress,                          dbo.VacancyMasterTbl.applybyemail, dbo.VacancyMasterTbl.applybyphone, dbo.VacancyMasterTbl.applybyvisit, dbo.VacancyMasterTbl.applyonline, dbo.VacancyMasterTbl.countryid,                          dbo.VacancyMasterTbl.stateid, dbo.VacancyMasterTbl.cityid, dbo.VacancyMasterTbl.vacancyduration, dbo.VacancyMasterTbl.comid, dbo.VacancyFTPT.Name AS Term, dbo.VacancyMasterTbl.ID AS candidate,                          dbo.VacancyMasterTbl.ID AS Expr1, CASE WHEN (VacancyMasterTbl.status = '1') THEN 'Active By Ijob' WHEN (VacancyMasterTbl.status = '2') THEN 'Active' ELSE 'Inactive' END AS Statuslabel, CAST(dbo.VacancyMasterTbl.salaryamount AS float) AS salary,                          dbo.SalaryPerPeriodMaster.Name AS sss, LEFT(dbo.VacancyDetailTbl.JobFunction, 100) AS JobFunction, LEFT(dbo.VacancyDetailTbl.QualificationRequirements, 25) AS QualificationRequirements,                          dbo.VacancyDetailTbl.TermsandConditions, dbo.CurrencyMaster.CurrencyName AS ccc, dbo.VacancyFTPT.Name AS vvv, dbo.WareHouseMaster.Name AS wname,                          dbo.DepartmentmasterMNC.Departmentname + ':' + dbo.DesignationMaster.DesignationName AS dname, dbo.VacancyTypeMaster.Name AS vname, dbo.DesignationMaster.DesignationName,                          dbo.DepartmentmasterMNC.Departmentname, dbo.CityMasterTbl.CityName FROM            dbo.VacancyMasterTbl INNER JOIN                          dbo.WareHouseMaster ON dbo.WareHouseMaster.WareHouseId = dbo.VacancyMasterTbl.BusinessID INNER JOIN                         dbo.DesignationMaster ON dbo.DesignationMaster.DesignationMasterId = dbo.VacancyMasterTbl.DesignationID INNER JOIN                         dbo.DepartmentmasterMNC ON dbo.DesignationMaster.DeptID = dbo.DepartmentmasterMNC.id INNER JOIN                         dbo.VacancyTypeMaster ON dbo.VacancyTypeMaster.ID = dbo.VacancyMasterTbl.vacancypositiontypeid INNER JOIN                         dbo.CurrencyMaster ON dbo.CurrencyMaster.CurrencyId = dbo.VacancyMasterTbl.currencyid INNER JOIN                         dbo.VacancyFTPT ON dbo.VacancyFTPT.Id = dbo.VacancyMasterTbl.vacancyftptid INNER JOIN                         dbo.SalaryPerPeriodMaster ON dbo.SalaryPerPeriodMaster.ID = dbo.VacancyMasterTbl.salaryperperiodid INNER JOIN                         dbo.VacancyDetailTbl ON dbo.VacancyMasterTbl.ID = dbo.VacancyDetailTbl.vacancymasterid INNER JOIN                         dbo.CityMasterTbl ON dbo.VacancyMasterTbl.cityid = dbo.CityMasterTbl.CityId where VacancyMasterTbl.comid='" + Session["Comid"] + "' ";
        //SqlCommand cmdpartydetail = new SqlCommand(accountdetailofparty, con);
        //SqlDataAdapter adppartydetail = new SqlDataAdapter(cmdpartydetail);
        //DataTable dspartydetail = new DataTable();

        //adppartydetail.Fill(dspartydetail);

        //string AccountInfo;
        //string Accountdetail = "<br>";

        //AccountInfo = ""; //"The following company has posted a Freelance Project in ijobcenter.com<br> <br><br><b>Vacancy Information: </b><br><br>Company Id: " + Session["comid"] + "<br>Department : " +""+ "<br>Project Name: " +"fgyugfy"+ "<br>Project Duration: " + "uiuhyi9" + "<br> Expected Maximum Project Hours: " + "ftyf" + "<br>";
        //for the position of - " + Label11.Text + <br>You can login to our system to see the status of your job application as well as to contact us.<br>

        //Accountdetail12 = "You may view this listing  click <a href=http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/VacancyDetail.aspx?id=" + Session["vac_MaxId"] + " target=_blank > here </a> Alternatively, you may copy and paste the following URL into your browser <br><br>http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/VacancyDetail.aspx?id=" + Session["vac_MaxId"] + "<br><br><br> ";

        //Accountdetail12 += " Do you wish to Approve this Freelance Project and activate this listing on www.ijobcenter.com?  If yes, click <a href=http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/ApprovalFreelance.aspx?FreelanceIDAcept=" + ClsEncDesc.Encrypted(ViewState["promaxid"].ToString()) + "  target=_blank > Yes </a> Alternatively, Or, " +
        //    " <br> copy and paste the following URL in your browser http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/ApprovalFreelance.aspx?FreelanceIDAcept=" + ClsEncDesc.Encrypted(ViewState["promaxid"].ToString()) + "  ";

        //Accountdetail12 += " <br><br>Do you wish to Reject this Freelance Project If yes, click <a href=http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/ApprovalFreelance.aspx?FreelanceIDReject=" + ClsEncDesc.Encrypted(ViewState["promaxid"].ToString()) + "  target=_blank > Yes </a> Alternatively, Or, " +
        //    " copy and paste the following URL in your browser http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/ApprovalFreelance.aspx?FreelanceIDReject=" + ClsEncDesc.Encrypted(ViewState["promaxid"].ToString()) + "  ";


        string Accountdetail12 = "";

        Accountdetail12 += " " + ViewState["companyname"] + " is requesting that changes be made to their About Us page. You can review the changes and decide whether to approve or reject the requested changes by clicking  <a href=http://www.ijobcenter.com/CompanySiteAboutUsViewforApproval.aspx?id1=" + ClsEncDesc.Encrypted(ViewState["id"].ToString()) + " target=_blank > here </a> or by copy and pasting the following URL into your internet browser.<br/> <br/> www.ijobcenter.com/CompanySiteAboutUsViewforApproval.aspx?id1=" + ClsEncDesc.Encrypted(ViewState["id"].ToString()) + " <br/> </br> <br/> </br> ";


        string ext         = "ext " + ds.Rows[0]["Supportteamphonenoext"].ToString();
        string tollfreeext = "ext " + ds.Rows[0]["Tollfreeext"].ToString();
        string tollfree    = ds.Rows[0]["Tollfree"].ToString();
        string aa          = "" + ds.Rows[0]["Supportteammanagername"].ToString() + "- Support Manager";
        string bb          = "" + ds.Rows[0]["PortalName"].ToString() + " ";
        string cc          = "" + ds.Rows[0]["Supportteamphoneno"].ToString() + "  " + ext + " ";
        string dd          = "" + ds + " " + tollfreeext + " ";
        string ee          = "" + ds.Rows[0]["Portalmarketingwebsitename"].ToString() + "";

        string body = "<br>" + HeadingTable + " Dear <strong><span style=\"color: #996600\"> Admin </span></strong>,<br><br> " + Accountdetail12 + " <br> <span style=\"font-size: 10pt; color: #000000; font-family: Arial\"> " +
                      //   " <br>Thanking you,<br>Sincerely,</span><br><br>Admin Team<br><b>" + dtbus.Rows[0]["Name"].ToString() + "</b><br>" + dtbus.Rows[0]["Address1"].ToString() + "<br>" + dtbus.Rows[0]["Address2"].ToString() + "";
                      " <br>Thanking you, <br>" + aa + "<br>" + bb + "<br>" + cc + "<br>" + ee + "";

        if (ds.Rows[0]["UserIdtosendmail"].ToString() != "" && ds.Rows[0]["Password"].ToString() != "")
        {
            try
            {
                MailAddress to       = new MailAddress("" + ds.Rows[0]["Supportteamemailid"].ToString() + "");
                MailAddress from     = new MailAddress("" + ds.Rows[0]["UserIdtosendmail"] + "", "" + ds.Rows[0]["EmailDisplayname"] + "");
                MailMessage objEmail = new MailMessage(from, to);

                objEmail.Subject = "Company Site About Us Changes Requested";

                objEmail.Body       = body.ToString();
                objEmail.IsBodyHtml = true;
                objEmail.Priority   = MailPriority.Normal;
                SmtpClient client = new SmtpClient();
                client.Credentials = new NetworkCredential("" + ds.Rows[0]["UserIdtosendmail"] + "", "" + ds.Rows[0]["Password"] + "");
                client.Host        = ds.Rows[0]["Mailserverurl"].ToString();

                client.Send(objEmail);
            }
            catch { }
        }
        else
        {
        }
    }
Пример #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con  = pgcon.dynconn;
        con1 = PageConn.licenseconn();
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);

        double mul = 1073741824;

        //double plansize = Convert.ToDouble(Session["Size"].ToString());
        double plansize    = 1;
        double sizeinbytes = mul * plansize;

        //string eeed = " Select distinct EmployeeMaster.EmployeeMasterID from EmployeeMaster inner join Party_master on Party_master.PartyID=EmployeeMaster.PartyID inner join User_master on User_master.PartyID=Party_master.PartyID where User_master.UserID='" + Session["userid"] + "'";
        //SqlCommand cmdeeed = new SqlCommand(eeed, con);
        //SqlDataAdapter adpeeed = new SqlDataAdapter(cmdeeed);
        //DataTable dteeed = new DataTable();
        //adpeeed.Fill(dteeed);
        //if (dteeed.Rows.Count > 0)
        //{
        //    Session["EmployeeId"] = Convert.ToString(dteeed.Rows[0]["EmployeeMasterID"]);
        //}

        if (Session["CompanyName"] != null)
        {
            this.Title = Session["CompanyName"] + " IFileCabinet.com - Document Upload";
        }
        Session["PageName"] = "DocumentUpload.aspx";
        //  pnlmsg.Visible = false;
        lblmsg.Visible = false;
        if (!IsPostBack)
        {
            TxtDocDate.Text = System.DateTime.Now.ToShortDateString();
            //FillDocumentMainType();
            string str = "SELECT Distinct WareHouseId,Name  FROM WareHouseMaster inner join EmployeeWarehouseRights on EmployeeWarehouseRights.Whid=WareHouseMaster.WareHouseId where comid = '" + Session["comid"] + "'and WareHouseMaster.Status='" + 1 + "' and EmployeeWarehouseRights.AccessAllowed='True' order by name";

            SqlCommand cmd1 = new SqlCommand(str, con);
            cmd1.CommandType = CommandType.Text;
            SqlDataAdapter da = new SqlDataAdapter(cmd1);
            DataTable      dt = new DataTable();
            da.Fill(dt);

            ddlbusiness.DataSource     = dt;
            ddlbusiness.DataTextField  = "Name";
            ddlbusiness.DataValueField = "WareHouseId";
            ddlbusiness.DataBind();
            string         eeed    = " Select distinct EmployeeMaster.Whid from  EmployeeMaster where EmployeeMasterId='" + Session["EmployeeId"] + "'";
            SqlCommand     cmdeeed = new SqlCommand(eeed, con);
            SqlDataAdapter adpeeed = new SqlDataAdapter(cmdeeed);
            DataTable      dteeed  = new DataTable();
            adpeeed.Fill(dteeed);
            if (dteeed.Rows.Count > 0)
            {
                ddlbusiness.SelectedValue = Convert.ToString(dteeed.Rows[0]["Whid"]);
            }
            ddlbusiness_SelectedIndexChanged(sender, e);
            hdbDId.Value     = "0";
            hdbDMId.Value    = "0";
            hdbDSId.Value    = "0";
            hdbPartyId.Value = "0";
            //hdnSIZEofFOLDER.Value = "0";
            // imgbtnupload.Attributes.Add("OnClick", "Validate();");


            str = Server.MapPath("~\\Account\\" + Session["comid"] + "\\UploadedDocuments");
            GetFolderSize(str, false);


            //string[] ag = new string[0];
            //Main(ag);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        dt = new DataTable();
        if (Session["PageName"] != null)
        {
            try
            {
                string pagename = Session["PageName"].ToString();
                //dt = clsMaster.SelectPageMasterbyPageName(pagename);

                /*141  busclientlink 141 string strcd="SELECT PageMaster.PageId, PageMaster.PageTypeId, PageMaster.PageName, PageMaster.PageTitle, PageMaster.PageDescription "+
                 *                 " FROM  PageMaster  where PageMaster.PageName='" + ClsEncDesc.EncDyn(pagename) + "' and PageMaster.VersionInfoMasterId= '" + ClsEncDesc.EncDyn(HttpContext.Current.Session["verId"].ToString()) + "'";
                 * SqlCommand sqlco = new SqlCommand(strcd, PageConn.busclient());
                 */

                string strcd = "SELECT PageMaster.PageId, PageMaster.PageTypeId, PageMaster.PageName, PageMaster.PageTitle, PageMaster.PageDescription " +
                               " FROM  PageMaster  where PageMaster.PageName='" + pagename + "' and PageMaster.VersionInfoMasterId= '" + HttpContext.Current.Session["verId"].ToString() + "'";
                SqlCommand     sqlco = new SqlCommand(strcd, PageConn.licenseconn());
                SqlDataAdapter ads   = new SqlDataAdapter(sqlco);
                ads.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    lblDetail.Text   = dt.Rows[0]["PageDescription"].ToString();
                    lbltitle.Text    = dt.Rows[0]["PageTitle"].ToString();
                    pnlhelp.Visible  = true;
                    PNLTITLE.Visible = true;
                }
                else
                {
                    lbltitle.Text    = "";
                    lblDetail.Text   = "";
                    PNLTITLE.Visible = false;
                    pnlhelp.Visible  = false;
                }
            }
            catch (Exception ex)
            {
            }
        }
        else
        {
            lblDetail.Text  = "";
            pnlhelp.Visible = false;
        }

        PNLTITLE.Visible = true;
        pnlhelp.Visible  = true;

        int    flat    = 1;
        string urlname = Request.Url.Host.ToString();

        if (urlname == Session["comid"] + ".itimekeeper.us")
        {
            flat = 2;
        }
        else if (urlname == Session["comid"] + ".itimekeeper.com")
        {
            flat = 2;
        }
        else if (urlname == Session["comid"] + ".ipayrollmanager.com")
        {
            flat = 2;
        }
        else
        {
            flat = 1;
        }

        if (flat == 1)
        {
            if (!IsPostBack)
            {
                fillwarehouse();
                ddlbus_SelectedIndexChanged(sender, e);
                pnlshow.Visible = true;
            }
        }
        else
        {
            pnlshow.Visible = false;
        }

        if (!IsPostBack)
        {
            oafillpageaccesscheck();
            ifilefillpageaccesscheck();
            iofficefillpageaccesscheck();
            communicationfillpageaccesscheck();
            Timekeepingfillpageaccesscheck();
            fillcheck();
        }
    }
Пример #25
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        con = PageConn.licenseconn();
        string ipaddress = "";

        ipaddress = Request.ServerVariables["REMOTE_ADDR"].ToString();
        //  ipaddress = "192.168.6.41";
        //Request.ServerVariables["REMOTE_ADDR"].ToString();

        Session["userloginname"] = txtUser.Text;

        //try
        //{
        string str = "   select clientLoginMaster.clientId,clientLoginMaster.Password,clientLoginMaster.UserId,ClientMaster.CompanyName from clientLoginMaster inner join  ClientMaster on ClientMaster.LoginName=clientLoginMaster.UserId " +
                     " where  clientLoginMaster.UserId='" + txtUser.Text + "' and clientLoginMaster.clientId='" + txtClientId.Text + "' " +
                     " and clientLoginMaster.Password='******' ";//
        SqlCommand     cmd = new SqlCommand(str, con);
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        DataTable      dt  = new DataTable();

        adp.Fill(dt);
        if (dt.Rows.Count > 0)
        {
            Session["Login"]    = txtUser.Text; // "admin";
            Session["ClientId"] = dt.Rows[0]["clientId"].ToString();
            Session["UserId"]   = dt.Rows[0]["UserId"].ToString();
            string pass = PageMgmt.Encrypted(dt.Rows[0]["Password"].ToString());
            Session["ClientName"] = dt.Rows[0]["CompanyName"].ToString();
            Response.Redirect("Product_BatchMaster.aspx");
        }
        else
        {
            string str1 = "select distinct EmployeeMaster.Id as empid,clientLoginMaster.clientId,clientLoginMaster.Password,clientLoginMaster.UserId,ClientMaster.CompanyName from ClientMaster inner join clientLoginMaster on clientLoginMaster.ClientId=ClientMaster.ClientMasterId inner join EmployeeMaster on EmployeeMaster.UserId=clientLoginMaster.UserId " +
                          " where  clientLoginMaster.UserId='" + txtUser.Text + "' and clientLoginMaster.clientId='" + txtClientId.Text + "' " +
                          " and clientLoginMaster.Password='******' ";// and clientLoginMaster.Password='******'
            SqlCommand     cmd1 = new SqlCommand(str1, con);
            SqlDataAdapter adp1 = new SqlDataAdapter(cmd1);
            DataTable      dt1  = new DataTable();
            adp1.Fill(dt1);
            //  txtUser.Text = PageMgmt.Decrypted(dt1.Rows[0]["Password"].ToString());
            if (dt1.Rows.Count > 0)
            {
                Session["Clientname"] = dt1.Rows[0]["CompanyName"].ToString();
                string strIjob = " SELECT        dbo.EmployeeMaster.* FROM dbo.EmployeeMaster INNER JOIN dbo.Syncr_LicenseEmployee_With_JobcenterId ON dbo.EmployeeMaster.EmployeeMasterID = dbo.Syncr_LicenseEmployee_With_JobcenterId.Jobcenter_Emp_id  where dbo.Syncr_LicenseEmployee_With_JobcenterId.License_Emp_id='" + Convert.ToString(dt1.Rows[0]["empid"]) + "' ";
                strIjob = " SELECT        dbo.EmployeeMaster.EmployeeMasterID, dbo.EmployeeMaster.PartyID, dbo.EmployeeMaster.DeptID, dbo.EmployeeMaster.DesignationMasterId, dbo.EmployeeMaster.StatusMasterId, dbo.EmployeeMaster.EmployeeTypeId, dbo.EmployeeMaster.DateOfJoin, dbo.EmployeeMaster.Address, dbo.EmployeeMaster.CountryId, dbo.EmployeeMaster.StateId, dbo.EmployeeMaster.City, dbo.EmployeeMaster.ContactNo, dbo.EmployeeMaster.Email, dbo.EmployeeMaster.AccountId, dbo.EmployeeMaster.AccountNo, dbo.EmployeeMaster.EmployeeName, dbo.EmployeeMaster.Whid,  dbo.EmployeeMaster.Description, dbo.EmployeeMaster.SuprviserId, dbo.EmployeeMaster.Active, dbo.EmployeeMaster.WorkPhone, dbo.EmployeeMaster.WorkExt, dbo.EmployeeMaster.WorkEmail, dbo.EmployeeMaster.EducationqualificationID, dbo.EmployeeMaster.SpecialSubjectID, dbo.EmployeeMaster.yearofexperience,  dbo.EmployeeMaster.Jobpositionid, dbo.EmployeeMaster.Sex, dbo.EmployeeMaster.Amount, dbo.EmployeeMaster.Payper, dbo.User_master.UserID FROM            dbo.EmployeeMaster INNER JOIN dbo.Syncr_LicenseEmployee_With_JobcenterId ON dbo.EmployeeMaster.EmployeeMasterID = dbo.Syncr_LicenseEmployee_With_JobcenterId.Jobcenter_Emp_id INNER JOIN dbo.User_master ON dbo.EmployeeMaster.PartyID = dbo.User_master.PartyID    where dbo.Syncr_LicenseEmployee_With_JobcenterId.License_Emp_id='" + Convert.ToString(dt1.Rows[0]["empid"]) + "'  ";
                //and IpAddress ='" + ipaddress + "'
                SqlCommand     cmdIjob = new SqlCommand(strIjob, con_Lice_Job);
                SqlDataAdapter adpIjob = new SqlDataAdapter(cmdIjob);
                DataTable      dtIjob  = new DataTable();
                adpIjob.Fill(dtIjob);
                if (dtIjob.Rows.Count > 0)
                {
                    Session["EmployeeId"]    = Convert.ToString(dtIjob.Rows[0]["EmployeeMasterID"]);
                    Session["DesignationId"] = Convert.ToString(dtIjob.Rows[0]["DesignationMasterId"]);
                    Session["Cname"]         = txtClientId.Text;
                    Session["Comid"]         = txtClientId.Text;
                    Session["verId"]         = "2056";
                    Session["PriceId"]       = "10444";
                    Session["PartyId"]       = Convert.ToString(dtIjob.Rows[0]["PartyId"]);
                    Session["UserId"]        = dtIjob.Rows[0]["UserID"].ToString();
                    Session["whid"]          = dtIjob.Rows[0]["Whid"].ToString();
                }

                SqlDataAdapter da4  = new SqlDataAdapter("SELECT DesignationName from DesignationMaster where DesignationMasterId='" + Session["DesignationId"] + "' ", con_Lice_Job);
                DataTable      desi = new DataTable();
                da4.Fill(desi);

                string         str11  = "Select * from EmployeeMaster  where EmployeeMaster.ClientId='" + txtClientId.Text + "' and  EmployeeMaster.Id='" + Convert.ToString(dt1.Rows[0]["empid"]) + "'  ";
                SqlCommand     cmd111 = new SqlCommand(str11, con);
                SqlDataAdapter adp11  = new SqlDataAdapter(cmd111);
                DataTable      dt11   = new DataTable();
                adp11.Fill(dt11);
                if (dt11.Rows.Count > 0)
                {
                    string pass = PageMgmt.Decrypted(dt1.Rows[0]["Password"].ToString());
                    Session["EmpId"]    = Convert.ToString(dt1.Rows[0]["empid"]);
                    Session["Login"]    = txtUser.Text; // "admin";
                    Session["ClientId"] = dt1.Rows[0]["clientId"].ToString();
                    //   Session["UserId"] = dt1.Rows[0]["UserId"].ToString();
                    Session["ClientName"] = dt1.Rows[0]["CompanyName"].ToString();
                    //Response.Redirect("afterLoginforClient.aspx");
                    Session["id"] = dt11.Rows[0]["Id"].ToString();
                    //if (dtIjob.Rows.Count > 0)
                    //{
                    //    Response.Redirect("afterLoginforClient.aspx");
                    Session["Login"] = txtUser.Text;
                    //}
                    //else
                    //{
                    //    Response.Redirect("afterLoginforClient.aspx");
                    //}

                    string         strIjob1 = @"SELECT  dbo.TBLUserLoginIpRestrictionPreference.MakeIPRestriction
                                                      FROM   dbo.EmployeeMaster 
                                                     INNER JOIN   dbo.Syncr_LicenseEmployee_With_JobcenterId ON dbo.EmployeeMaster.EmployeeMasterID = dbo.Syncr_LicenseEmployee_With_JobcenterId.Jobcenter_Emp_id
                                                     INNER JOIN dbo.User_master  ON dbo.EmployeeMaster.PartyID = dbo.User_master.PartyID
                                                     INNER JOIN  dbo.TBLUserLoginIpRestrictionPreference ON dbo.TBLUserLoginIpRestrictionPreference.userid = dbo.User_master.UserID 
                                                     where dbo.Syncr_LicenseEmployee_With_JobcenterId.License_Emp_id='" + Convert.ToString(dt1.Rows[0]["empid"]) + "' ";
                    SqlCommand     cmdIjob1 = new SqlCommand(strIjob1, con_Lice_Job);
                    SqlDataAdapter adpIjob1 = new SqlDataAdapter(cmdIjob1);
                    DataTable      dtIjob1  = new DataTable();
                    adpIjob1.Fill(dtIjob1);
                    if (dtIjob1.Rows.Count > 0)
                    {
                        if (dtIjob1.Rows[0][0].ToString() == "False")
                        {
                            if (desi.Rows.Count > 0)
                            {
                                SqlDataAdapter databusc = new SqlDataAdapter("SELECT dbo.DefaultAfterloginForDefaultRolesTBL.id, dbo.DefaultAfterloginForDefaultRolesTBL.DefaultDesignationTbl, dbo.DefaultDesignationTbl.DesignationName, dbo.DefaultAfterloginForDefaultRolesTBL.PagemasterID, dbo.DefaultAfterloginForDefaultRolesTBL.pagename, dbo.DefaultAfterloginForDefaultRolesTBL.VersionId FROM  dbo.DefaultDesignationTbl INNER JOIN dbo.DefaultAfterloginForDefaultRolesTBL ON dbo.DefaultDesignationTbl.Id = dbo.DefaultAfterloginForDefaultRolesTBL.DefaultDesignationTbl Where dbo.DefaultDesignationTbl.DesignationName='" + desi.Rows[0][0].ToString() + "'", PageConn.licenseconn());
                                DataTable      Datac    = new DataTable();
                                databusc.Fill(Datac);

                                if (Datac.Rows.Count > 0)
                                {
                                    string pnameu = Convert.ToString(Datac.Rows[0]["pagename"]);
                                    string pp     = "http://license.busiwiz.com/IOffice/ShoppingCart/Admin/" + pnameu + "";
                                    //Response.Redirect(pp);
                                    Response.Redirect("~/Clientadmin/AdminProjectMasterLB.aspx");
                                }
                                else
                                {
                                    //lblError.Text = "AfterLogin Page Is Not Available For Your Designetion";
                                    Response.Redirect("~/Clientadmin/AdminProjectMasterLB.aspx");
                                }
                            }
                            else
                            {
                                Response.Redirect("~/Clientadmin/AdminProjectMasterLB.aspx");
                            }
                        }
                        else
                        {
                            string         dd       = "  select * from IpControldetailtbl inner join IpControlMastertbl on IpControlMastertbl.IpcontrolId=IpControldetailtbl.IpcontrolId where  IpControlMastertbl.CID='" + Session["comid"] + "' and IpControldetailtbl.UserId='" + Session["UserId"] + "'  ";//and IpControldetailtbl.Ipaddress='" + ipaddress + "'
                            SqlCommand     cmdIjob2 = new SqlCommand(dd, con_Lice_Job);
                            SqlDataAdapter adpIjob2 = new SqlDataAdapter(cmdIjob2);
                            DataTable      dtIjob2  = new DataTable();
                            adpIjob2.Fill(dtIjob2);
                            if (dtIjob2.Rows.Count > 0)
                            {
                                SqlDataAdapter databusc = new SqlDataAdapter("SELECT dbo.DefaultAfterloginForDefaultRolesTBL.id, dbo.DefaultAfterloginForDefaultRolesTBL.DefaultDesignationTbl, dbo.DefaultDesignationTbl.DesignationName, dbo.DefaultAfterloginForDefaultRolesTBL.PagemasterID, dbo.DefaultAfterloginForDefaultRolesTBL.pagename, dbo.DefaultAfterloginForDefaultRolesTBL.VersionId FROM  dbo.DefaultDesignationTbl INNER JOIN dbo.DefaultAfterloginForDefaultRolesTBL ON dbo.DefaultDesignationTbl.Id = dbo.DefaultAfterloginForDefaultRolesTBL.DefaultDesignationTbl Where dbo.DefaultDesignationTbl.DesignationName='" + desi.Rows[0][0].ToString() + "'", PageConn.licenseconn());
                                DataTable      Datac    = new DataTable();
                                databusc.Fill(Datac);

                                if (Datac.Rows.Count > 0)
                                {
                                    string pnameu = Convert.ToString(Datac.Rows[0]["pagename"]);
                                    string pp     = "http://license.busiwiz.com/IOffice/ShoppingCart/Admin/" + pnameu + "";
                                    Response.Redirect(pp);
                                }
                                else
                                {
                                    //lblError.Text = "AfterLogin Page Is Not Available For Your Designetion";

                                    Response.Redirect("~/Clientadmin/AdminProjectMasterLB.aspx");
                                }
                            }
                            else
                            {
                                lblmsg.Visible = true;
                                lblmsg.Text    = "Invalid IP :" + ipaddress.ToString();
                            }
                        }
                    }
                    else
                    {
                        Response.Redirect("~/Clientadmin/AdminProjectMasterLB.aspx");
                    }
                }
            }
        }

        //}
        //catch (Exception e1)
        //{



        //}
        //finally
        //{

        //}

        //   if (txtUser.Text == "admin" && txtPassword.Text == "admin")
        //  {
        //}
        //else
        // {
        // }
    }
Пример #26
0
    public void sendmail(string To)
    {
        string         str = " Select  Distinct CompanyMaster.Compid,CompanyWebsitMaster.logourl,CompanyAddressMaster.Website,WareHouseMaster.Name as Wname,CompanyWebsitMaster.MasterEmailId, CompanyWebsitMaster.OutGoingMailServer,CompanyWebsitMaster.WebMasterEmail,CompanyWebsitMaster.EmailMasterLoginPassword, User_master.EmailID,User_master.UserID,CompanyMaster.CompanyLogo,CompanyMaster.CompanyName,CompanyAddressMaster.Address1,CompanyAddressMaster.Address2,CompanyAddressMaster.Email,CompanyAddressMaster.Fax,CompanyAddressMaster.Phone from User_master inner join Party_master on  Party_master.PartyID=User_master.PartyID inner join WareHouseMaster on WareHouseMaster.WareHouseId=Party_master.Whid inner join CompanyMaster on CompanyMaster.Compid=WareHouseMaster.comid inner join CompanyAddressMaster on CompanyAddressMaster.CompanyMasterId=CompanyMaster.CompanyId inner join CompanyWebsitMaster on CompanyWebsitMaster.WHId=WareHouseMaster.WareHouseId where User_master.UserID='" + ViewState["Userid"].ToString() + "'";
        SqlCommand     cmd = new SqlCommand(str, connection);
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        DataTable      dt  = new DataTable();

        adp.Fill(dt);

        if (dt.Rows.Count > 0)
        {
            string companyid = dt.Rows[0]["Compid"].ToString();

            StringBuilder strhead = new StringBuilder();
            strhead.Append("<table style=\"font-size:14px; font-family:Calibri\" width=\"100%\"> ");
            strhead.Append("<tr><td align=\"left\"> <img src=\"http://" + Request.Url.Host.ToString() + "/Shoppingcart/images/" + Convert.ToString(dt.Rows[0]["logourl"]) + "\" \"border=\"0\" Width=\"176px\" Height=\"106px\" / > </td><td align=\"right\"><b><span style=\"color: #996600\">" + Convert.ToString(dt.Rows[0]["CompanyName"]) + "</span></b><BR>" + Convert.ToString(dt.Rows[0]["Address1"]) + "<BR>" + Convert.ToString(dt.Rows[0]["Address2"]) + "<BR><b>Phone:</b>" + Convert.ToString(dt.Rows[0]["Phone"]) + "<Br><b>Fax:</b>" + Convert.ToString(dt.Rows[0]["Fax"]) + "<Br><b>Email:</b>" + Convert.ToString(dt.Rows[0]["Email"]) + "<Br><b>Website:</b>" + Convert.ToString(dt.Rows[0]["Website"]) + "</td></tr>  ");
            strhead.Append("<br><br></table> ");

            SqlDataAdapter daas = new SqlDataAdapter("select * from Party_master inner join User_master on User_master.PartyID=Party_master.PartyID where User_master.UserID='" + ViewState["Userid"].ToString() + "'", connection);
            DataTable      dtss = new DataTable();
            daas.Fill(dtss);
            string employeenamee = "";
            if (dtss.Rows.Count > 0)
            {
                employeenamee = Convert.ToString(dtss.Rows[0]["Compname"]);
            }

            string body = " <br><br><span style=\"font-size:14px; font-family:Calibri; text-align:left\">Dear " + dt.Rows[0]["Wname"].ToString() + ", </span><br><br> ";
            body = body + "<br><span style=\"font-size:14px; font-family:Calibri; text-align:left\">You have changed your password in the following account:</span><br><br> ";
            body = body + "<table style=\"font-size:14px; font-family:Calibri\"><tr><td><left>Company ID </left></td><td><left>: " + companyid + "</left><br></td></tr>";
            body = body + "<tr><td><left>Username </left></td><td><left>: " + ViewState["username"] + "</left><br></td></tr>";
            body = body + "<tr><td><left>Email ID </left></td><td><left>: " + To + "</left><br></td></tr></table><br>";
            body = body + "<span style=\"font-size:14px; font-family:Calibri; text-align:left\">To Reset your Login information please click <a href=http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/Resetpassworduser.aspx?to=" + ClsEncDesc.Encrypted(ViewState["maxid"].ToString()) + " target=_blank> here</a>, or copy and paste the following link into your browser:</span><br><br>";
            body = body + "<a href=http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/ResetPasswordUser.aspx?to=" + ClsEncDesc.Encrypted(ViewState["maxid"].ToString()) + ">http://" + Request.Url.Host.ToString() + "/Shoppingcart/admin/ResetPasswordUser.aspx?to=" + ClsEncDesc.Encrypted(ViewState["maxid"].ToString()) + "</a><br><br>";
            body = body + "<span style=\"font-size:14px; font-family:Calibri; text-align:left\">If you do not want to Reset your Login information, please disregard this email.</span><br><br>";
            body = body + "<span style=\"font-size:14px; font-family:Calibri; text-align:left\">If you have any questions, please contact our technical support team at: [email protected]</span><br>";


            string bodytext = "<br><span style=\"font-size:14px; font-family:Calibri; text-align:left\">Thank you</span><br>";

            StringBuilder support = new StringBuilder();
            support.Append("<table style=\"font-size:14px; font-family:Calibri; text-align:left\" width=\"100%\"> ");
            support.Append("<tr><td align=\"left\"><b><span style=\"color: #996600\">Technical Support Team</span></b><br>" + Convert.ToString(dt.Rows[0]["CompanyName"]) + "<br>" + Convert.ToString(dt.Rows[0]["Address1"]) + "<BR>" + Convert.ToString(dt.Rows[0]["Address2"]) + "<BR><b>Phone:</b>" + Convert.ToString(dt.Rows[0]["Phone"]) + "<Br><b>Fax:</b>" + Convert.ToString(dt.Rows[0]["Fax"]) + "<Br><b>Email:</b>" + Convert.ToString(dt.Rows[0]["Email"]) + "<Br><b>Website:</b>" + Convert.ToString(dt.Rows[0]["Website"]) + "");
            support.Append("<br></table> ");
            string bodyformate = "" + strhead + "<br>" + body + "<br>" + bodytext + "<br>" + support + "";
            try
            {
                string         strdy = " SELECT ClientMaster.OutgoingServerUserID,ClientMaster.OurgoingServerSMTP,ClientMaster.OutgoingServerPassword,ProductMaster.ProductName from CompanyMaster inner join ProductMaster on ProductMaster.ProductId=CompanyMaster.ProductId inner join ClientMaster on ClientMaster.ClientMasterId=ProductMaster.ClientMasterId where CompanyMaster.CompanyLoginId='" + Convert.ToString(dt.Rows[0]["Compid"]) + "'";
                SqlCommand     cmddy = new SqlCommand(strdy, PageConn.licenseconn());
                SqlDataAdapter adpdy = new SqlDataAdapter(cmddy);
                DataTable      dtdy  = new DataTable();
                adpdy.Fill(dtdy);

                if (dtdy.Rows.Count > 0)
                {
                    MailAddress to       = new MailAddress(To);
                    MailAddress from     = new MailAddress(dtdy.Rows[0]["OutgoingServerUserID"].ToString());
                    MailMessage objEmail = new MailMessage(from, to);
                    objEmail.Subject = "Request For Password Reset - " + dt.Rows[0]["Wname"].ToString();

                    objEmail.Body       = bodyformate.ToString();
                    objEmail.IsBodyHtml = true;
                    objEmail.Priority   = MailPriority.High;

                    SmtpClient client = new SmtpClient();
                    client.Credentials = new NetworkCredential(dtdy.Rows[0]["OutgoingServerUserID"].ToString(), dtdy.Rows[0]["OutgoingServerPassword"].ToString());
                    client.Host        = dtdy.Rows[0]["OurgoingServerSMTP"].ToString();
                    client.Send(objEmail);
                    lblmsg.Visible = true;

                    lblmsg.Text = ViewState["Confirmationby"].ToString() + " accepted. A confirmation email has been sent to your email address.";

                    txtuname.Text        = "";
                    ImageButton6.Visible = false;
                }
            }
            catch (Exception e)
            {
                lblmsg.Visible = true;
                lblmsg.Text    = "Error: Failure sending mail.";
                // + e.ToString()
            }
        }
    }
Пример #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        connection = pgcon.dynconn;

        if (!IsPostBack)
        {
            if (Request.QueryString["to"] != null)
            {
                string str = "SELECT CompanyLoginId from CompanyMaster where Websiteurl='" + Request.Url.Host.ToString() + "' and active='1'";

                SqlCommand     cmd = new SqlCommand(str, PageConn.licenseconn());
                SqlDataAdapter adp = new SqlDataAdapter(cmd);
                DataTable      dt  = new DataTable();
                adp.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    Session["Comid"] = Convert.ToString(dt.Rows[0]["CompanyLoginId"]);
                }

                string         strmaxid = "Select UserId from PasswordResetRequestTbl where ID='" + ClsEncDesc.Decrypted(Request.QueryString["to"]) + "'";
                SqlCommand     cmdmax   = new SqlCommand(strmaxid, connection);
                SqlDataAdapter adptmax  = new SqlDataAdapter(cmdmax);
                DataSet        dsmax    = new DataSet();
                adptmax.Fill(dsmax);

                if (dsmax.Tables[0].Rows.Count > 0)
                {
                    ViewState["maxuserid"] = Convert.ToInt32(dsmax.Tables[0].Rows[0]["UserId"]);
                }
                string         str1 = " Select  Distinct CompanyMaster.Compid,CompanyWebsitMaster.MasterEmailId, CompanyWebsitMaster.OutGoingMailServer,CompanyWebsitMaster.WebMasterEmail,CompanyWebsitMaster.EmailMasterLoginPassword, User_master.EmailID,User_master.UserID,CompanyMaster.CompanyLogo,CompanyMaster.CompanyName,CompanyAddressMaster.Email,CompanyAddressMaster.Fax,CompanyAddressMaster.Phone from User_master inner join Party_master on  Party_master.PartyID=User_master.PartyID inner join WareHouseMaster on WareHouseMaster.WareHouseId=Party_master.Whid inner join CompanyMaster on CompanyMaster.Compid=WareHouseMaster.comid inner join CompanyAddressMaster on CompanyAddressMaster.CompanyMasterId=CompanyMaster.CompanyId inner join CompanyWebsitMaster on CompanyWebsitMaster.WHId=WareHouseMaster.WareHouseId where User_master.UserID='" + ViewState["maxuserid"] + "'";
                SqlCommand     cmd1 = new SqlCommand(str1, connection);
                SqlDataAdapter adp1 = new SqlDataAdapter(cmd1);
                DataTable      dt1  = new DataTable();
                adp1.Fill(dt1);
                if (dt1.Rows.Count > 0)
                {
                    ViewState["UserID"] = Convert.ToString(dt1.Rows[0]["UserID"]);
                    Session["Comid"]    = Convert.ToString(dt1.Rows[0]["Compid"]);
                    if (Convert.ToString(dt1.Rows[0]["CompanyLogo"]) != "")
                    {
                        img1.ImageUrl = "ShoppingCart/images/" + Convert.ToString(dt1.Rows[0]["CompanyLogo"]);
                    }
                }

                pnlsecurityquestion.Visible = true;
                Panel2.Visible = false;

                fillquestion1();
                string  strquestion = "Select SecurityQuestionMaster.*,SecurityQuestion.Id as ansid,SecurityQuestion.SequrityQueId,SecurityQuestion.UserId,SecurityQuestion.Answer from SecurityQuestionMaster inner join SecurityQuestion on SecurityQuestionMaster.id = SecurityQuestion.SequrityQueId where SecurityQuestion.UserId = '" + Session["userid"] + "' and SecurityQuestion.QuestionNo='1'";
                DataSet dsquestion  = (DataSet)fillddl(strquestion);
                if (dsquestion.Tables[0].Rows.Count > 0)
                {
                    ddlquestion1.SelectedIndex = ddlquestion1.Items.IndexOf(ddlquestion1.Items.FindByValue(dsquestion.Tables[0].Rows[0]["SequrityQueId"].ToString()));
                }

                fillquestion2();

                string  strquestion2 = "Select SecurityQuestionMaster.*,SecurityQuestion.Id as ansid,SecurityQuestion.SequrityQueId,SecurityQuestion.UserId,SecurityQuestion.Answer from SecurityQuestionMaster inner join SecurityQuestion on SecurityQuestionMaster.id = SecurityQuestion.SequrityQueId where SecurityQuestion.UserId = '" + Session["userid"] + "' and SecurityQuestion.QuestionNo='2'";
                DataSet dsquestion2  = (DataSet)fillddl(strquestion2);

                if (dsquestion2.Tables[0].Rows.Count > 0)
                {
                    ddlquestion2.SelectedIndex = ddlquestion2.Items.IndexOf(ddlquestion2.Items.FindByValue(dsquestion2.Tables[0].Rows[0]["SequrityQueId"].ToString()));
                }

                fillquestion3();
                string  strquestion3 = "Select SecurityQuestionMaster.*,SecurityQuestion.Id as ansid,SecurityQuestion.SequrityQueId,SecurityQuestion.UserId,SecurityQuestion.Answer from SecurityQuestionMaster inner join SecurityQuestion on SecurityQuestionMaster.id = SecurityQuestion.SequrityQueId where SecurityQuestion.UserId = '" + Session["userid"] + "' and SecurityQuestion.QuestionNo='3'";
                DataSet dsquestion3  = (DataSet)fillddl(strquestion3);


                if (dsquestion3.Tables[0].Rows.Count > 0)
                {
                    ddlquestion3.SelectedIndex = ddlquestion3.Items.IndexOf(ddlquestion3.Items.FindByValue(dsquestion3.Tables[0].Rows[0]["SequrityQueId"].ToString()));
                }
            }
            else if (Request.QueryString["cid"] != null && Request.QueryString["uid"] != null && Request.QueryString["pwd"] != null)
            {
                string cid = Convert.ToString(Request.QueryString["cid"]);
                string uid = Convert.ToString(Request.QueryString["uid"]);
                string pwd = Convert.ToString(Request.QueryString["pwd"]);

                Session["Comid"] = cid;

                PageConn pgcon1 = new PageConn();
                connection1 = pgcon1.dynconn;

                pwd = ClsEncDesc.Decrypted(pwd);

                SqlCommand cmdlogin = new SqlCommand("SelectUserLogin", connection1);
                cmdlogin.CommandType = CommandType.StoredProcedure;
                cmdlogin.Parameters.Add(new SqlParameter("@UID", SqlDbType.NVarChar));
                cmdlogin.Parameters["@UID"].Value = uid;
                cmdlogin.Parameters.Add(new SqlParameter("@CD", SqlDbType.NVarChar));
                cmdlogin.Parameters["@CD"].Value = cid;
                cmdlogin.Parameters.Add(new SqlParameter("@Pas", SqlDbType.NVarChar));
                cmdlogin.Parameters["@Pas"].Value = ClsEncDesc.Encrypted(pwd);

                SqlDataAdapter adplogin    = new SqlDataAdapter(cmdlogin);
                DataTable      dtloginuser = new DataTable();
                adplogin.Fill(dtloginuser);

                if (dtloginuser.Rows.Count > 0)
                {
                    panelforcandidate.Visible   = false;
                    pnlsecurityquestion.Visible = true;
                    Panel2.Visible    = false;
                    Session["userid"] = dtloginuser.Rows[0]["UserID"].ToString();
                    lblmsg.Text       = "";

                    fillquestion111();

                    string  strquestion = "Select SecurityQuestionMaster.*,SecurityQuestion.Id as ansid,SecurityQuestion.SequrityQueId,SecurityQuestion.UserId,SecurityQuestion.Answer from SecurityQuestionMaster inner join SecurityQuestion on SecurityQuestionMaster.id = SecurityQuestion.SequrityQueId where SecurityQuestion.UserId = '" + Session["userid"] + "' and SecurityQuestion.QuestionNo='1'";
                    DataSet dsquestion  = (DataSet)fillddl123(strquestion);
                    if (dsquestion.Tables[0].Rows.Count > 0)
                    {
                        ddlquestion1.SelectedIndex = ddlquestion1.Items.IndexOf(ddlquestion1.Items.FindByValue(dsquestion.Tables[0].Rows[0]["SequrityQueId"].ToString()));
                    }

                    fillquestion222();

                    string  strquestion2 = "Select SecurityQuestionMaster.*,SecurityQuestion.Id as ansid,SecurityQuestion.SequrityQueId,SecurityQuestion.UserId,SecurityQuestion.Answer from SecurityQuestionMaster inner join SecurityQuestion on SecurityQuestionMaster.id = SecurityQuestion.SequrityQueId where SecurityQuestion.UserId = '" + Session["userid"] + "' and SecurityQuestion.QuestionNo='2'";
                    DataSet dsquestion2  = (DataSet)fillddl123(strquestion2);

                    if (dsquestion2.Tables[0].Rows.Count > 0)
                    {
                        ddlquestion2.SelectedIndex = ddlquestion2.Items.IndexOf(ddlquestion2.Items.FindByValue(dsquestion2.Tables[0].Rows[0]["SequrityQueId"].ToString()));
                    }

                    fillquestion333();

                    string  strquestion3 = "Select SecurityQuestionMaster.*,SecurityQuestion.Id as ansid,SecurityQuestion.SequrityQueId,SecurityQuestion.UserId,SecurityQuestion.Answer from SecurityQuestionMaster inner join SecurityQuestion on SecurityQuestionMaster.id = SecurityQuestion.SequrityQueId where SecurityQuestion.UserId = '" + Session["userid"] + "' and SecurityQuestion.QuestionNo='3'";
                    DataSet dsquestion3  = (DataSet)fillddl123(strquestion3);

                    if (dsquestion3.Tables[0].Rows.Count > 0)
                    {
                        ddlquestion3.SelectedIndex = ddlquestion3.Items.IndexOf(ddlquestion3.Items.FindByValue(dsquestion3.Tables[0].Rows[0]["SequrityQueId"].ToString()));
                    }
                }
                else
                {
                    pnlsecurityquestion.Visible = false;
                    lblmsg.Text = "Incorrect username or password. Please try again.";
                }
            }
            else
            {
                pnlsecurityquestion.Visible = false;
                Panel2.Visible = true;
            }
        }
    }
Пример #28
0
    public void sendmailtoadmin()
    {
        string         str2 = "Select * from  CompanyProductsAndServicesInputTBL where CompanyID='" + Session["Comid"] + "'  and Active='Unapproved'";
        SqlCommand     cmd2 = new SqlCommand(str2, con);
        SqlDataAdapter adp2 = new SqlDataAdapter(cmd2);
        DataTable      ds2  = new DataTable();

        adp2.Fill(ds2);
        string         str3 = "Select * from  CompanyMaster where Compid='" + Session["Comid"] + "' ";
        SqlCommand     cmd3 = new SqlCommand(str3, con);
        SqlDataAdapter adp3 = new SqlDataAdapter(cmd3);
        DataTable      ds3  = new DataTable();

        adp3.Fill(ds3);
        string         str21 = "  select distinct  PortalMasterTbl.* from  CompanyMaster inner join PricePlanMaster  on CompanyMaster.PricePlanId=PricePlanMaster.PricePlanId inner join VersionInfoMaster on VersionInfoMaster.VersionInfoId=PricePlanMaster.VersionInfoMasterId inner join ProductMaster on VersionInfoMaster.ProductId=ProductMaster.ProductId inner join ClientMaster on ProductMaster.ClientMasterId=ClientMaster.ClientMasterId inner join Priceplancategory on Priceplancategory.ID=PricePlanMaster.PriceplancatId inner join PortalMasterTbl on PortalMasterTbl.Id=Priceplancategory.PortalId   inner join OrderMaster on CompanyMaster.CompanyLoginId=OrderMaster.CompanyLoginId inner join  OrderPaymentSatus on OrderMaster.OrderId=OrderPaymentSatus.OrderId inner join StateMasterTbl on StateMasterTbl.StateId=PortalMasterTbl.StateId inner join CountryMaster on StateMasterTbl.CountryId=CountryMaster.CountryId  WHERE(PortalMasterTbl.Id=7)  ";
        SqlCommand     cmd45 = new SqlCommand(str21, PageConn.licenseconn());
        SqlDataAdapter adp45 = new SqlDataAdapter(cmd45);
        DataTable      dt21  = new DataTable();

        adp45.Fill(dt21);

        string aa          = "";
        string bb          = "";
        string cc          = "";
        string ff          = "";
        string ee          = "";
        string dd          = "";
        string ext         = "";
        string tollfree    = "";
        string tollfreeext = "";

        if (dt21.Rows.Count > 0)
        {
            if (Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Supportteamphonenoext"].ToString()) != null)
            {
                ext = "ext " + dt21.Rows[0]["Supportteamphonenoext"].ToString();
            }

            if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
            {
                tollfree = dt21.Rows[0]["Tollfree"].ToString();
            }

            if (Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != "" && Convert.ToString(dt21.Rows[0]["Tollfree"].ToString()) != null)
            {
                tollfreeext = "ext " + dt21.Rows[0]["Tollfreeext"].ToString();
            }


            aa = "" + dt21.Rows[0]["Supportteammanagername"].ToString() + "- Support Manager";
            bb = "" + dt21.Rows[0]["PortalName"].ToString() + " ";
            cc = "" + dt21.Rows[0]["Supportteamphoneno"].ToString() + "  " + ext + " ";
            dd = "" + tollfree + " " + tollfreeext + " ";
            ee = "" + dt21.Rows[0]["Portalmarketingwebsitename"].ToString() + "";
            // ff = "" + dt21.Rows[0]["City"].ToString() + " " + dt21.Rows[0]["StateName"].ToString() + " " + dt21.Rows[0]["CountryName"].ToString() + " " + dt21.Rows[0]["Zip"].ToString() + " ";
        }
        // string tomail = //txtConfirmEmail.Text;
        if (dt21.Rows.Count > 0)
        {
            string file = "job-center-logo.jpg";
            // string body1 = "<br>Dear " + dt1.Rows[0][0].ToString() + " <br><br> " + txtmsg.Text + "<br><br> Your security code is: <br> Candidate Secuirity code :" + dt1.Rows[0][2].ToString() + " <br> Test Center Code: " + dt1.Rows[0][3].ToString() + " <br><br> With Regards,<br> IJobcenter ";
            string body1 = "<br>  <img src=\"http://members.ijobcenter.com/images/" + file + "\" \"border=\"0\" Width=\"90\" Height=\"80\" / > <br>Dear Admin, <br><br>" + ViewState["COMPANY"] + " is requesting that changes be made to their Products and Services Input page. You can review the changes and decide whether to approve or reject the requested changes by clicking <a href=http://www.ijobcenter.com/CompanySiteProductandServicesApproval.aspx?comid=" + ClsEncDesc.Encrypted(Session["Comid"].ToString()) + "&id=" + ClsEncDesc.Encrypted(ViewState["productid"].ToString()) + " target=_blank >here </a> or by copy and pasting the following URL into your internet browser.<br><br>http://www.ijobcenter.com/CompanySiteProductandServicesApproval.aspx?comid=" + ClsEncDesc.Encrypted(Session["Comid"].ToString()) + "&id=" + ClsEncDesc.Encrypted(ViewState["productid"].ToString()) + " <br><br><br><br>Thank you,<br>" + aa + "<br>" + bb + "<br>" + cc + "<br>" + ee + "<br>";

            string email       = Convert.ToString(dt21.Rows[0]["UserIdtosendmail"]);
            string displayname = Convert.ToString("IJobCenter");
            string password    = Convert.ToString(dt21.Rows[0]["Password"]);
            string outgo       = Convert.ToString(dt21.Rows[0]["Mailserverurl"]);
            string body        = body1;
            string Subject     = "Approval for new Products and Services details ";


            MailAddress to       = new MailAddress("*****@*****.**");//[email protected]("*****@*****.**");//
            MailAddress from     = new MailAddress(email, displayname);
            MailMessage objEmail = new MailMessage(from, to);
            objEmail.Subject = Subject.ToString();
            objEmail.Body    = body.ToString();


            //string path = "http://members.ijobcenter.com/Account/jobcenter/UploadedDocuments/"+dt15.Rows[0][0].ToString()+"";
            //System.Net.Mail.Attachment attachment;
            //attachment = new System.Net.Mail.Attachment(path);
            //objEmail.Attachments.Add(attachment);

            objEmail.IsBodyHtml = true;
            objEmail.Priority   = MailPriority.High;
            SmtpClient client = new SmtpClient();
            client.Credentials = new NetworkCredential(email, password);
            client.Host        = outgo;
            client.Send(objEmail);
        }
    }
    protected void Button1_ClickSyncronice(object sender, EventArgs e)
    {
        ViewState["whid"]  = "1";
        Session["comid"]   = "jobcenter";
        ViewState["comid"] = "jobcenter";
        string         str12 = "select * from Syncr_LicenseEmployee_With_JobcenterId where Jobcenter_Emp_id='" + ViewState["Id"] + "'";
        SqlCommand     cmd1  = new SqlCommand(str12, con_Lice_Job);
        SqlDataAdapter adp1  = new SqlDataAdapter(cmd1);
        DataTable      ds1   = new DataTable();

        adp1.Fill(ds1);
        if (ds1.Rows.Count > 0)
        {
        }
        else
        {
            string         strgetusername = "******";
            SqlCommand     cmdusername    = new SqlCommand(strgetusername, con_Lice_Job);
            SqlDataAdapter adpusername    = new SqlDataAdapter(cmdusername);
            DataTable      dsusername     = new DataTable();
            adpusername.Fill(dsusername);

            if (dsusername.Rows.Count > 0)
            {
                string username;
                string Password;
                int    i = 0;
                int    c = dsusername.Rows.Count + 1;
                username = "******" + c;;
                Password = "******" + dsusername.Rows[0]["PartyID"].ToString() + "++" + c;


                tbUserName.Text = username;
                tbPassword.Text = Password;
            }
            int            flag           = 0;
            string         strusernaemchk = " select * from User_master where Username='******'";
            SqlCommand     cmdusernaemchk = new SqlCommand(strusernaemchk, con_Lice_Job);
            SqlDataAdapter adpusernaemchk = new SqlDataAdapter(cmdusernaemchk);
            DataTable      dsusernaemchk  = new DataTable();
            adpusernaemchk.Fill(dsusernaemchk);

            Session["maxaid"] = "";

            string st153 = "";

            string st1531 = "";
            Session["reportid"]  = "";
            Session["reportid1"] = "";
            ViewState["balid"]   = "";

            string    ins1      = "";
            DataTable datparcat = select("select PartyMasterCategoryNo from PartyMasterCategory where Name='Candidate'");

            if (datparcat.Rows.Count > 0)
            {
                DataTable dtpartytype = select("select PartyTypeId from PartytTypeMaster where compid='" + ViewState["comid"] + "' and PartyCategoryId='" + datparcat.Rows[0]["PartyMasterCategoryNo"].ToString() + "'");
                ViewState["partytypeid"] = dtpartytype.Rows[0]["PartyTypeId"].ToString();
            }


            ins1 = "insert into Party_master(Account,Compname,Contactperson,Address,City,State,Country,Website,GSTno,Incometaxno,Email,Phoneno,DataopID, " +
                   " PartyTypeId,AssignedAccountManagerId,AssignedRecevingDepartmentInchargeId,AssignedPurchaseDepartmentInchargeId,AssignedShippingDepartmentInchargeId,  AssignedSalesDepartmentIncharge,StatusMasterId,Fax,AccountnameID," +
                   " AccountBalanceLimitId,id,Whid,PartyTypeCategoryNo,Zipcode) " +
                   " values ( '" + accid + "','" + txtempname.Text + "','', '','26551','220','222','',  ''  ,'', " +
                   " '" + txtemail.Text + "','" + txtmobileno.Text + "','1', " +
                   " '" + ViewState["partytypeid"] + "' ,'" + 0 + "' ,'" + 0 + "',  '" + 0 + "' , '" + 0 + "' , '" + 0 + "' ,'1' , '' ,'1', " +
                   "'" + ViewState["balid"] + "','" + ViewState["comid"] + "','" + ViewState["whid"] + "','" + datparcat.Rows[0]["PartyMasterCategoryNo"].ToString() + "','" + txtzipcode.Text + "')";


            SqlCommand cmd3 = new SqlCommand(ins1, con_Lice_Job);

            con_Lice_Job.Open();
            cmd3.ExecuteNonQuery();
            con_Lice_Job.Close();

            string sel = "";

            sel = "select max(PartyID) as PartyID from Party_master where Id='" + ViewState["comid"].ToString() + "' and Whid='" + ViewState["whid"] + "'";


            SqlCommand     cmd5 = new SqlCommand(sel, con_Lice_Job);
            SqlDataAdapter da5  = new SqlDataAdapter(cmd5);
            DataSet        ds5  = new DataSet();
            da5.Fill(ds5);

            string phofile = "";

            ViewState["partyidforemail"] = Convert.ToInt32(ds5.Tables[0].Rows[0]["PartyId"].ToString());


            string insdept = "";


            insdept = "Select id from DepartmentmasterMNC where Departmentname='Other' and Whid='" + ViewState["whid"] + "'";


            SqlDataAdapter dadept = new SqlDataAdapter(insdept, con_Lice_Job);
            DataTable      dtdept = new DataTable();
            dadept.Fill(dtdept);

            object dept = "";

            if (dtdept.Rows.Count > 0)
            {
                ViewState["deptid"] = Convert.ToString(dtdept.Rows[0]["id"]);
            }

            else
            {
                SqlCommand cmddept = new SqlCommand("DeptRetIdentity", con_Lice_Job);
                cmddept.CommandType = CommandType.StoredProcedure;
                cmddept.Parameters.AddWithValue("@Departmentname", "Other");
                cmddept.Parameters.AddWithValue("@Companyid", ViewState["comid"].ToString());

                if (Request.QueryString["Id"] != null)
                {
                    cmddept.Parameters.AddWithValue("@Whid", ViewState["whid"]);
                }
                else
                {
                    cmddept.Parameters.AddWithValue("@Whid", ViewState["whid"]);
                }


                cmddept.Parameters.Add(new SqlParameter("@Id", SqlDbType.Int));
                cmddept.Parameters["@Id"].Direction = ParameterDirection.Output;
                cmddept.Parameters.Add(new SqlParameter("@ReturnValue", SqlDbType.Int));
                cmddept.Parameters["@ReturnValue"].Direction = ParameterDirection.ReturnValue;

                if (con_Lice_Job.State.ToString() != "Open")
                {
                    con_Lice_Job.Open();
                }
                dept = (object)cmddept.ExecuteNonQuery();
                dept = cmddept.Parameters["@Id"].Value;
                ViewState["deptid"] = dept;
                con_Lice_Job.Close();
            }


            SqlDataAdapter darole = new SqlDataAdapter("Select Role_id from RoleMaster where Role_name='Candidate' and compid='" + ViewState["comid"].ToString() + "'", con_Lice_Job);
            DataTable      dtrole = new DataTable();
            darole.Fill(dtrole);

            if (dtrole.Rows.Count > 0)
            {
                ViewState["roleid"] = Convert.ToString(dtrole.Rows[0]["Role_id"]);
            }
            else
            {
                SqlCommand cmd3r = new SqlCommand("Insert into RoleMaster (Role_name,ActiveDeactive,compid) values ('Candidate','True','" + ViewState["comid"].ToString() + "')", con_Lice_Job);
                if (con_Lice_Job.State.ToString() != "Open")
                {
                    con_Lice_Job.Open();
                }
                cmd3r.ExecuteNonQuery();
                con_Lice_Job.Close();

                string         strd  = "SELECT  Role_id from RoleMaster WHERE Role_name = 'Candidate' and compid='" + ViewState["comid"].ToString() + "'";
                SqlDataAdapter adrol = new SqlDataAdapter(strd, con_Lice_Job);
                DataTable      dtrol = new DataTable();
                adrol.Fill(dtrol);

                ViewState["roleid"] = Convert.ToString(dtrol.Rows[0]["Role_id"]);
            }

            string         strdesg = "SELECT  DesignationMasterId from DesignationMaster WHERE DesignationName = 'Candidate' and DeptID='" + ViewState["deptid"] + "'";
            SqlDataAdapter dadesg  = new SqlDataAdapter(strdesg, con_Lice_Job);
            DataTable      dtdesg  = new DataTable();
            dadesg.Fill(dtdesg);

            if (dtdesg.Rows.Count > 0)
            {
                ViewState["desgid"] = Convert.ToString(dtdesg.Rows[0]["DesignationMasterId"]);
            }

            else
            {
                SqlCommand cmddegdes = new SqlCommand("Insert into DesignationMaster(DesignationName,DeptID,RoleId) values ('Candidate','" + ViewState["deptid"] + "','" + ViewState["roleid"] + "')", con_Lice_Job);
                if (con_Lice_Job.State.ToString() != "Open")
                {
                    con_Lice_Job.Open();
                }
                cmddegdes.ExecuteNonQuery();
                con_Lice_Job.Close();

                string         strdesg1 = "SELECT  DesignationMasterId from DesignationMaster WHERE DesignationName = 'Candidate' and DeptID='" + ViewState["deptid"] + "'";
                SqlDataAdapter dadesg1  = new SqlDataAdapter(strdesg1, con_Lice_Job);
                DataTable      dtdesg1  = new DataTable();
                dadesg1.Fill(dtdesg1);

                ViewState["desgid"] = Convert.ToString(dtdesg1.Rows[0]["DesignationMasterId"]);
            }

            string strrights = "";



            strrights = "insert into MessageCenterRightsTbl([CompanyID],[BusinessID],[DesignationID],[Business],[AdminRights],[Candidate],[Employee],[Customer],[Vendor],[Others],[Visitor]) values('" + ViewState["comid"].ToString() + "','" + ViewState["whid"] + "','" + ViewState["desgid"].ToString() + "','0','1','0','0','0','0','0','0')";


            SqlCommand cmdrigh = new SqlCommand(strrights, con_Lice_Job);
            if (con_Lice_Job.State.ToString() != "Open")
            {
                con_Lice_Job.Open();
            }
            cmdrigh.ExecuteNonQuery();
            con_Lice_Job.Close();


            SqlDataAdapter daprice = new SqlDataAdapter("select PricePlanId from CompanyMaster where CompanyLoginId='" + ViewState["comid"].ToString() + "'", PageConn.licenseconn());
            DataTable      dtprice = new DataTable();
            daprice.Fill(dtprice);

            if (dtprice.Rows.Count > 0)
            {
                ViewState["priceid"] = Convert.ToString(dtprice.Rows[0]["PricePlanId"]);
            }



            string ins6 = "insert into User_master(Name,Address ,City,State,Country,Phoneno,EmailID ,Username,Department,Accesslevel,PartyID,DesigantionMasterId,Photo,Active,Extention,zipcode)" +
                          " values ('" + txtempname.Text + "','','','','','" + txtphoneno.Text + "','" + txtemail.Text + "','" + tbUserName.Text + "','" + ViewState["deptid"] + "','1','" + Convert.ToInt32(ds5.Tables[0].Rows[0]["PartyId"].ToString()) + "','" + ViewState["desgid"] + "','" + phofile + "' ,'1','','" + txtzipcode.Text + "')";
            SqlCommand cmd6 = new SqlCommand(ins6, con_Lice_Job);

            con_Lice_Job.Open();
            cmd6.ExecuteNonQuery();
            con_Lice_Job.Close();


            string     sel11 = "select max(UserID) as UserID from User_master";
            SqlCommand cmd10 = new SqlCommand(sel11, con_Lice_Job);

            SqlDataAdapter da10 = new SqlDataAdapter(cmd10);

            DataSet ds10 = new DataSet();
            da10.Fill(ds10);


            string     ins7 = "insert into Login_master(UserID,username,password,department,accesslevel,deptid,accessid) values ('" + Convert.ToInt32(ds10.Tables[0].Rows[0]["UserID"]) + "','" + tbUserName.Text + "','" + ClsEncDesc.Encrypted(tbPassword.Text) + "','" + ViewState["deptid"] + "','1','" + ViewState["desgid"] + "','1')";
            SqlCommand cmd9 = new SqlCommand(ins7, con_Lice_Job);
            cmd9.Connection = con_Lice_Job;
            con_Lice_Job.Open();
            cmd9.ExecuteNonQuery();
            con_Lice_Job.Close();

            ViewState["username"] = tbUserName.Text;
            ViewState["password"] = tbPassword.Text;


            string     instrole = "insert into User_Role(User_id,Role_id,ActiveDeactive) values ('" + Convert.ToInt32(ds10.Tables[0].Rows[0]["UserID"]) + "','" + ViewState["roleid"] + "','1')";
            SqlCommand cmdid    = new SqlCommand(instrole, con_Lice_Job);
            cmdid.Connection = con_Lice_Job;
            con_Lice_Job.Open();
            cmdid.ExecuteNonQuery();
            con_Lice_Job.Close();

            string     str112 = "select max(UserID) as userid from Login_master";
            SqlCommand cmd11  = new SqlCommand(str112, con_Lice_Job);

            SqlDataAdapter adp11 = new SqlDataAdapter(cmd11);
            DataTable      ds11  = new DataTable();
            adp11.Fill(ds11);

            int       id   = 0;
            DataTable dtid = new DataTable();

            string iopp = "";
            id = 1;
            string empins = "";


            empins = "Insert into EmployeeMaster(PartyID,DeptID,DesignationMasterId,StatusMasterId,EmployeeTypeId, " +
                     " DateOfJoin,Address,CountryId,StateId,City,ContactNo,Email,AccountId,AccountNo,EmployeeName,Whid,Active,WorkPhone,EducationqualificationID,SpecialSubjectID,yearofexperience,Jobpositionid,sex) " +
                     " values('" + ViewState["partyidforemail"] + "','" + ViewState["deptid"] + "', " +
                     " '" + ViewState["desgid"] + "','','1','" + DateTime.Today + "','','','','', " +
                     " '" + txtmobileno.Text + "','" + txtemail.Text + "','" + id + "','" + accid + "','" + txtempname.Text + "','" + ViewState["whid"] + "','1','','','','','" + ViewState["Jobpositionid"] + "','1')";

            SqlCommand cmdemp = new SqlCommand(empins, con_Lice_Job);
            if (con_Lice_Job.State.ToString() != "Open")
            {
                con_Lice_Job.Open();
            }
            cmdemp.ExecuteNonQuery();
            con_Lice_Job.Close();

            string     str121qq = "select max(EmployeeMasterID) as EmployeeMasterID from EmployeeMaster";
            SqlCommand cmd121qq = new SqlCommand(str121qq, con_Lice_Job);

            SqlDataAdapter adp121qq = new SqlDataAdapter(cmd121qq);
            DataTable      ds121qq  = new DataTable();
            adp121qq.Fill(ds121qq);

            ViewState["emplofff"] = ds121qq.Rows[0]["EmployeeMasterID"].ToString();

            string strware = "";
            strware = "Insert  into EmployeeWarehouseRights (EmployeeId,Whid,AccessAllowed)values('" + ds121qq.Rows[0]["EmployeeMasterID"] + "','" + ViewState["whid"] + "','1')";

            SqlCommand cmd1ware = new SqlCommand(strware, con_Lice_Job);
            if (con_Lice_Job.State.ToString() != "Open")
            {
                con_Lice_Job.Open();
            }
            cmd1ware.ExecuteNonQuery();
            con_Lice_Job.Close();

            string stremp = "";

            ViewState["EducationqualificationID"] = "1007";

            ViewState["SpecialSubjectID"] = "41";

            ViewState["Jobpositionid"] = "4";


            Session["phofile"] = "";
            phofile            = Convert.ToString(Session["phofile"]);

            SqlDataAdapter dacategory = new SqlDataAdapter("select id from CandidateApplicationStatusMaster where PageStatusName='Application received'", con_Lice_Job);
            DataTable      dtcategory = new DataTable();
            dacategory.Fill(dtcategory);

            if (dtcategory.Rows.Count > 0)
            {
                ViewState["StatusMaster"] = dtcategory.Rows[0]["id"].ToString();
            }
            //
            string photopath;

            photopath = "CandidateMale.png";
            stremp    = "Insert into CandidateMaster (PartyID,DeptID,DesignationMasterId,StatusMasterId,EmployeeTypeId,AccountId,AccountNo,CountryId,StateId,City,SuprviserId,EducationqualificationID,SpecialSubjectID,yearofexperience,Jobpositionid,Whid,Compid,Active,LastName,FirstName,MiddleName,CandidateNumber,DOB,CandidatePhotoPath,Address,EffectiveFrom,ContactNo,MobileNo,Sex) " +
                        " values ('" + Convert.ToInt32(ds5.Tables[0].Rows[0]["PartyId"].ToString()) + "','" + ViewState["deptid"] + "','" + ViewState["desgid"] + "','" + ViewState["StatusMaster"] + "','" + "" + "','" + id + "','" + accid + "','' " +
                        " ,'','','" + "" + "','" + ViewState["EducationqualificationID"].ToString() + "','" + ViewState["SpecialSubjectID"].ToString() + "','0','" + ViewState["Jobpositionid"].ToString() + "','" + ViewState["whid"] + "','" + ViewState["comid"].ToString() + "','1','" + txtempname.Text + "','','','" + Convert.ToString(Session["CandidateNumber"]) + "','" + "" + "','" + photopath + "','','" + DateTime.Now.ToShortDateString() + "','" + txtmobileno.Text + "','','1') ";


            SqlCommand cmdemp11 = new SqlCommand(stremp, con_Lice_Job);
            con_Lice_Job.Open();
            cmdemp11.ExecuteNonQuery();
            con_Lice_Job.Close();


            ViewState["PartyMasterId"] = ds5.Tables[0].Rows[0]["PartyId"].ToString();
            Session["userid"]          = ds11.Rows[0]["userid"].ToString();
            Session["username"]        = tbUserName.Text;


            string     str121 = "select max(CandidateId) as EmployeeMasterID from CandidateMaster";
            SqlCommand cmd121 = new SqlCommand(str121, con_Lice_Job);

            SqlDataAdapter adp121 = new SqlDataAdapter(cmd121);
            DataTable      ds121  = new DataTable();
            adp121.Fill(ds121);


            if (ds121.Rows.Count > 0)
            {
                ViewState["EmerEMID"] = ds121.Rows[0]["EmployeeMasterID"].ToString();
            }
            string insert = "";


            insert = "insert into CandidateforFranchiseTBL(CandidateMasterID,RegisteringFranchiseeID,CandidatesPrimaryFranchiseeID,DateandTime,Active)values('" + ViewState["EmerEMID"].ToString() + "','jobcenter','jobcenter','" + DateTime.Now.ToShortDateString() + "','Active')";


            SqlCommand ni = new SqlCommand(insert, con_Lice_Job);
            if (con_Lice_Job.State.ToString() != "Open")
            {
                con_Lice_Job.Open();
            }
            ni.ExecuteNonQuery();
            con_Lice_Job.Close();


            string     insertSyncr = "insert into Syncr_LicenseEmployee_With_JobcenterId(License_Emp_id,Jobcenter_Emp_id)values('" + ViewState["Id"].ToString() + "','" + ViewState["emplofff"].ToString() + "')";
            SqlCommand nisync      = new SqlCommand(insertSyncr, con_Lice_Job);
            if (con_Lice_Job.State.ToString() != "Open")
            {
                con_Lice_Job.Open();
            }
            nisync.ExecuteNonQuery();
            con_Lice_Job.Close();



            // sendmailtoadminforapproval();
            lblmsg.Text    = " sucessfully registered " + tbUserName.Text + "-" + tbPassword.Text;
            lblmsg.Visible = true;
            //clear();
        }
    }
    protected void Button7_Click(object sender, EventArgs e)
    {
        int flag2 = attemptcount();

        if (flag2 == 1)
        {
            lbllicensekeyverification.Text = "You have unsuccessfully tried to log in five times. Your account is now locked out for ten minutes.<br/>Please try again after ten minutes.";
        }
        else
        {
            SqlCommand cmd = new SqlCommand("SELECT LicenseMaster.CompanyId, LicenseMaster.LicenseKey,LicenseMaster.LicenseDate,CompanyMaster.CompanyName, CompanyMaster.AdminId, CompanyMaster.Password,CompanyMaster.Websiteurl,CompanyMaster.active, " +
                                            " HostDetail.SqlServerName, HostDetail.SqlServerUName, HostDetail.SqlServerUPassword, HostDetail.DatabaseName " +
                                            " FROM CompanyMaster LEFT OUTER JOIN " +
                                            " HostDetail ON CompanyMaster.CompanyId = HostDetail.CompanyId LEFT OUTER JOIN " +
                                            " LicenseMaster ON CompanyMaster.CompanyId = LicenseMaster.CompanyId where LicenseMaster.LicenseKey='" + txtlicensekey.Text + "' and CompanyMaster.AdminId ='" + txtlicensekeyverificationuid.Text + "' and CompanyMaster.Password='******' and CompanyMaster.CompanyLoginId='" + ViewState["cid"].ToString() + "'  and CompanyMaster.active='1'", PageConn.licenseconn());
            SqlDataAdapter dtp = new SqlDataAdapter(cmd);
            DataTable      dt  = new DataTable();
            dtp.Fill(dt);

            if (dt.Rows.Count > 0)
            {
                int flag = attemptcount();

                if (flag == 1)
                {
                    lbllicensekeyverification.Text = "You have unsuccessfully tried to log in five times. Your account is now locked out for ten minutes.<br/>Please try again after ten minutes.";
                }
                else
                {
                    string         stripmasterid = " select * from IpControlMastertbl where CID='" + ViewState["cid"] + "' ";
                    SqlDataAdapter adpipmasterid = new SqlDataAdapter(stripmasterid, conn);
                    DataTable      dsipmasterid  = new DataTable();
                    adpipmasterid.Fill(dsipmasterid);

                    if (dsipmasterid.Rows.Count > 0)
                    {
                        string insertip = "insert into IpControldetailtbl (IpcontrolId,Cidwise,Userwise,UserId,Ipaddress) values ('" + dsipmasterid.Rows[0]["IpcontrolId"].ToString() + "','1','0','0','" + ViewState["ip"] + "')  ";

                        SqlCommand cmdinsertip = new SqlCommand(insertip, conn);
                        if (conn.State.ToString() != "Open")
                        {
                            conn.Open();
                        }
                        cmdinsertip.ExecuteNonQuery();
                        conn.Close();
                        pnlconfirmationmessagelicense.Visible = true;

                        lbllicenseconfirmation123.Text       = "You have successfully added the license key.";
                        lbllicenseconfirmation123456.Text    = ViewState["ip"].ToString();
                        lbllicenseconfirmation123456789.Text = " has now been added to the list of allowed IP addresses for the whole company.";
                        string successfull = "1";
                        InsertIpLog(successfull);
                        lblzerocounter.Text = "0";
                        LinkButton1.Visible = true;
                    }
                }
            }
            else
            {
                pnlconfirmationmessagelicense.Visible = true;

                lbllicenseconfirmation123.Text = " The Licensing information provided by you does not match our records. Kindly contact [email protected]";

                lbllicenseconfirmation123456.Text    = "";
                lbllicenseconfirmation123456789.Text = "";
                string successfull = "0";
                InsertIpLog(successfull);
                counter();
                LinkButton1.Visible = false;
            }
        }
    }