コード例 #1
0
        protected void btn_ShowRequest_Click(object sender, EventArgs e)
        {
            // ScoId=0 -> هنوز بررسی نشده
            DataTable DTCustomer = MPB.Get_Customers_ClassNameByName(ddl_Customers.SelectedValue, 0, -1);

            RadGrid1.DataSource = DTCustomer;
            RadGrid1.DataBind();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable DTCustomer = MPB.Get_Customers_ClassNameByName("", -2, 3);

                // لیست کلاس های درسی
                for (int i = 0; i < DTCustomer.Rows.Count; i++)
                {
                    if (int.Parse(DTCustomer.Rows[i]["ScoId"].ToString()) > 0)
                    {
                        RadComboBoxItem cmbitem = new RadComboBoxItem();
                        cmbitem.Text      = DTCustomer.Rows[i]["Name"].ToString();
                        cmbitem.Value     = DTCustomer.Rows[i]["Id"].ToString();
                        cmbitem.Font.Name = "Tahoma";
                        cmbitem.Font.Size = 8;
                        ddl_ClassName.Items.Add(cmbitem);
                    }
                }

                // انتخاب کاربران برای اضافه کردن به کلاس
                RadComboBoxItem cmbitem2 = new RadComboBoxItem();
                cmbitem2.Text      = "جستجوی کاربر";
                cmbitem2.Value     = "0";
                cmbitem2.Font.Name = "Tahoma";
                cmbitem2.Font.Size = 8;
                ddl_StatusUser.Items.Add(cmbitem2);

                RadComboBoxItem cmbitem3 = new RadComboBoxItem();
                cmbitem3.Text      = "ایجاد کاربر جدید";
                cmbitem3.Value     = "1";
                cmbitem3.Font.Name = "Tahoma";
                cmbitem3.Font.Size = 8;
                ddl_StatusUser.Items.Add(cmbitem3);
            }
        }
コード例 #3
0
        protected void btn_ShowRequest_Click(object sender, EventArgs e)
        {
            InfoMeeting.Visible      = false;
            InfoUser.Visible         = false;
            InfoClassDayTime.Visible = false;

            int Status = 0;

            if (ddl_Status.SelectedValue == "درحال بررسی")
            {
                Status = 0;
            }
            else if (ddl_Status.SelectedValue == "رد شده")
            {
                Status = -1;
            }
            else if (ddl_Status.SelectedValue == "پذیرفته شده")
            {
                Status = 1;
            }
            else
            {
                Status = -2;// همه درخواست ها
            }
            DataTable DTCustomer = MPB.Get_Customers_ClassNameByName(ddl_Customers.SelectedValue, Status, -1);

            DataTable DTSource = new DataTable();

            DTSource.Columns.Add("Id", typeof(string));
            DTSource.Columns.Add("CustomerId", typeof(string));
            DTSource.Columns.Add("Name", typeof(string));
            DTSource.Columns.Add("UserCount", typeof(string));
            DTSource.Columns.Add("DateStart", typeof(string));
            DTSource.Columns.Add("DateEnd", typeof(string));
            DTSource.Columns.Add("MeetingAccess", typeof(string));
            DTSource.Columns.Add("Status", typeof(string));

            for (int i = 0; i < DTCustomer.Rows.Count; i++)
            {
                DataRow row = DTSource.NewRow();
                row["Id"]         = DTCustomer.Rows[i]["Id"].ToString();
                row["CustomerId"] = DTCustomer.Rows[i]["CustomerId"].ToString();
                row["Name"]       = DTCustomer.Rows[i]["Name"].ToString();
                row["UserCount"]  = DTCustomer.Rows[i]["UserCount"].ToString();
                row["DateStart"]  = DTCustomer.Rows[i]["DateStart"].ToString();
                row["DateEnd"]    = DTCustomer.Rows[i]["DateEnd"].ToString();

                if (DTCustomer.Rows[i]["MeetingAccess"].ToString() == "denied")
                {
                    row["MeetingAccess"] = "فقط اعضاء کلاس";
                }
                else
                {
                    row["MeetingAccess"] = "امکان حضور مهمان";
                }

                if (DTCustomer.Rows[i]["ScoId"].ToString() == "0")
                {
                    row["Status"] = "درحال بررسی";
                }
                else if (DTCustomer.Rows[i]["ScoId"].ToString() == "-1")
                {
                    row["Status"] = "رد شده";
                }
                else
                {
                    row["Status"] = "پذیرفته شده";
                }

                DTSource.Rows.Add(row);
            }

            RadGrid1.DataSource = DTSource;
            RadGrid1.DataBind();
        }