Ejemplo n.º 1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        BusAllInfo info  = null;
        ArrayList  infos = SimpleOrmOperator.QueryConditionList <BusAllInfo>(" where c_idcard='" + this.txtIdCard.Text.Trim() + "' and i_state=0");

        if (infos.Count != 0)
        {
            info = infos[0] as BusAllInfo;
            this.btnQuitBus.Enabled = true;
            this.hidLsh.Value       = info.Lsh;
        }
        else
        {
            info         = DriverInterface.GetFromUser(this.cbIdCardType.SelectedValue.ToString(), this.txtIdCard.Text.Trim(), this.txtDabh1.Text + this.txtDabh2);
            hidLsh.Value = info.Lsh;
        }

        this.lbBrithday.Text   = info.Birthday;
        this.lbDabh.Text       = info.Dabh;
        this.lbIdCard.Text     = info.IdCard;
        this.lbIDCardType.Text = info.IdCardType;
        this.lbNation.Text     = info.Nation;
        this.lbSex.Text        = info.Sex;
        this.lbXm.Text         = info.Xm;
        this.lbLearnCar.Text   = info.CarType;
        this.lbCheckDay.Text   = info.CheckDate;
        //this.lbDescription.Text

        this.imgPerson.ImageUrl = "../../ShowImage.aspx?idcard=" + this.txtIdCard.Text.Trim();
    }
Ejemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.lbIdCard.Text.Trim().Length > 0)
        {
            BusAllInfo info  = null;
            ArrayList  infos = SimpleOrmOperator.QueryConditionList <BusAllInfo>(" where c_idcard='" + this.lbIdCard.Text + "' and i_state=0");
            if (infos.Count != 0)
            {
                info             = infos[0] as BusAllInfo;
                info.RegAreaCode = this.cbRegArea.SelectedValue.ToString();
                info.RegArea     = this.txtRegArea.Text.Trim();
                info.PostCode    = this.txtPostCode.Text.Trim();
                info.Phone       = this.txtPhone.Text.Trim();
                info.Height      = this.txtHeight.Text.Trim();
                info.Zsl         = this.txtZsl.Text.Trim();
                info.Ysl         = this.txtYsl.Text.Trim();
                info.Bsl         = this.cbBsl.Text;
                info.Tl          = this.cbTl.Text;
                info.Sz          = this.cbSz.Text;
                info.Zxz         = this.cbZxz.Text;
                info.Yxz         = this.cbYxz.Text;
                info.Qgjb        = this.cbQgjb.Text;
                info.CheckDate   = this.txtCheckDate.Value;
                info.Hospital    = this.txtHospital.Text;

                SimpleOrmOperator.Update(info);
                this.LogBus("进行体检信息录入", "进行" + this.lbIdCard.Text.Trim() + "的体检信息录入!");
                this.btnPrintReturn.Enabled = true;
                this.btnQuitBus.Enabled     = false;
                //this.btnPrintReturn.Enabled = true;
            }
        }
    }
Ejemplo n.º 3
0
        public static Dictionary <string, List <FpStudentObject> > QueryGroupbySchool(IDataAccess dataAccess, string busType, string startDate, string endDate)
        {
            SimpleOrmOperator.InitDataAccess(dataAccess);
            string sqlCondition = "";

            sqlCondition = "where create_time between to_date('{0}','YYYY-MM-DD') and to_date('{1}','YYYY-MM-DD') order by create_time desc";

            ArrayList students = SimpleOrmOperator.QueryConditionList <FpStudentObject>(string.Format(sqlCondition, startDate, endDate));
            Dictionary <string, List <FpStudentObject> > dictStudents = new Dictionary <string, List <FpStudentObject> >();

            foreach (FpStudentObject student in students)
            {
                if (string.IsNullOrEmpty(student.SCHOOL_CODE))
                {
                    continue;
                }
                if (!dictStudents.ContainsKey(student.SCHOOL_CODE))
                {
                    dictStudents.Add(student.SCHOOL_CODE, new List <FpStudentObject>());
                }
                dictStudents[student.SCHOOL_CODE].Add(student);
            }
            SimpleOrmOperator.InitDataAccess(null);
            return(dictStudents);
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string learncar = this.cbLearnCar.Text.Trim().ToUpper();

            if (learncar.Length == 0)
            {
                MessageBoxHelper.Show("对不起,必须输入申请的驾照型号!");
                return;
            }
            ArrayList list = SimpleOrmOperator.QueryConditionList <ExamUser>(" where c_idcard='" + DALSecurityTool.TransferInsertField(this.txtIdCard.Text.Trim()) + "'");

            if (list == null || list.Count == 0)
            {
                MessageBoxHelper.Show("对不起,不存在该学员,请咨询管理员!");
                return;
            }
            else
            {
                ExamUser   user   = list[0] as ExamUser;
                ExamPolicy policy = StaticCacheManager.GetConfig <ExamPolicy>();
                if (this.checkExam.Checked && policy.IsLimit && user.PassCount >= policy.SuccessTimes)
                {
                    MessageBoxHelper.Show("对不起,您已经合格了" + user.PassCount.ToString() + "次,无法再次进行考试!");
                    return;
                }

                // 判断是否考试合格次数超过了配置的考试合格次数限制
                ArrayList topics = this.GetRandomTopic(learncar);
                //this.Hide();
                ExamWorkStation form = new ExamWorkStation(topics, user, this.checkTrain.Checked);
                form.ShowDialog();
            }
        }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this._FP = new FpBase(this, new EventHandler(TrustLink_OperDlgPostEvent));
        if (!IsPostBack)
        {
            ArrayList listLoacaltype = SimpleOrmOperator.QueryConditionList <FpLocalType>("");
            ddlLocaltype.DataSource     = listLoacaltype;
            ddlLocaltype.DataTextField  = "NAME";
            ddlLocaltype.DataValueField = "ID";
            ddlLocaltype.DataBind();

            DepartMentOperator.Bind2(ddlSchool);
            ddlSchool.SelectedValue = "440400";

            DictOperator.BindDropDownList("车辆类型", ddlCarType);

            string strTmp = Request.Params["strTmp"];
            if (!string.IsNullOrEmpty(strTmp))
            {
                int result = wsFingerM.wsFPEnroll(strTmp);
                this.fnUINewEnrollStudentSucess(result == FpBase.SUCCESSED);
            }
        }
        ///WebTools.PlaySound("../../sound/test1.wav");
        //WebTools.PlayBackGroupSound("孙燕姿-02.追.是时候.mp3", 1);
        //Response.Write("<bgsound loop=1 src='孙燕姿-02.追.是时候.mp3' />");
        //WebTools.WriteScript("alert('hhlin');");
        //WebTools.PlaySound("孙燕姿-02.追.是时候.mp3");
        // BeepHelper.Beep(800,8000);
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DepartMentOperator.Bind2(ddlSchoolCode);
            ddlSchoolCode.Items.Insert(0, new ListItem("全部", "all"));

            DictOperator.BindDropDownList("车辆类型", ddlCarType);
            ddlCarType.Items.Insert(0, new ListItem("全部", "all"));

            ArrayList localtypes     = SimpleOrmOperator.QueryConditionList <FpLocalType>("where km3_verify_ind='Y'");
            string    localtypeArray = "";
            foreach (FpLocalType localtype in localtypes)
            {
                localtypeArray += localtype.ID;
                localtypeArray += ",";
            }

            string condition = " statue<={0} and localtype in ({1}) ";
            condition  = string.Format(condition, FpStudentObject.STATUE_TRAIN_END, localtypeArray.TrimEnd(','));
            condition += " and km3_verify !='Y' ";
            this.ProcedurePager1.TableName   = "fp_student";
            this.ProcedurePager1.FieldString = @" lsh,idcard ,name ,school_name,car_type ".Replace("\r\n", "").Replace("\t", "");
            this.ProcedurePager1.SortString  = " order by lsh asc";
            this.ProcedurePager1.RowFilter   = condition;
            //WebTools.Alert(condition);
            this.txtQueryValue.Focus();
        }
    }
Ejemplo n.º 7
0
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        string queryText  = ddlQueryType.SelectedItem.Text;
        string queryType  = ddlQueryType.SelectedValue;
        string quserValue = txtQueryValue.Text;
        string condition  = string.Format("where {0} like '%{1}'", queryType, quserValue);

        if (string.IsNullOrEmpty(quserValue))
        {
            WebTools.Alert("查询条件不能为空");
            return;
        }

        ArrayList fsos = SimpleOrmOperator.QueryConditionList <FpStudentObject>(condition);

        if (fsos.Count == 1)
        {
            FpStudentObject fso = fsos[0] as FpStudentObject;
            fnUILoadStudentRecord(fso, 0);
            ucStudentInfo.fnUILoadStudentRecord(fso);
        }
        else if (fsos.Count == 0)
        {
            WebTools.Alert(string.Format("{0}为\"{1}\" 的学员不存在", queryText, quserValue));
        }
        else if (fsos.Count > 1)
        {
            WebTools.Alert(string.Format("{0}为\"{1}\" 的学员存在多个,请使用证件号码查询", queryText, quserValue));
        }
        this.txtQueryValue.Text = string.Empty;
        this.txtQueryValue.Focus();
    }
Ejemplo n.º 8
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        string queryValue = txtQueryValue.Text;
        string queryText  = ddlQueryType.SelectedItem.Text;
        string queryType  = ddlQueryType.SelectedValue;

        ArrayList localtypes     = SimpleOrmOperator.QueryConditionList <FpLocalType>("where km3_verify_ind='Y'");
        string    localtypeArray = "";

        foreach (FpLocalType localtype in localtypes)
        {
            localtypeArray += localtype.ID;
            localtypeArray += ",";
        }
        string condition = " statue<={0} and localtype in ({1}) ";

        condition = string.Format(condition, FpStudentObject.STATUE_TRAIN_END, localtypeArray.TrimEnd(','));

        if (string.IsNullOrEmpty(queryValue))
        {
            string feeStatue = ddlFeeStatue.SelectedValue;
            string schoolId  = ddlSchoolCode.SelectedValue;
            string carType   = ddlCarType.SelectedValue;
            if (feeStatue == "Y")
            {
                condition += " and km3_verify = 'Y' ";
            }
            else
            {
                condition += " and km3_verify != 'Y' ";
            }

            if (schoolId != "all")
            {
                //DepartMent depart = SimpleOrmOperator.Query<DepartMent>(schoolId);
                //string schoolCode = depart.DepCode;
                condition += string.Format(" and school_code='{0}' ", schoolId);
            }

            if (carType != "all")
            {
                condition += string.Format(" and car_type='{0}' ", carType);
            }
        }
        else
        {
            condition += string.Format(" and {0} like '%{1}'", queryType, queryValue);
        }
        //ArrayList students = SimpleOrmOperator.QueryConditionList<FpStudentObject>(condition);

        this.ProcedurePager1.RowFilter = condition;
        //else
        //this.ProcedurePager1.RowFilter = "";
        this.ProcedurePager1.Changed = true;
        btnBatchVerify.Focus();
    }
Ejemplo n.º 9
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        BusAllInfo info  = null;
        ArrayList  infos = SimpleOrmOperator.QueryConditionList <BusAllInfo>(" where c_idcard='" + this.txtIdCard.Text.Trim() + "' and i_state=0");

        if (infos.Count != 0)
        {
            info = infos[0] as BusAllInfo;
            this.btnPrintReturn.Enabled  = true;
            this.cbRegArea.SelectedValue = info.RegAreaCode;
            this.txtRegArea.Text         = info.RegArea;
            this.txtPostCode.Text        = info.PostCode;
            this.txtPhone.Text           = info.Phone;
            this.txtHeight.Text          = info.Height;
            this.txtZsl.Text             = info.Zsl;
            this.txtYsl.Text             = info.Ysl;
            this.cbBsl.Text         = info.Bsl;
            this.cbTl.Text          = info.Tl;
            this.cbSz.Text          = info.Sz;
            this.cbZxz.Text         = info.Zxz;
            this.cbYxz.Text         = info.Yxz;
            this.cbQgjb.Text        = info.Qgjb;
            this.txtCheckDate.Value = info.CheckDate;
            this.txtHospital.Text   = info.Hospital;
            this.hidLsh.Value       = info.Lsh;
            if (this.txtRegArea.Text.Trim().Length == 0)
            {
                this.btnPrintReturn.Enabled = false;
                this.btnQuitBus.Enabled     = true;
            }
            else
            {
                this.btnPrintReturn.Enabled = true;
                this.btnQuitBus.Enabled     = false;
            }
        }
        else
        {
            WebTools.Alert(this, "请先受理该体检人!");
            return;
            // info = DriverInterface.GetFromUser(this.cbIdCardType.SelectedValue.ToString(), this.txtIdCard.Text.Trim(), this.txtDabh1.Text + this.txtDabh2);
            //this.hidLsh.Value = info.Lsh;
        }

        this.lbBrithday.Text    = info.Birthday;
        this.lbDabh.Text        = info.Dabh;
        this.lbIdCard.Text      = info.IdCard;
        this.lbIDCardType.Text  = info.IdCardType;
        this.lbNation.Text      = info.Nation;
        this.lbSex.Text         = info.Sex;
        this.lbXm.Text          = info.Xm;
        this.lbLearnCar.Text    = info.CarType;
        this.lbCheckDay.Text    = info.CheckDate;
        this.imgPerson.ImageUrl = "../../ShowImage.aspx?idcard=" + this.txtIdCard.Text.Trim();
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string bustype = StringHelper.fnFormatNullOrBlankString(Request.Params["bustype"], "");

        if (bustype == null)
        {
            return;
        }
        string    condition = string.Format("where bustype='{0}'", bustype);
        ArrayList listSite  = SimpleOrmOperator.QueryConditionList <FpSite>(condition);

        rpSite.DataSource = listSite;
        rpSite.DataBind();
    }
Ejemplo n.º 11
0
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        // string idcard = StringHelper.fnFormatNullOrBlankString(txtIDCard.Text, "");
        // if (idcard == "")
        // {
        //     WebTools.Alert("请输入要查询的身份证号码");
        //      return;
        //   }
        //  FpStudentObject fso = SimpleOrmOperator.Query<FpStudentObject>(idcard);
        //   if (fso ==null) {
        //       WebTools.Alert("查询的身份证号码不存在");
        //   }
        //   if (fso != null)
        //    {
        //        ViewState[typeof(FpStudentObject).Name] = fso;
        //        fnUILoadStudentRecord(fso, 0);
        //        ucStudentInfo.fnUILoadStudentRecord(fso);
        //     }
        string queryText  = ddlQueryType.SelectedItem.Text;
        string queryType  = ddlQueryType.SelectedValue;
        string quserValue = txtIDCard.Text;
        string condition  = string.Format("where {0} like '%{1}'", queryType, quserValue);

        if (string.IsNullOrEmpty(quserValue))
        {
            WebTools.Alert("查询条件不能为空");
            return;
        }

        ArrayList fsos = SimpleOrmOperator.QueryConditionList <FpStudentObject>(condition);

        if (fsos.Count == 1)
        {
            ViewState[typeof(FpStudentObject).Name] = fsos[0];
            FpStudentObject fso = fsos[0] as FpStudentObject;
            fnUILoadStudentRecord(fso, 0);
            ucStudentInfo.fnUILoadStudentRecord(fso);
            txtIDCard.Text = string.Empty;
        }
        else if (fsos.Count == 0)
        {
            WebTools.Alert(string.Format("{0}为\"{1}\" 的学员不存在", queryText, quserValue));
        }
        else if (fsos.Count > 1)
        {
            WebTools.Alert(string.Format("{0}为\"{1}\" 的学员存在多个,请使用证件号码查询", queryText, quserValue));
        }
    }
Ejemplo n.º 12
0
    public static WeekRecord GetByWeekNum(int num, string shortdate)
    {
        WeekRecord week  = new WeekRecord();
        ArrayList  lists = SimpleOrmOperator.QueryConditionList <WeekRecord>(" where i_week_num=" + num + " and c_week_range like '" + shortdate + "%'");

        if (lists.Count == 1)
        {
            week = lists[0] as WeekRecord;
        }
        else
        {
            week.WeekNum = num;
        }
        return(week);
        // SimpleOrmOperator.Delete<WeekRecord>(id);
    }
Ejemplo n.º 13
0
    public static Hashtable GetWeekLimits(WeekRecord week)
    {
        int weekNum = week.WeekNum;
        //String weekRang = week.WeekRange;
        //String year = weekRang.Substring(0,4);
        Hashtable dictWeekLimits = new Hashtable();
        ArrayList listWeekLimits = new ArrayList();
        string    querySql       = string.Format("where I_WEEK_NUM={0}", weekNum);

        listWeekLimits = SimpleOrmOperator.QueryConditionList <YuyueLimit>(querySql);
        foreach (YuyueLimit limit in listWeekLimits)
        {
            String key = genLimitKey(limit);
            dictWeekLimits.Add(key, limit);
        }
        return(dictWeekLimits);
    }
Ejemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ArrayList dllData = new ArrayList();
         FpSite    newStie = new FpSite();
         newStie.ID   = 0;
         newStie.NAME = "全部";
         dllData.Add(newStie);
         ArrayList listSite = SimpleOrmOperator.QueryConditionList <FpSite>("");
         dllData.AddRange(listSite);
         dllSite.DataSource     = dllData;
         dllSite.DataTextField  = "NAME";
         dllSite.DataValueField = "ID";
         dllSite.DataBind();
     }
 }
Ejemplo n.º 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         // ViewState
         DictOperator.BindDropDownList("考试地点", this.cbKsdd);
         DictOperator.BindDropDownList("考试场次", this.cbKscc);
         DepartMentOperator.BindNick(this.cbSchool, "驾校");
         this.InitTableControls();
         if (Request.Params["id"] != null)
         {
             WeekRecord entity = WeekRecordOperator.Get(Convert.ToInt32(Request.Params["id"]));
             //weekRocord = WeekRecordOperator.Get(Convert.ToInt32(Request.Params["id"]));
             this.InitWeekRecord(entity);
             string    querySql   = string.Format("where I_WEEK_NUM={0}", entity.WeekNum);
             ArrayList listLimits = SimpleOrmOperator.QueryConditionList <YuyueLimit>(querySql);
             ViewState[VIEWSTATUE_LIMITS]     = listLimits;
             ViewState[VIEWSTATUE_WEEKRECORD] = entity;
         }
     }
 }
Ejemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["bustype"] == null || Session[typeof(FpSite).Name] == null)
        {
            return;
        }

        FpSite site      = Session[typeof(FpSite).Name] as FpSite;
        string bustype   = Session["bustype"].ToString();
        string lStrToday = DateTime.Now.ToString("yyyy-MM-dd");
        string condition = string.Format(" where SITE_ID={0} and BUSTYPE='{1}' and to_char(CHECKIN_DATE,'YYYY-MM-DD') = '{2}' order by CHECKIN_DATE ASC "
                                         , site.ID
                                         , bustype
                                         , lStrToday
                                         );
        ArrayList listLogs = SimpleOrmOperator.QueryConditionList <FpCheckinLog>(condition);

        ViewState[typeof(FpCheckinLog).Name] = listLogs;
        // rpLogs.DataSource = listLogs;
        // rpLogs.DataBind();
    }
Ejemplo n.º 17
0
    private ArrayList QueryStudent(string busType, string startDate, string endDate)
    {
        string sqlCondition = "";

        if (busType == "0")
        {
            sqlCondition = "where LESSON_LEAVE_2 between to_date('{0}','YYYY-MM-DD') and to_date('{1}','YYYY-MM-DD')";
            //fileName = string.Format(fileNamePattern, startDate, endDate, "已完成上课");
        }
        else if (busType == "1")
        {
            sqlCondition = "where TRAIN_END_DATE between to_date('{0}','YYYY-MM-DD') and to_date('{1}','YYYY-MM-DD')";
            //fileName = string.Format(fileNamePattern, startDate, endDate, "已完成入场训练");
        }
        else
        {
            return(new ArrayList());
        }

        ArrayList students = SimpleOrmOperator.QueryConditionList <FpStudentObject>(string.Format(sqlCondition, startDate, endDate));

        return(students);
    }
Ejemplo n.º 18
0
        private void button3_Click(object sender, EventArgs e)
        {
            ArrayList list = SimpleOrmOperator.QueryConditionList <ExamUser>(" where c_idcard='" + DALSecurityTool.TransferInsertField(this.txtIdCard.Text.Trim()) + "'");

            if (list == null || list.Count == 0)
            {
                MessageBox.Show("对不起,不存在该学员,请咨询管理员!");
            }
            else
            {
                ExamLogSearch ctr = new ExamLogSearch();
                Form          tmp = new Form();
                tmp.WindowState   = FormWindowState.Maximized;
                tmp.ShowIcon      = false;
                tmp.Text          = "模拟考试记录列表";
                tmp.ShowInTaskbar = true;
                tmp.StartPosition = FormStartPosition.CenterScreen;
                ctr.SetUserIdCard(this.txtIdCard.Text.Trim());
                ctr.Dock = DockStyle.Fill;
                tmp.Controls.Add(ctr);
                tmp.ShowDialog();
            }
        }
Ejemplo n.º 19
0
    private void QueryStudent(string startDate, string endDate)
    {
        string schoolId = ddlSchoolCode.SelectedValue;
        string carType  = ddlCarType.SelectedValue;


        string sqlConditionFinishLesson = "where LESSON_LEAVE_2 between to_date('{0}','YYYY-MM-DD') and to_date('{1}','YYYY-MM-DD')";
        //fileName = string.Format(fileNamePattern, startDate, endDate, "已完成上课");

        string sqlConditionFinishTrain = "where TRAIN_END_DATE between to_date('{0}','YYYY-MM-DD') and to_date('{1}','YYYY-MM-DD')";

        //fileName = string.Format(fileNamePattern, startDate, endDate, "已完成入场训练");

        if (schoolId != "all")
        {
            //DepartMent depart = SimpleOrmOperator.Query<DepartMent>(schoolId);
            //string schoolCode = depart.DepCode;
            sqlConditionFinishLesson += string.Format(" and school_code='{0}' ", schoolId);
            sqlConditionFinishTrain  += string.Format(" and school_code='{0}' ", schoolId);
        }

        if (carType != "all")
        {
            sqlConditionFinishLesson += string.Format(" and car_type='{0}' ", carType);
            sqlConditionFinishTrain  += string.Format(" and car_type='{0}' ", carType);
        }

        int countFinishLesson = SimpleOrmOperator.QueryConditionList <FpStudentObject>(string.Format(sqlConditionFinishLesson, startDate, endDate)).Count;
        int countFinishTrain  = SimpleOrmOperator.QueryConditionList <FpStudentObject>(string.Format(sqlConditionFinishTrain, startDate, endDate)).Count;


        lbCountFinishLesson.Text = countFinishLesson.ToString();
        lbCountFinishTrain.Text  = countFinishTrain.ToString();

        lbStartDate.Text = startDate;
        lbEndDate.Text   = endDate;
    }
Ejemplo n.º 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this._FP = new FpBase(this, new EventHandler(TrustLink_OperDlgPostEvent));
        _FP.isSa = true;
        if (!IsPostBack)
        {
            ArrayList listLoacaltype = SimpleOrmOperator.QueryConditionList <FpLocalType>("");
            ddlLocaltype.DataSource     = listLoacaltype;
            ddlLocaltype.DataTextField  = "NAME";
            ddlLocaltype.DataValueField = "ID";
            ddlLocaltype.DataBind();

            DepartMentOperator.Bind2(ddlSchool);
            ddlSchool.SelectedValue = "440400";

            DictOperator.BindDropDownList("车辆类型", ddlCarType);
        }
        ///WebTools.PlaySound("../../sound/test1.wav");
        //WebTools.PlayBackGroupSound("孙燕姿-02.追.是时候.mp3", 1);
        //Response.Write("<bgsound loop=1 src='孙燕姿-02.追.是时候.mp3' />");
        //WebTools.WriteScript("alert('hhlin');");
        //WebTools.PlaySound("孙燕姿-02.追.是时候.mp3");
        // BeepHelper.Beep(800,8000);
    }
Ejemplo n.º 21
0
    private void exportExcel2()
    {
        Excel.Application xlApp = new Excel.ApplicationClass();

        System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp.Workbooks);
        if (xlApp == null)
        {
            WebTools.Alert("Excel无法启动");
            return;
        }
        // 创建Excel工作薄


        Dictionary <string, List <FpStudentObject> > schoolStudents = QueryStudentGroupbySchool(null, qDateStart.Value, qDateEnd.Value);

        String[] sheetTitles  = { "缺受理号", "未收费", "已收费" };
        String[] sheetColumns = { "受理号", "姓名", "身份证号码", "准驾车型", "导入时间" };

        String dir = MapPath(string.Format("~/temp/{0}/", Session.SessionID));

        Directory.CreateDirectory(dir);
        String excelName = string.Format("指纹记录[{0}][{1}].xls", this.qDateStart.Value, this.qDateEnd.Value);
        String excelPath = dir + excelName;

        if (File.Exists(excelPath))
        {
            File.Delete(excelPath);
        }
        xlApp.SheetsInNewWorkbook = schoolStudents.Keys.Count;
        xlApp.Workbooks.Add(Missing.Value);
        Excel.Workbook xlBook = xlApp.ActiveWorkbook;
        System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBook.Worksheets);

        int sheetIndex = 0;

        //  try
        // {

        //xlBook.Worksheets.Add(Missing.Value, Missing.Value, schoolStudents.Keys.Count - 1, Missing.Value);
        //}
        // catch (Exception ex) {
        //     WebTools.Alert(ex.Message);
        //     return;
        //  }
        foreach (string schoolCode in schoolStudents.Keys)
        {
            WebTools.Alert(schoolCode);
            sheetIndex++;
            List <FpStudentObject> students = schoolStudents[schoolCode];
            string    schoolName            = schoolCode;
            ArrayList deps = SimpleOrmOperator.QueryConditionList <DepartMent>(string.Format("where c_depcode='{0}'", schoolCode));
            if (deps.Count > 0)
            {
                schoolName = (deps[0] as DepartMent).DepNickName;
            }

            int rowIndex = 1;
            foreach (FpStudentObject student in students)
            {
                int    color  = 0;
                string result = "";
                if (string.IsNullOrEmpty(student.LSH))
                {
                    color  = 3;
                    result = "缺流水号";
                }
                else if (student.FEE_STATUE != "Y")
                {
                    color  = 6;
                    result = "收费审核未通过";
                }
                else
                {
                    result = "考勤进行中";
                }


                Excel.Worksheet xlSheet = (Excel.Worksheet)xlBook.Worksheets[sheetIndex];
                xlSheet.Name = string.Format("{0}({1})", schoolName, schoolStudents[schoolCode].Count);
                int colIndex = 1;

                Excel.Range rang = (Excel.Range)xlSheet.Cells[rowIndex, colIndex++];
                //rang.Select();
                rang.NumberFormatLocal   = "@";
                rang.ColumnWidth         = 20;
                rang.Interior.ColorIndex = color;
                rang.Formula             = student.LSH;
                rang = (Excel.Range)xlSheet.Cells[rowIndex, colIndex++];
                //rang.Select();
                rang.NumberFormatLocal = "@";
                rang.ColumnWidth       = 15;
                rang.Formula           = student.NAME;
                rang = (Excel.Range)xlSheet.Cells[rowIndex, colIndex++];
                //rang.Select();
                rang.NumberFormatLocal = "@";
                rang.ColumnWidth       = 25;
                rang.Formula           = student.IDCARD;
                rang         = (Excel.Range)xlSheet.Cells[rowIndex, colIndex++];
                rang.Formula = student.CAR_TYPE;
                rang         = (Excel.Range)xlSheet.Cells[rowIndex, colIndex++];
                //rang.Select();
                rang.ColumnWidth = 15;
                rang.Value2      = student.CREATE_TIME.ToLongDateString();
                rang             = (Excel.Range)xlSheet.Cells[rowIndex, colIndex++];
                //rang.Select();
                rang.ColumnWidth = 30;
                rang.Value2      = result;
                rowIndex++;
            }
        }
        try{
            xlBook.Save();
            xlBook.Saved = true;

            xlBook.SaveCopyAs(excelPath);
            WebTools.Alert("保存成功");
        }
        finally
        {
            xlBook.Close(true, Missing.Value, Missing.Value);
            //System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBook.Worksheets);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBook);
        }
        xlApp.Workbooks.Close();
        xlApp.Quit();
        System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp.Workbooks);
        System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp);

        Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(excelName, Encoding.UTF8));
        Response.WriteFile(excelPath);
        Response.End();
        Response.Close();
    }
Ejemplo n.º 22
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (this.txtDate.Value.Trim().Length == 0)
        {
            WebTools.Alert(this, "必须输入培训审核日期!");
            return;
        }

        string idcard = this.txtIdCard.Text.Trim();

        if (idcard.Length == 15)
        {
            idcard = FT.Commons.Tools.IDCardHelper.IdCard15To18(idcard);
        }
        else if (idcard.Length == 18)
        {
            string tmpstr = FT.Commons.Tools.IDCardHelper.Validate(idcard);
            if (tmpstr.Length > 0)
            {
                WebTools.Alert(this, tmpstr);
                return;
            }
        }
        int      km   = int.Parse(this.cbKm.SelectedValue);
        string   glbm = this.Operator.Desp2;
        DateTime yyrq = Convert.ToDateTime(this.txtDate.Value);
        DateTime now  = System.DateTime.Now;
        // if (dt != null)
        // {
        string tmpid = "";

        tmpid = this.DataGrid1.Items[this.DataGrid1.Items.Count - 1].Cells[2].Text;
        if (tmpid != null && tmpid.Replace("&nbsp;", "").Length > 0)
        {
            WebTools.Alert(this, tmpid + "本期允许约考人员已经约考完毕!");
            return;
        }
        for (int i = 0; i < this.DataGrid1.Items.Count; i++)
        {
            tmpid = this.DataGrid1.Items[i].Cells[2].Text;

            if (tmpid != null && tmpid == idcard)
            {
                ///TODO:
                WebTools.Alert(this, "身份证明号码" + idcard + "该学员已经在本期约考过!");
                return;
            }
        }
        //}
        int  bkjg         = int.Parse(ConfigurationManager.AppSettings["DrvHelperSystem_bkjg"].ToString());
        bool boolAfterDay = bool.Parse(ConfigurationManager.AppSettings["Drv_Yuyue_After_Days_Boolean"].ToString());
        int  afterDay     = int.Parse(ConfigurationManager.AppSettings["Drv_Yuyue_After_Days"].ToString());

        if (boolAfterDay)
        {
            if (now.AddDays(afterDay).CompareTo(yyrq) < 0)
            {
                WebTools.Alert(this, "只能预约" + afterDay + "天之后的排班!");
                return;
            }
        }
        ArrayList list = SimpleOrmOperator.QueryConditionList <YuyueInfo>(" where i_checked<>2 and i_km=" + km + " and c_idcard='" + idcard + "'");

        if (list != null && list.Count > 0 && km == 1)
        {
            WebTools.Alert(this, "科目一预约只能在本系统预约一次,补考预约请到业务大厅!");
            return;
        }
        if (km > 1 && list != null)
        {
            if (list.Count == 2)
            {
                WebTools.Alert(this, "科目二、三预约只能在本系统预约二次,补考预约请到业务大厅!");
                return;
            }
            if (list.Count == 1)
            {
                YuyueInfo yytmp = list[0] as YuyueInfo;
                if (yytmp.Checked == 0)
                {
                    WebTools.Alert(this, "科目二、三预约身份证明号码" + idcard + "已经预约过考试日期为:" + yytmp.Ksrq + ",处于待审核中!");
                    return;
                }
            }
        }

        // ArrayList cars = SimpleOrmOperator.QueryConditionList<SchoolCarInfo>(" where hmhp='"+this.cbCarNo.SelectedItem.Text+"'");
        string jly  = this.cbCarNo.SelectedItem.Value == null?"":this.cbCarNo.SelectedItem.Value.ToString();
        string sql1 = "update table_yuyue_limit t set t.i_used_num=(select count(*) from table_yuyue_info m where m.i_checked<>2 and m.i_paibanid=" + this.hidPaiBanId.Value + ") where t.id=" + this.hidPaiBanId.Value;

        DataAccessFactory.GetDataAccess().ExecuteSql(sql1);
        string    sql    = "update table_yuyue_limit set i_used_num=i_used_num+1  where i_used_num<i_total and id=" + this.hidPaiBanId.Value;
        bool      result = DataAccessFactory.GetDataAccess().ExecuteSql(sql);
        YuyueInfo info;

        if (result)
        {
            info           = new YuyueInfo();
            info.Checked   = 0;
            info.Dlr       = this.Operator.Desp4;
            info.DlrCode   = this.Operator.Desp3;
            info.Hmhp      = this.txtHphm.Text.Trim().Length == 0?this.cbCarNo.SelectedItem.Text:this.txtHphm.Text.Trim();
            info.IdCard    = this.txtIdCard.Text.Trim();
            info.JlyIdCard = jly;

            info.Km       = km;
            info.Kscc     = this.cbKscc.SelectedItem.Text;
            info.KsccCode = this.cbKscc.SelectedItem.Value;
            info.Ksdd     = this.cbKsdd.SelectedItem.Text;
            info.KsddCode = this.cbKsdd.SelectedItem.Value;
            info.Ksrq     = this.lbYkrq.Text.Trim();

            info.PaibanId = int.Parse(this.hidPaiBanId.Value);
            info.Pxshrq   = this.txtDate.Value;

            SimpleOrmOperator.Create(info);
            WebTools.Alert(this, "预约成功!");
            this.ReBind();
            return;
        }
        else
        {
            sql = "update table_yuyue_limit set i_tpused_num=i_tpused_num+1  where i_tpused_num<i_tptotal and id=" + this.hidPaiBanId.Value;

            result = DataAccessFactory.GetDataAccess().ExecuteSql(sql);
            if (result)
            {
                info           = new YuyueInfo();
                info.Checked   = 0;
                info.Dlr       = this.Operator.Desp4;
                info.DlrCode   = this.Operator.Desp3;
                info.Hmhp      = this.txtHphm.Text.Trim().Length == 0 ? this.cbCarNo.SelectedItem.Text : this.txtHphm.Text.Trim();
                info.IdCard    = this.txtIdCard.Text.Trim();
                info.JlyIdCard = jly;
                info.Km        = km;
                info.Kscc      = this.cbKscc.SelectedItem.Text;
                info.KsccCode  = this.cbKscc.SelectedItem.Value;
                info.Ksdd      = this.cbKsdd.SelectedItem.Text;
                info.KsddCode  = this.cbKsdd.SelectedItem.Value;
                info.Ksrq      = this.lbYkrq.Text.Trim();
                info.PaibanId  = int.Parse(this.hidPaiBanId.Value);
                info.Pxshrq    = this.txtDate.Value;

                SimpleOrmOperator.Create(info);
                WebTools.Alert(this, "预约成功!");
                this.ReBind();
                return;
            }
        }
        WebTools.Alert(this, "预约已满人!");
        return;
    }
Ejemplo n.º 23
0
    public static void Check(int id, string name)
    {
        try
        {
            // throw new Exception("测试异常");
            YuyueInfo info   = SimpleOrmOperator.Query <YuyueInfo>(id);
            string    glbm   = System.Configuration.ConfigurationManager.AppSettings["DrvHelperSystem_glbm"];
            int       bkjg   = int.Parse(ConfigurationManager.AppSettings["DrvHelperSystem_bkjg"].ToString());
            string    idcard = info.IdCard;
            DateTime  yyrq   = Convert.ToDateTime(info.Ksrq);
            int       km     = info.Km;

            /*
             * TempStudentInfo student = DrvQueryHelper.QueryStudent(glbm, info.IdCard);
             * if (student == null)
             * {
             *  SaveInfoCheckFail(info, name, "该学员不是本地车管所报名的!");
             *  return;
             * }
             * info.Dlr = student.jxmc;
             * info.DlrCode = student.jxdm;
             * info.JlyIdCard = student.jly;
             * info.Km = km;
             * info.Lsh = student.lsh;
             * info.Xm = student.name;
             * info.Zjcx = student.zkcx;
             * /*
             * try
             * {
             *  if (DateTime.Parse(student.yxqz).CompareTo(yyrq) < 0)
             *  {
             *      SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "的准考证明有效期到" + student.yxqz + "截止!");
             *      return;
             *
             *  }
             * }
             * catch (System.Exception e)
             * {
             *
             * }
             *
             *
             * if (student.jxdm != null && student.jxdm != info.DlrCode)
             * {
             *  SaveInfoCheckFail(info, name, "驾校学员只能通过相关驾校帮您预约!");
             *  return;
             *
             * }
             * */


            //ArrayList daylimits = SimpleOrmOperator.QueryConditionList<YuyueDayLimit>(" where c_cartype like '%" + student.zkcx + "%' and i_km=" + km);
            ArrayList     daylimits = SimpleOrmOperator.QueryConditionList <YuyueDayLimit>(" where c_cartype like '%" + "C1" + "%' and i_km=" + km);
            TempKscjInfo  kscj      = DrvQueryHelper.QueryKscj(glbm, idcard);
            YuyueDayLimit daylimit  = null;
            if (daylimits != null && daylimits.Count > 0)
            {
                daylimit = daylimits[0] as YuyueDayLimit;
            }
            if (kscj != null)
            {
                if (km == 1)
                {
                    if (kscj.km1 == 1)
                    {
                        SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "的科目一已经合格!");
                        return;
                    }
                }
                else if (km == 2)
                {
                    if (kscj.km2yyrq != null)
                    {
                        if (kscj.km2 == 1)
                        {
                            SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "的科目二已经合格!");
                            return;
                        }
                        if (kscj.km2 == 2)
                        {
                            if (yyrq.CompareTo(DateTime.Parse(kscj.km2yyrq).AddDays(bkjg)) < 0)
                            {
                                SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "上次考试时间为:" + kscj.km2yyrq + ",科目二补考必须在上一次考试" + bkjg + "天之后!");
                                return;
                            }
                        }
                    }
                    else if (kscj.km1 == 1 && daylimit != null)
                    {
                        if (yyrq.CompareTo(DateTime.Parse(kscj.km1yyrq).AddDays(daylimit.Days)) < 0)
                        {
                            SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "科目一考试时间为:" + kscj.km1yyrq + ",申请" + daylimit.CarType + "牌照的科目二考试必须在" + daylimit.Days + "天之后!");
                            return;
                        }
                    }
                    else
                    {
                        SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "科目一还没有合格!");
                        return;
                    }
                }

                else if (km == 3)
                {
                    if (kscj.km3yyrq != null)
                    {
                        if (kscj.km3 == 1)
                        {
                            SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "的科目三已经合格!");
                            return;
                        }
                        if (kscj.km3 == 2)
                        {
                            if (yyrq.CompareTo(DateTime.Parse(kscj.km3yyrq).AddDays(bkjg)) < 0)
                            {
                                SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "上次考试时间为:" + kscj.km2yyrq + ",科目三补考必须在上一次考试" + bkjg + "天之后!");
                                return;
                            }
                        }
                    }
                    else if (kscj.km2 == 1 && daylimit != null)
                    {
                        if (yyrq.CompareTo(DateTime.Parse(kscj.km1yyrq).AddDays(daylimit.Days)) < 0)
                        {
                            SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "科目一考试时间为:" + kscj.km1yyrq + ",申请" + daylimit.CarType + "牌照的科目三考试必须在" + daylimit.Days + "天之后!");
                            return;
                        }
                    }
                    else
                    {
                        SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "科目二还没有合格!");
                        return;
                    }
                }
            }

            //&& info.Checked == 0
            if (info != null)
            {
                info.CheckOperator = name;
                info.Jbr           = name;
                TmriResponse resp = null;
                try
                {
                    string useold = System.Configuration.ConfigurationManager.AppSettings["Drv_Yuyue_Use_Old"];
                    if (useold == "true")
                    {
                        resp = new TmriResponse();
                        bool resultold = DriverInterface.WritePreasignOld(ConvertInfoToRequest(info));
                        // resultold ? 0 : 2;
                        if (resultold)
                        {
                            resp.Code    = 0;
                            resp.Message = "更新成功";
                        }
                        else
                        {
                            resp.Code    = 2;
                            resp.Message = "更新不成功";
                        }
                    }
                    else
                    {
                        resp = DriverInterface.WriteDrvBaseTmriRequest(ConvertInfoToRequest(info));
                    }
                    //resp= DriverInterface.yuyueInfo(info);
                }
                catch (Exception exe)
                {
                    SaveInfoCheckFail(info, name, exe.Message);
                    //info.CheckResult = exe.Message;
                    // SimpleOrmOperator.Update(info);
                    return;
                }
                if (resp.Code == 0 || resp.Code == 1)
                {
                    info.Checked     = 1;
                    info.CheckResult = resp.Message;
                    SimpleOrmOperator.Update(info);
                    if (!DataAccessFactory.GetDataAccess().ExecuteSql("update table_yuyue_limit set i_checked_num=i_checked_num+1 where i_checked_num<i_used_num and id=" + info.PaibanId))
                    {
                        DataAccessFactory.GetDataAccess().ExecuteSql("update table_yuyue_limit set i_tpchecked_num=i_tpchecked_num+1 where i_tpchecked_num<i_tpused_num and id=" + info.PaibanId);
                    }
                }
                else
                {
                    SaveInfoCheckFail(info, name, resp.Message);
                    //info.Checked = 2;
                    //info.CheckResult = resp.Message;
                    // SimpleOrmOperator.Update(info);
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Ejemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ArrayList sites = SimpleOrmOperator.QueryConditionList <FpSite>("");

        ViewState[typeof(FpSite).Name] = sites;
    }
Ejemplo n.º 25
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string idcard = this.txtIdCard.Text.Trim();

        if (idcard.Length == 15)
        {
            idcard = FT.Commons.Tools.IDCardHelper.IdCard15To18(idcard);
        }
        else if (idcard.Length == 18)
        {
            string tmpstr = FT.Commons.Tools.IDCardHelper.Validate(idcard);
            if (tmpstr.Length > 0)
            {
                WebTools.Alert(this, tmpstr);
                return;
            }
        }
        int      km   = int.Parse(this.cbKm.SelectedValue);
        string   glbm = System.Configuration.ConfigurationManager.AppSettings["DrvHelperSystem_glbm"];
        DateTime yyrq = Convert.ToDateTime(lbYkrq.Text);
        DateTime now  = System.DateTime.Now;

        int  bkjg         = int.Parse(ConfigurationManager.AppSettings["DrvHelperSystem_bkjg"].ToString());
        bool boolAfterDay = bool.Parse(ConfigurationManager.AppSettings["Drv_Yuyue_After_Days_Boolean"].ToString());
        int  afterDay     = int.Parse(ConfigurationManager.AppSettings["Drv_Yuyue_After_Days"].ToString());

        if (boolAfterDay)
        {
            if (now.AddDays(afterDay).CompareTo(yyrq) < 0)
            {
                WebTools.Alert(this, "只能预约" + afterDay + "天之后的排班!");
                return;
            }
        }
        ArrayList list = SimpleOrmOperator.QueryConditionList <YuyueInfo>(" where i_km=" + km + " and c_idcard='" + idcard + "'");

        if (list != null && list.Count > 0 && km == 1)
        {
            WebTools.Alert(this, "科目一预约只能在本系统预约一次,补考预约请到业务大厅!");
            return;
        }
        if (km > 1 && list != null)
        {
            if (list.Count == 2)
            {
                WebTools.Alert(this, "科目二、三预约只能在本系统预约二次,补考预约请到业务大厅!");
                return;
            }
            if (list.Count == 1)
            {
                YuyueInfo yytmp = list[0] as YuyueInfo;
                if (yytmp.Checked == 0)
                {
                    WebTools.Alert(this, "科目二、三预约身份证明号码" + idcard + "已经预约过考试日期为:" + yytmp.Ksrq + ",处于待审核中!");
                    return;
                }
            }
        }

        // ArrayList cars = SimpleOrmOperator.QueryConditionList<SchoolCarInfo>(" where hmhp='"+this.cbCarNo.SelectedItem.Text+"'");
        string    jly    = "";
        string    sql    = "update table_yuyue_limit set i_used_num=i_used_num+1  where i_used_num<i_total and id=" + this.hidPaiBanId.Value;
        bool      result = DataAccessFactory.GetDataAccess().ExecuteSql(sql);
        YuyueInfo info;

        if (result)
        {
            info         = new YuyueInfo();
            info.Checked = 0;

            info.Hmhp   = this.txtCarNo.Text.Trim();
            info.IdCard = this.txtIdCard.Text.Trim();

            info.Km       = km;
            info.Kscc     = this.cbKscc.SelectedItem.Text;
            info.KsccCode = this.cbKscc.SelectedItem.Value;
            info.Ksdd     = this.cbKsdd.SelectedItem.Text;
            info.KsddCode = this.cbKsdd.SelectedItem.Value;
            info.Ksrq     = this.lbYkrq.Text.Trim();

            info.PaibanId = int.Parse(this.hidPaiBanId.Value);
            info.Pxshrq   = "";

            SimpleOrmOperator.Create(info);
            WebTools.Alert(this, "预约成功!");
            return;
        }
        else
        {
            sql = "update table_yuyue_limit set i_tpused_num=i_tpused_num+1  where i_tpused_num<i_tptotal and id=" + this.hidPaiBanId.Value;

            result = DataAccessFactory.GetDataAccess().ExecuteSql(sql);
            if (result)
            {
                info         = new YuyueInfo();
                info.Checked = 0;

                info.Hmhp     = this.txtCarNo.Text.Trim();
                info.IdCard   = this.txtIdCard.Text.Trim();
                info.DlrCode  = "social";
                info.Km       = km;
                info.Kscc     = this.cbKscc.SelectedItem.Text;
                info.KsccCode = this.cbKscc.SelectedItem.Value;
                info.Ksdd     = this.cbKsdd.SelectedItem.Text;
                info.KsddCode = this.cbKsdd.SelectedItem.Value;
                info.Ksrq     = this.lbYkrq.Text.Trim();

                info.PaibanId = int.Parse(this.hidPaiBanId.Value);
                info.Pxshrq   = "";

                SimpleOrmOperator.Create(info);
                WebTools.Alert(this, "预约成功!");
                return;
            }
        }
        WebTools.Alert(this, "预约已满人!");
        return;
    }
Ejemplo n.º 26
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        /*
         *
         * info = new YuyueInfo();
         *  info.Checked = 0;
         *  info.Dlr = this.Operator.Desp4;
         *  info.DlrCode = this.Operator.Desp3;
         *  info.Hmhp = this.cbCarNo.SelectedItem.Text;
         *  info.IdCard = this.txtIdCard.Text.Trim();
         *  info.JlyIdCard = jly;
         *
         *  info.Km = km;
         *  info.Kscc = this.cbKscc.SelectedItem.Text;
         *  info.KsccCode = this.cbKscc.SelectedItem.Value;
         *  info.Ksdd = this.cbKsdd.SelectedItem.Text;
         *  info.KsddCode = this.cbKsdd.SelectedItem.Value;
         *  info.Ksrq = this.lbYkrq.Text.Trim();
         *
         *  info.PaibanId = int.Parse(this.hidPaiBanId.Value);
         *  info.Pxshrq = this.txtDate.Value;
         *
         *  SimpleOrmOperator.Create(info);
         *  WebTools.Alert(this, "预约成功!");
         *
         * YuyueInfoOperator.Check(id,this.Operator.OperatorName);
         *
         */

        YuyueInfo info = new YuyueInfo();

        info.Checked   = 0;
        info.Dlr       = this.cbSchool.SelectedItem.Text;
        info.DlrCode   = this.cbSchool.SelectedItem.Value;
        info.Hmhp      = this.cbCarNo.SelectedItem.Text;
        info.IdCard    = this.txtIdCard.Text.Trim();
        info.JlyIdCard = this.cbCarNo.SelectedItem.Value;

        info.Km       = int.Parse(this.cbKm.SelectedItem.Value);
        info.Kscc     = this.cbKscc.SelectedItem.Text;
        info.KsccCode = this.cbKscc.SelectedItem.Value;
        info.Ksdd     = this.cbKsdd.SelectedItem.Text;
        info.KsddCode = this.cbKsdd.SelectedItem.Value;
        info.Ksrq     = this.txtYkrq.Value.Trim();

        info.PaibanId = int.Parse(this.hidPaiBanId.Value);
        info.Pxshrq   = this.txtDate.Value;
        DataTable dttmp = FT.WebServiceInterface.DrvQuery.ZhZwQueryHelper.GetDataTable(info.IdCard);

        if (info.Km == 1)
        {
            if (dttmp == null || dttmp.Rows.Count == 0 || dttmp.Rows[0]["lesson_result"].ToString() == "未完成")
            {
                WebTools.Alert(this, "该用户没有完成足够的学时,无法进行科目一预约!");
                return;
            }
        }
        else if (info.Km == 3)
        {
            if (dttmp == null || dttmp.Rows.Count == 0 || dttmp.Rows[0]["train_result"].ToString() == "未完成")
            {
                WebTools.Alert(this, "该用户没有完成足够的入场训练,无法进行科目三预约!");
                return;
            }
        }

        SimpleOrmOperator.Create(info);
        ArrayList list = SimpleOrmOperator.QueryConditionList <YuyueInfo>(" where c_idcard='" + info.IdCard + "' order by id desc");

        if (list.Count != 0)
        {
            YuyueInfo tmp = list[0] as YuyueInfo;
            YuyueInfoOperator.Check(tmp.Id, this.Operator.OperatorName);
            this.btnSearch_Click(null, null);
        }
    }