Пример #1
0
        protected void LoadMycurrentDeployPeriod()
        {
            DataTable _dt = Guard_deployment.select_my_active_deployment_period("select_my_active_deployment_period", SystemConst._user_id);

            if (_dt.Rows.Count > 0)
            {
                this.gdv_current_deployment_period.DataSource = _dt;
                this.gdv_current_deployment_period.Columns["deploy_id"].Visible            = false;
                this.gdv_current_deployment_period.Columns["deploy_start_date"].HeaderText = "Deployment start date";
                this.gdv_current_deployment_period.Columns["deploy_end_date"].HeaderText   = "Deployment end date";
                this.gdv_current_deployment_period.Columns["user_id"].Visible                = false;
                this.gdv_current_deployment_period.RowsDefaultCellStyle.BackColor            = Color.LightGray;
                this.gdv_current_deployment_period.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;
                this.gdv_current_deployment_period.ColumnHeadersDefaultCellStyle.ForeColor   = Color.White;
                this.gdv_current_deployment_period.ColumnHeadersDefaultCellStyle.BackColor   = Color.Black;
                this.gdv_current_deployment_period.RowHeadersDefaultCellStyle.BackColor      = Color.Black;
                this.gdv_current_deployment_period.DefaultCellStyle.SelectionBackColor       = Color.Cyan;
                this.gdv_current_deployment_period.DefaultCellStyle.SelectionForeColor       = Color.Black;
                foreach (DataGridViewColumn c in this.gdv_current_deployment_period.Columns)
                {
                    c.DefaultCellStyle.Font = new System.Drawing.Font("Arial", 11f, GraphicsUnit.Pixel);
                }
                this.gdv_current_deployment_period.ColumnHeadersDefaultCellStyle.BackColor = Color.CadetBlue;
                this.gdv_current_deployment_period.EnableHeadersVisualStyles = false;
            }
        }
Пример #2
0
        protected void Set_current_deployment_periods()
        {
            DataTable dt = Guard_deployment.select_my_active_deployment_period("select_my_active_deployment_period", SystemConst._user_id);

            if (dt.Rows.Count > 0)
            {
                DataRow dtRow = dt.Rows[0];
                int     num   = Convert.ToInt32(dtRow["deploy_id"].ToString());
                SystemConst._active_deployment_id  = num.ToString();
                SystemConst._deployment_start_date = Convert.ToDateTime(dtRow["deploy_start_date"]);
                SystemConst._deployment_end_date   = Convert.ToDateTime(dtRow["deploy_end_date"]);
            }
            else
            {
                SystemConst._active_deployment_id = string.Empty;
            }
        }