예제 #1
0
        public List<cls_Partner> GetAllListNewPartner(System.Data.SqlClient.SqlConnection connection)
        {
            List<cls_Partner> PartnerList = new List<cls_Partner>();
            using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand())
            {
                cmd.CommandText = "SELECT TOP 1 * FROM Partner WHERE FL_ACTIVE = 1 ORDER BY PartnerID DESC";
                using (DataTable dt = DB_Gateway.ExecuteDataTable(cmd, connection))
                {
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            cls_Partner objPartner = new cls_Partner();
                            objPartner.TransferToClass(dr);
                            PartnerList.Add(objPartner);
                        }
                    }

                }
            }
            if (connection != null) connection.Close();
            return PartnerList;
        }
예제 #2
0
        public List<cls_Partner> GetAllByVKN(string connectionString, string VKN)
        {
            using (System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection(connectionString))
            {
                List<cls_Partner> result = new List<cls_Partner>();

                using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand())
                {
                    cmd.CommandText = "SELECT * FROM Partner WHERE VKN = @pVKN";
                    cmd.Parameters.AddWithValue("@pVKN", VKN);
                    using (DataTable dt = DB_Gateway.ExecuteDataTable(cmd, connection))
                    {
                        if (dt != null)
                        {
                            foreach (DataRow dr in dt.Rows)
                            {
                                cls_Partner pa = new cls_Partner();
                                pa.TransferToClass(dr);
                                result.Add(pa);
                            }
                        }
                    }
                    if (connection != null) connection.Close();
                    return result;
                }
            }
        }
예제 #3
0
        public List<cls_Partner> GetAll(System.Data.SqlClient.SqlConnection connection, GlobalEnum.FL_ACTIVE pFL_ACTIVE)
        {
            List<cls_Partner> PartnerList = new List<cls_Partner>();
            using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand())
            {
                cmd.CommandText = "Select * FROM Partner " + ((pFL_ACTIVE != GlobalEnum.FL_ACTIVE.ALL) ? "where FL_ACTIVE = @pFL_ACTIVE" : "");
                cmd.Parameters.AddWithValue("@pFL_ACTIVE", pFL_ACTIVE);
                using (DataTable dt = DB_Gateway.ExecuteDataTable(cmd, connection))
                {
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            cls_Partner objPartner = new cls_Partner();
                            objPartner.TransferToClass(dr);
                            PartnerList.Add(objPartner);
                        }
                    }

                }
            }
            if (connection != null) connection.Close();
            return PartnerList;
        }
예제 #4
0
        public List<cls_Partner> GetAllByModulId(System.Data.SqlClient.SqlConnection connection, int ModuleId)
        {
            List<cls_Partner> PartnerList = new List<cls_Partner>();

            using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand())
            {
                cmd.CommandText = @" SELECT * FROM Partner WHERE FL_ACTIVE = 1 and VKN in ( SELECT distinct VKN_TCKN FROM PartnerModules WHERE ModuleId = @ModuleId )";
                cmd.Parameters.AddWithValue("@ModuleId", ModuleId);

                using (DataTable dt = DB_Gateway.ExecuteDataTable(cmd, connection))
                {
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            cls_Partner objPartner = new cls_Partner();
                            objPartner.TransferToClass(dr);
                            PartnerList.Add(objPartner);
                        }
                    }

                }
            }
            if (connection != null) connection.Close();
            return PartnerList;
        }
예제 #5
0
        // *****************************************************************************************
        // Organization DB Boyutunu Bul ve Diskteki Kapladığı Yeri Yüzdelik Olarak Hesapla
        // *****************************************************************************************
        private void GetOrganizationSize()
        {
            cls_Partner objPartner = new cls_Partner();
            string ResultSize = objPartner.ShowOrganizationSize(GlobalSettings.OrganizationConnectionString);
            OrganizationDBSize = Convert.ToDouble(ResultSize.Remove(ResultSize.Length - 6, 6)) / 1000;
            OrganizationDBSize = Math.Floor(OrganizationDBSize);
            this.lblOrganizationSize.Text = "Organization " + "(" + OrganizationDBSize + " GB" + ")";
            OrganizationDBSizePercent = this.OrganizationDBSize * 100 / DiskTotalSize;
            OrganizationDBSizePercent = Math.Floor(OrganizationDBSizePercent);
            this.lblOrganizationSizePercent.Text = OrganizationDBSizePercent.ToString();
            string ProgressBar = "width: " + Convert.ToString(OrganizationDBSizePercent) + "%";
            ((HtmlGenericControl)this.Page.Master.FindControl("spProgressOrganization")).Attributes.Add("style", ProgressBar);
            ((HtmlGenericControl)this.Page.Master.FindControl("spProgressOrganization")).Attributes.Add("aria-valuenow", ProgressBar);

            if (OrganizationDBSizePercent < 50.0 || OrganizationDBSizePercent == 50.0)
            {
                ((HtmlGenericControl)this.Page.Master.FindControl("spProgressOrganization")).Attributes.Add("class", "progress-bar progress-bar-success");
            }
            else if (OrganizationDBSizePercent > 50.0 || OrganizationDBSizePercent < 80.0)
            {
                ((HtmlGenericControl)this.Page.Master.FindControl("spProgressOrganization")).Attributes.Add("class", "progress-bar progress-bar-warning");
            }
            else if (OrganizationDBSizePercent == 80.0 || OrganizationDBSizePercent > 80.0)
            {
                ((HtmlGenericControl)this.Page.Master.FindControl("spProgressOrganization")).Attributes.Add("class", "progress-bar progress-bar-danger");

                // Boyut Yükseldiğinde Uyarı Simgesi Çıkar
                ((HtmlGenericControl)this.Page.Master.FindControl("spDatabaseWarningCount")).Attributes.Add("class", "badge");
                DatabaseWarningCount += 1;
                this.lblDatabaseWarningCount.Text = DatabaseWarningCount.ToString();
                this.btnCleanData.Visible = true;
                SendMail(this.lblOrganizationSize.Text, DatabaseStatusMailMessage);
            }
        }