/// <summary>
        /// 获取没有设置过团号的list,若有设置过的会报错
        /// </summary>
        /// <returns></returns>
        private List <Model.VisaInfo> GetDgvSelNotSetGroupList()
        {
            int count = this.dataGridView1.SelectedRows.Count;
            List <Model.VisaInfo> list = new List <VisaInfo>();

            for (int i = 0; i != count; ++i)
            {
                Model.VisaInfo model = _bllVisaInfo.GetModel(new Guid(dataGridView1.SelectedRows[i].Cells["Visainfo_id"].Value.ToString()));
                if (model == null)
                {
                    MessageBoxEx.Show(Resources.FindModelFailedPleaseCheckInfoCorrect);
                    return(null);
                }
                if (!string.IsNullOrEmpty(model.Visa_id))
                {
                    MessageBoxEx.Show("选中项中有已经设置过团号的签证!");
                    return(null);
                }
                if (model != null)
                {
                    list.Add(model);
                }
            }
            return(list);
        }
Example #2
0
        private void ModelToCtrls(Model.VisaInfo model)
        {
            if (model == null)
            {
                return;
            }

            txtName.Text              = model.Name;
            txtEnglishName.Text       = model.EnglishName;
            txtSex.Text               = model.Sex;
            txtIssuePlace.Text        = model.IssuePlace;
            txtResidence.Text         = model.Residence;
            txtBirthday.Text          = DateTimeFormator.DateTimeToString(model.Birthday);
            txtOccupation.Text        = model.Occupation;
            txtMarrige.Text           = model.Marriaged;
            txtIdentification.Text    = model.Identification;
            txtFinancialCapacity.Text = model.FinancialCapacity;
            txtPassportNo.Text        = model.PassportNo;
            txtLicenseTime.Text       = DateTimeFormator.DateTimeToString(model.LicenceTime);
            txtExpireDate.Text        = DateTimeFormator.DateTimeToString(model.ExpiryDate);
            txtBirthPlace.Text        = model.Birthplace;
            txtGroupNo.Text           = model.GroupNo;
            txtDepartureRecord.Text   = model.DepartureRecord;

            txtPhone.Text       = model.Phone;
            txtClient.Text      = model.Client;
            txtSalesPerson.Text = model.Salesperson;

            cbTypes.Text       = model.Types;
            txtReturnTime.Text = DateTimeFormator.DateTimeToString(model.ReturnTime);
            cbCountry.Text     = model.Country;
        }
Example #3
0
        private readonly int _curPage;            //主界面更新数据库需要一个当前页

        public FrmInfoTypeIn(Model.VisaInfo model, Action <int> updateDel, int page)
        {
            this.StartPosition = FormStartPosition.CenterParent; //不能写在form_load里面,是已经加载完成了
            InitializeComponent();
            this._model = model;
            _updateDel  = updateDel;
            _curPage    = page;
        }
 public ActionResult Add(Model.VisaInfo visaInfo)
 {
     visaInfo.EntryTime = DateTime.Now;
     if (bll.Add(visaInfo))
     {
         return(Content("ok"));
     }
     else
     {
         return(Content("添加失败,请检查用户是否已经存在!"));
     }
 }
Example #5
0
        private void LoadImageFromModel(Model.VisaInfo model)
        {
            if (model == null)
            {
                pictureBox1.Image = Resources.PassportPictureNotFound;
                return;
            }

            if (!PassportPicHandler.CheckAndDownloadIfNotExist(model.PassportNo, PassportPicHandler.PicType.Type01Normal))
            {
                pictureBox1.Image = Resources.PassportPictureNotFound;
                return;
            }
            pictureBox1.Image = GlobalUtils.LoadImageFromFileNoBlock(GlobalUtils.PassportPicPath + "\\" + model.PassportNo + ".jpg");
        }
Example #6
0
 /// <summary>
 /// 更新移出了的人的数据库
 /// </summary>
 private void UpdateOutListVisaInfo()
 {
     for (int i = 0; i < lvOut.Items.Count; i++)
     {
         Model.VisaInfo model = lvOut.Items[i].Tag as Model.VisaInfo;
         model.Visa_id = null;
         model.GroupNo = null;
         model.Country = null;
         model.Types   = null;
         //TODO:资料录入情况怎么处理
         //执行更新
         if (_bllVisaInfo.Update(model) == false)
         {
             MessageBoxEx.Show(Resources.FailedUpdateVisaInfoState);
             return;
         }
         MessageBoxEx.Show("成功从当前团移出" + lvOut.Items.Count + "条记录.");
     }
 }
        public int MoveCheckedDataToVisaInfo()
        {
            int res  = 0;
            var list = GetModelList(string.Empty);

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].HasChecked == Common.Enums.HasChecked.Yes)
                {
                    Model.VisaInfo model = new Model.VisaInfo();
                    list[i].CopyToVisaInfo(model);
                    if (_bllVisaInfo.Add(model) && Delete(list[i].VisaInfo_id))
                    {
                        res++;
                    }
                }
            }
            return(res);
        }
        /// <summary>
        /// 录入资料
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmsItemTypeInInfo_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.SelectedRows.Count > 1)
            {
                MessageBoxEx.Show(Resources.SelectEditMoreThanOne);
                return;
            }

            string visainfoid = dataGridView1.SelectedRows[0].Cells["VisaInfo_id"].Value.ToString();

            Model.VisaInfo model = _bllVisaInfo.GetModel(new Guid(visainfoid));
            if (model == null)
            {
                MessageBoxEx.Show(Resources.FindModelFailedPleaseCheckInfoCorrect);
                return;
            }

            Action <int>  updateDel = new Action <int>(LoadDataToDataGridView);
            FrmInfoTypeIn dlg       = new FrmInfoTypeIn(model, updateDel, _curPage);

            dlg.ShowDialog();
        }