Esempio n. 1
0
        private void Bind()
        {
            try
            {
                lblBOOKNAME.Text      = "ASP.NET基础";
                lblBOOKQUANTITY.Text  = "2本";
                lblBOOKUNITPRICE.Text = "50元";
                lblBOOKLOADSTOCK.Text = "0本";
                lblBOOKLOSEQTY.Text   = "0本";
                lblBOOKPUBLIDATE.Text = DateTime.Now.ToString();
                lblBOOKBORROWQTY.Text = "0次";
                lblAmount.Text        = "100.00元";
                //图书图片
                imglist.Add("Book1");
                imglist.Add("Book2");
                if (imglist.Count > 0)
                {
                    CreateImg();
                    switch (imglist.Count)
                    {
                    case 1:
                    case 2:
                    case 3:
                    case 4:
                        GridView1.Top = 335 + 75 + 13;
                        Height        = Convert.ToInt32(GridView1.Top) + Height;
                        break;

                    case 5:
                    case 6:
                    case 7:
                    case 8:
                        GridView1.Top = 335 + (75 * 2) + 13;
                        Height        = Convert.ToInt32(GridView1.Top) + Height;
                        break;

                    case 9:
                        GridView1.Top = 335 + (75 * 3) + 13;
                        Height        = Convert.ToInt32(GridView1.Top) + Height;
                        break;
                    }
                }
                else
                {
                    GridView1.Top = 335;
                }
                COMSSmobilerDemo.common.BookSNInfo BookSNInfo = new COMSSmobilerDemo.common.BookSNInfo();
                DataTable table = BookSNInfo.GetBookSNbyBookID();
                GridView1.DataSource = table;
                GridView1.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// ÏÂÀ­Ñ¡Ôñ
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks></remarks>
        private void btnpop_Click(object sender, EventArgs e)
        {
            try
            {
                btnName = sender;
                PopList1.Groups.Clear();
                PopListGroup poli = new PopListGroup();
                PopList1.Groups.Add(poli);
                COMSSmobilerDemo.common.BookLogInfo BookLogInfo = new COMSSmobilerDemo.common.BookLogInfo();
                COMSSmobilerDemo.common.BookSNInfo  BookSNInfo  = new COMSSmobilerDemo.common.BookSNInfo();
                DataTable table = new DataTable();
                switch (((Button)btnName).Name)
                {
                case "btnBOOKSN2":
                    table     = BookSNInfo.GetBookSNbyBookID();
                    poli.Text = "ͼÊéÐòºÅÑ¡Ôñ";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["BOOKSNID"].ToString(), rowli["BOOKSNID"].ToString());
                        if (txtBOOKSNID.Text.Trim().Length > 0)
                        {
                            if (txtBOOKSNID.Text.Trim().Equals(rowli["BOOKSNID"]))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;

                case "btnState":
                case "btnState2":
                    table     = BookLogInfo.StateData();
                    poli.Text = "״̬ѡÔñ";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["StateName"].ToString(), rowli["State"].ToString());
                        if (state.ToString().Length > 0)
                        {
                            if (state.Equals(rowli["State"]))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;

                case "btnBORROWER2":
                    table     = BookLogInfo.GetUserData();
                    poli.Text = "Óû§Ñ¡Ôñ";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["USER_NAME"].ToString(), rowli["USER_ID"].ToString());
                        if (string.IsNullOrWhiteSpace(txtBORROWER.Text) == false)
                        {
                            if (txtBORROWER.Text.Trim().ToUpper() == rowli["USER_ID"].ToString().Trim().ToUpper())
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;
                }
                switch (((Button)btnName).Name)
                {
                case "btnState":
                case "btnState2":
                    PopList1.ShowDialog();
                    break;

                default:
                    PopList1.Show();
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }