예제 #1
0
        public void CustomerUserLoad()
        {
            try
            {
                string pageIndexAndCount = winFormPager1.PageIndex + "." + winFormPager1.PageSize;
                ResultModelOfArrayOfModel_CustomerUserd4FqxSXX customeruser = cs.GetCustomerUserList(customs.Idk__BackingField, true, pageIndexAndCount);
                ResultModelOfArrayOfModel_CustomerUserd4FqxSXX count        = cs.GetCustomerUserList(customs.Idk__BackingField, true, null);
                winFormPager1.DrawControl(count.Data.Count <Model_CustomerUser>());
                if (customeruser.Code != 0)
                {
                    MessageBox.Show(customeruser.Message);
                }
                else
                {
                    dataGridView1.Rows.Clear();
                    dataGridView1.AutoGenerateColumns = false;
                    foreach (Model_CustomerUser item in customeruser.Data)
                    {
                        int rowIndex = dataGridView1.Rows.Add();
                        dataGridView1.Rows[rowIndex].Cells[0].Value = item.Idk__BackingField;
                        dataGridView1.Rows[rowIndex].Cells[1].Value = item.UserNamek__BackingField;
                        dataGridView1.Rows[rowIndex].Cells[2].Value = item.DisplayNamek__BackingField;
                        dataGridView1.Rows[rowIndex].Cells[3].Value = item.Passwordk__BackingField;
                        dataGridView1.Rows[rowIndex].Cells[4].Value = item.CreateAtk__BackingField.ToString("yyyy-MM-dd HH:mm:ss");
                        if (item.Activedk__BackingField == Enum_Active.Enabled)
                        {
                            dataGridView1.Rows[rowIndex].Cells[5].Value = "启用";
                        }

                        else
                        {
                            dataGridView1.Rows[rowIndex].Cells[5].Value = "停用";
                        }

                        dataGridView1.Rows[rowIndex].Tag = item;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }