Пример #1
0
 /// <summary>
 /// 获取指定学员许可信息
 /// </summary>
 public void getTraTrainLicense(string sBookSeqNo, string sPidNo)
 {
     try
     {
         TrainMangeDataSet.TraTrainLicenseDataTable.Clear();
         DBAccessHelper.getTrainLicense(int.Parse(sBookSeqNo), sPidNo, TrainMangeDataSet);
     }
     catch (Exception e)
     {
         System.Windows.MessageBox.Show("获取学员许可信息出错,错误内容:" + e.Message.ToString());
     }
 }
Пример #2
0
        /// <summary>
        /// 写入许可的方法
        /// </summary>
        /// <param name="sPidNo"></param>
        /// <param name="iSeqNo"></param>
        public void WriteTrainLicense(Dictionary <string, string> listSeq)
        {
            List <TrainLicense> m_listTraLic = new List <TrainLicense>();
            string       sJsonTraLic         = "";
            TrainLicense traLic = null;

            foreach (var item in listSeq.Keys)
            {
                dsrsrc.trainMangeDataSet.TraTrainLicenseDataTable.Clear();
                DBAccessHelper.getTrainLicense(int.Parse(listSeq[item]), "", dsrsrc.trainMangeDataSet);
                foreach (DataRow dr in dsrsrc.trainMangeDataSet.TraTrainLicenseDataTable.Rows)
                {
                    traLic = new TrainLicense();
                    traLic.TraBookSeqNo = int.Parse(dr["BookSeqNo"].ToString());
                    traLic.TimeLmt      = Double.Parse(dr["TimeLmt"].ToString());
                    traLic.TriesLmt     = int.Parse(dr["TriesLmt"].ToString());
                    traLic.MileageLmt   = Double.Parse(dr["MileageLmt"].ToString());
                    traLic.AutoId       = dr["AutoId"].ToString().Trim();
                    traLic.AutoType     = dr["AutoType"].ToString();
                    traLic.ChargeMode   = dr["ChargeMode"].ToString();

                    traLic.Date        = dr["Date"].ToString();
                    traLic.Fingerprint = "";              // dr["Fingerprint"].ToString();
                    traLic.Name        = dr["Name"].ToString();
                    traLic.Photo       = "";              // dr["Photo"].ToString();
                    traLic.PidNo       = dr["PidNo"].ToString();

                    traLic.Session     = dr["Session"].ToString();
                    traLic.Trainer     = dr["Trainer"].ToString();
                    traLic.TrainDetail = null;

                    traLic.StudentType      = int.Parse(dr["StudentType"].ToString() == "" ? "0" : dr["StudentType"].ToString());
                    traLic.MinTimeUnit      = int.Parse(dr["MinTimeUnit"].ToString());
                    traLic.ChargingStandard = double.Parse(dr["ChargingStandard"].ToString());
                    traLic.AccountBalance   = double.Parse(dr["AccountBalance"].ToString());

                    m_listTraLic.Add(traLic);
                }
            }
            sJsonTraLic = JsonConvert.SerializeObject(m_listTraLic);
            WriteLicenseWindow writeLicWin = new WriteLicenseWindow(sJsonTraLic, listSeq);

            writeLicWin.ShowDialog();
        }