예제 #1
0
    public static Boolean Delete_CompanyABCDetail_Server(string CompanyLoginId)
    {
        Boolean Status = false;

        try
        {
            SqlConnection connCompserver = new SqlConnection();
            connCompserver = ServerWizard.ServerDefaultInstanceConnetionTCP(CompanyLoginId);
            if (connCompserver.State.ToString() != "Open")
            {
                connCompserver.Open();
            }
            SqlCommand cmdDel = new SqlCommand("CompanyABCDetail_AddDelUpdtSelect", connCompserver);
            cmdDel.CommandType = CommandType.StoredProcedure;
            cmdDel.Parameters.AddWithValue("@StatementType", "Delete");
            cmdDel.Parameters.AddWithValue("@CompanyLoginId", CompanyLoginId);
            cmdDel.ExecuteNonQuery();
            Status = true;
        }
        catch
        {
            Status = false;
        }
        return(Status);
    }
예제 #2
0
    public static Boolean Insert_CompanyABCDetail_SERVER(string CompanyLoginId, string Z, string D1, string D2, string D3, string D4, string D5, string E1, string E2, string E3, string E4, string E5, string F1, string F2, string F3, string F4, string F5)
    {
        Boolean Status = false;

        try
        {
            SqlConnection connCompserver = new SqlConnection();
            connCompserver = ServerWizard.ServerDefaultInstanceConnetionTCP(CompanyLoginId);
            if (connCompserver.State.ToString() != "Open")
            {
                connCompserver.Open();
            }
            SqlCommand cmd = new SqlCommand("CompanyABCDetail_AddDelUpdtSelect", connCompserver);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@StatementType", "Insert");
            cmd.Parameters.AddWithValue("@CompanyLoginId", CompanyLoginId);
            cmd.Parameters.AddWithValue("@Z", Z);

            cmd.Parameters.AddWithValue("@D1", D1);
            cmd.Parameters.AddWithValue("@D2", D1);
            cmd.Parameters.AddWithValue("@D3", D3);
            cmd.Parameters.AddWithValue("@D4", D4);
            cmd.Parameters.AddWithValue("@D5", D5);

            cmd.Parameters.AddWithValue("@E1", E1);
            cmd.Parameters.AddWithValue("@E2", E1);
            cmd.Parameters.AddWithValue("@E3", E3);
            cmd.Parameters.AddWithValue("@E4", E4);
            cmd.Parameters.AddWithValue("@E5", E5);

            cmd.Parameters.AddWithValue("@F1", F1);
            cmd.Parameters.AddWithValue("@F2", F1);
            cmd.Parameters.AddWithValue("@F3", F3);
            cmd.Parameters.AddWithValue("@F4", F4);
            cmd.Parameters.AddWithValue("@F5", F5);
            cmd.ExecuteNonQuery();
            connCompserver.Close();
            Status = true;
        }
        catch
        {
            Status = false;
        }
        return(Status);
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["sid"] != null && Request.QueryString["compid"] != null)
            {
                string sid = Request.QueryString["sid"].ToString().Replace(" ", "+");
                sid = PageMgmt.Decrypted(sid);
                // string versionid = PageMgmt.Decrypted(Request.QueryString["versionid"]);
                //  string compid =PageMgmt.Decrypted(Request.QueryString["compid"].ToString());
                string compidaa = Request.QueryString["compid"].ToString().Replace(" ", "+");
                string compid   = PageMgmt.Decrypted(compidaa.ToString());
                //sid = "5";
                //compid = "aswathy";
                DataTable ds = MyCommonfile.selectBZ(" SELECT TOP (1) dbo.PortalMasterTbl.Id AS portlID, dbo.PortalMasterTbl.PortalName, dbo.PricePlanMaster.VersionInfoMasterId,dbo.PricePlanMaster.Producthostclientserver,dbo.ClientMaster.ClientURL, dbo.ClientMaster.ServerId AS ClientServerid, dbo.ServerMasterTbl.*, dbo.CompanyMaster.ServerId FROM dbo.CompanyMaster INNER JOIN dbo.PricePlanMaster ON dbo.PricePlanMaster.PricePlanId = dbo.CompanyMaster.PricePlanId INNER JOIN dbo.PortalMasterTbl ON dbo.PricePlanMaster.PortalMasterId1 = dbo.PortalMasterTbl.Id INNER JOIN dbo.VersionInfoMaster ON dbo.PricePlanMaster.VersionInfoMasterId = dbo.VersionInfoMaster.VersionInfoId INNER JOIN dbo.ProductMaster ON dbo.VersionInfoMaster.ProductId = dbo.ProductMaster.ProductId INNER JOIN dbo.ClientMaster ON dbo.ProductMaster.ClientMasterId = dbo.ClientMaster.ClientMasterId INNER JOIN dbo.ServerMasterTbl ON dbo.CompanyMaster.ServerId = dbo.ServerMasterTbl.Id  where CompanyLoginId='" + compid + "' ");
                if (ds.Rows.Count > 0)
                {
                    string ComServerId = ds.Rows[0]["ServerId"].ToString();
                    string versionid   = ds.Rows[0]["VersionInfoMasterId"].ToString();

                    lbl_serverurl.Text = ds.Rows[0]["Busiwizsatellitesiteurl"].ToString();
                    string sqlservernameip            = ds.Rows[0]["PublicIp"].ToString();
                    string Comp_serversqlinstancename = ds.Rows[0]["DefaultsqlInstance"].ToString();
                    string sqlinstancename            = ds.Rows[0]["Sqlinstancename"].ToString();


                    string DefaultMdfpath = ds.Rows[0]["DefaultMdfpath"].ToString();
                    string DefaultLdfpath = ds.Rows[0]["DefaultLdfpath"].ToString();
                    string iispath        = ds.Rows[0]["serverdefaultpathforiis"].ToString();

                    string Comp_Ser_Masterpath    = ds.Rows[0]["folderpathformastercode"].ToString();
                    string Comp_Ser_iispath       = ds.Rows[0]["serverdefaultpathforiis"].ToString();
                    string Comp_ServEnckey        = ds.Rows[0]["Enckey"].ToString();
                    string Comp_serversqlserverip = ds.Rows[0]["sqlurl"].ToString();

                    // string Comp_serversqlport = ds.Rows[0]["port"].ToString();
                    string Comp_serversqldbname = ds.Rows[0]["DefaultDatabaseName"].ToString();
                    //  string Comp_serversqlpwd = ds.Rows[0]["Sapassword"].ToString();
                    Comp_serverweburl = ds.Rows[0]["Busiwizsatellitesiteurl"].ToString();
                    sqlserverport     = ds.Rows[0]["port"].ToString();

                    string sqlCompport28  = ds.Rows[0]["PortforCompanymastersqlistance"].ToString();//2810
                    string ClientServerid = ds.Rows[0]["ClientServerid"].ToString();
                    string ClientURL      = ds.Rows[0]["ClientURL"].ToString();



                    DataTable DTclientServerid = MyCommonfile.selectBZ(" Select * From ServerMasterTbl Where id='" + ClientServerid + "'");
                    clientServerfolderpathformastercode = DTclientServerid.Rows[0]["folderpathformastercode"].ToString();
                    FTP         = DTclientServerid.Rows[0]["FTPforMastercode"].ToString();
                    FTPUserName = DTclientServerid.Rows[0]["FTPuseridforDefaultIISpath"].ToString();
                    FTPPassword = DTclientServerid.Rows[0]["FtpPasswordforDefaultIISpath"].ToString();
                    FTPport     = DTclientServerid.Rows[0]["FTPportfordefaultIISpath"].ToString();

                    bool SerConnstatust = false;
                    int  timeconncheck  = 1;

                    connCompserver = ServerWizard.ServerDefaultInstanceConnetionTCP(compid);
                    string Compserverconnnstr = connCompserver.ConnectionString;
                    while ((!SerConnstatust) && (timeconncheck < 2))
                    {
                        try
                        {
                            if (connCompserver.State.ToString() != "Open")
                            {
                                connCompserver.Open();
                                SerConnstatust = true;
                            }
                            else
                            {
                                SerConnstatust = true;
                            }
                        }
                        catch
                        {
                            timeconncheck++;
                            //Port Open
                            //Page Y
                            string pagenamemainY = "Satelliteservfunction.aspx?PO=OpenPort&PortNo=" + BZ_Common.Encrypted_satsrvencryky(sqlserverport) + "&Port2No=" + BZ_Common.Encrypted_satsrvencryky(sqlCompport28) + "";//&SilentPageRequestTblID=" + PageMgmt.Encrypted(SilentPageRequestTblID) + "
                            //Page X
                            string mycurrenturlX          = Request.Url.AbsoluteUri;
                            Random random                 = new Random();
                            int    randomNumber           = random.Next(1, 10);
                            string Randomkeyid            = Convert.ToString(randomNumber);
                            string SilentPageRequestTblID = CompanyRelated.Insert_SilentPageRequestTbl(ComServerId, pagenamemainY, DateTime.Now.ToString(), "", false, Randomkeyid, mycurrenturlX);
                            string url = "";
                            url = "http://" + Comp_serverweburl + "/vfysrv.aspx?licensesilentpagerequesttblid=" + BZ_Common.Encrypted_satsrvencryky(SilentPageRequestTblID) + "&pageredirecturl=" + BZ_Common.Encrypted_satsrvencryky(pagenamemainY) + "&mstrsrvky=" + BZ_Common.Encrypted_satsrvencryky(BZ_Common.satsrvencryky()) + "&returnurl=" + BZ_Common.Encrypted_satsrvencryky(ClientURL) + "";
                            Response.Redirect("" + url + "");
                        }
                    }

                    if (SerConnstatust == true)//if conn open (port open)
                    {
                        InsertServerMaster(sid);

                        Database_Latest_Code_Insert(compid, sid, versionid, Compserverconnnstr, Comp_Ser_iispath, Comp_Ser_Masterpath, Comp_serverweburl, ClientServerid, DefaultMdfpath, DefaultLdfpath, sqlservernameip, sqlinstancename);

                        Website_Latest_Code_Insert(sid, versionid, compid, Compserverconnnstr, iispath, Comp_ServEnckey, Comp_Ser_Masterpath, Comp_serverweburl, iispath);

                        lbl_compid.Text = compid;
                        string pagenames = "";
                        pagenames = "http://" + Comp_serverweburl + "/Satelliteservfunction.aspx?ftpurl=" + BZ_Common.BZ_Encrypted(FTP) + "&userid=" + BZ_Common.BZ_Encrypted(FTPUserName) + "&password="******"&portno=" + BZ_Common.BZ_Encrypted(FTPport) + "&Compid=" + BZ_Common.BZ_Encrypted(compid) + "&ServerID=" + BZ_Common.BZ_Encrypted(sid) + "&PortSecID=1";
                        Response.Redirect("" + pagenames + "");
                        // FillGrid_ComCreNeedCode();
                    }
                    else
                    {
                        lblmsg.Text = "Connecting to server database problem";
                    }
                }
                else
                {
                    lblmsg.Text = "No record available for  ";
                }
            }
        }
    }