示例#1
0
        private void SearchResult()
        {
            string prjectCode = CommonHandler.GetComboBoxSelectedValue(cboProject).ToString();
            string shopCode   = btnShopCode.Text;
            List <ShopSubjectExamTypeDto> list = new List <ShopSubjectExamTypeDto>();
            DataSet ds = webService.GetShopSubjectExamTypeList(prjectCode, shopCode);

            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    ShopSubjectExamTypeDto exam = new ShopSubjectExamTypeDto();
                    exam.ProjectCode  = Convert.ToString(ds.Tables[0].Rows[i]["ProjectCode"]);
                    exam.ShopCode     = Convert.ToString(ds.Tables[0].Rows[i]["ShopCode"]);
                    exam.ShopName     = Convert.ToString(ds.Tables[0].Rows[i]["ShopName"]);
                    exam.ExamTypeCode = Convert.ToString(ds.Tables[0].Rows[i]["SubjectTypeCodeExam"]);
                    exam.CheckUserId  = Convert.ToString(ds.Tables[0].Rows[i]["CheckUserId"]);
                    if (ds.Tables[0].Rows[i]["CheckDate"] != DBNull.Value)
                    {
                        exam.CheckDate = Convert.ToDateTime(ds.Tables[0].Rows[i]["CheckDate"]);
                    }
                    else
                    {
                        exam.CheckDate = null;
                    }
                    list.Add(exam);
                }
            }
            grcShop.DataSource = list;
            listDto            = list;
        }
        private void btnShopCode_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            Shop_Popup pop = new Shop_Popup("", "", false);

            pop.ShowDialog();
            ShopDto dto = pop.Shopdto;

            if (dto != null)
            {
                btnShopCode.Text = dto.ShopCode;
                txtShopName.Text = dto.ShopName;
            }
            ProjectCode_Golbal = CommonHandler.GetComboBoxSelectedValue(cboProjects).ToString();
            ShopCode_Golbal    = btnShopCode.Text;

            //卖场改变的时候对应的试卷类型也进行改变

            //List<ShopSubjectExamTypeDto> list = new List<ShopSubjectExamTypeDto>();
            ShopSubjectExamTypeDto shop = new ShopSubjectExamTypeDto();
            DataSet ds = service.SearchShopExamTypeByProjectCodeAndShopCode(ProjectCode_Golbal, ShopCode_Golbal);

            if (ds.Tables[0].Rows.Count > 0)
            {
                shop.ExamTypeCode = ds.Tables[0].Rows[0]["SubjectTypeCodeExam"] == null ? "" : ds.Tables[0].Rows[0]["SubjectTypeCodeExam"].ToString();
            }
            else
            {
                shop.ExamTypeCode = "";
            }
            CommonHandler.SetComboBoxSelectedValue(cboExamType, shop.ExamTypeCode);
        }