protected void btnSave_Click(object sender, EventArgs e) { SystemConfigEntity entity = new SystemConfigEntity(); entity.Id = 1; WebFormHelper.GetDataFromForm(this, entity); if (entity.Id < 0) { if (SimpleOrmOperator.Create(entity)) { this.lbMsg.Text = "(保存系统配置成功!)"; } else { this.lbMsg.Text = "(保存系统配置失败!)"; } } else { if (SimpleOrmOperator.Update(entity)) { this.lbMsg.Text = "(保存系统配置成功!)"; } else { this.lbMsg.Text = "(保存系统配置失败!)"; } } }
protected void btnSure_Click(object sender, EventArgs e) { ProductObject dep = new ProductObject(); WebFormHelper.GetDataFromForm(this, dep); if (dep.Id < 0) { dep.Content = System.Web.HttpContext.Current.Server.HtmlEncode(dep.Content); if (SimpleOrmOperator.Create(dep)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(dep)) { WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
public static void CreateOrUpdate(DepartmentInfo dep) { if (dep.Id < 0) { if (SimpleOrmOperator.Create(dep)) { LogInfoOperator.LogSystem("添加车管所部门", "添加车管所部门" + dep.DepFullName); WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(dep)) { LogInfoOperator.LogSystem("修改车管所部门", "修改车管所部门" + dep.DepFullName); WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
protected void btnSure_Click(object sender, EventArgs e) { SchoolCarInfo entity = new SchoolCarInfo(); WebFormHelper.GetDataFromForm(this, entity); entity.DepName = this.cbDepCodeValue.SelectedItem.Text; if (entity.Id < 0) { if (SimpleOrmOperator.Create(entity)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(entity)) { WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
protected void btnCommit_Click(object sender, EventArgs e) { FpLocalType localtype = new FpLocalType(); localtype.ID = StringHelper.fnFormatNullOrBlankInt(this.lbId.Text, -1); localtype.NAME = txtLocalTypeName.Text; localtype.DESCP = txtLocalTypeDescp.Text; localtype.TRAIN_TIMES = StringHelper.fnFormatNullOrBlankInt(txtTrainTimes.Text, 8); localtype.KM3_VERIFY_IND = cbKm3VerifyInd.Checked ? "Y" : "N"; localtype.KM1_IND = cbKm1Ind.Checked ? "Y" : "N"; localtype.KM2_3IN9_IND = cbKm2_3in9Ind.Checked ? "Y" : "N"; localtype.KM2_IND = cbKm2Ind.Checked ? "Y" : "N"; localtype.KM3_IND = cbKm3Ind.Checked ? "Y" : "N"; localtype.LESSON_IND = cbLessonInd.Checked ? "Y" : "N"; if (SimpleOrmOperator.Update(localtype)) { WebTools.Alert("修改成功!"); } else if (SimpleOrmOperator.Create(localtype)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("保存失败!"); } FPSystemBiz.DictFpLocalTypes.Clear(); }
protected void btnSure_Click(object sender, EventArgs e) { if (this.cbCityCodeValue.SelectedIndex == 0) { return; } TrafficLimitInfoEntity entity = new TrafficLimitInfoEntity(); WebFormHelper.GetDataFromForm(this, entity); // entity.MachineMac = FT.Commons.Web.Tools.WebToolsHelper.GetMac(entity.MachineIp); //entity.StartDate = Convert.ToDateTime(this.txtBeginDate.Value.ToString()); // entity.EndDate = Convert.ToDateTime(this.txtEndDate.Value.ToString()); if (entity.Id < 0) { if (SimpleOrmOperator.Create(entity)) { WebTools.Alert(this, "添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(entity)) { WebTools.Alert(this, "修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
public static void CreateOrUpdate(RoleInfo model) { if (model.Id < 0) { if (SimpleOrmOperator.Create(model)) { LogInfoOperator.LogSystem("添加角色", "添加角色" + model.RoleName); WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(model)) { LogInfoOperator.LogSystem("修改角色", "修改角色" + model.RoleName); WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
public static void Create(WeekRecord week) { SimpleOrmOperator.Create(week); string datestr = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至')); DateTime begin = DateTimeHelper.GetMonday(DateTime.Parse(datestr)); YuyueLimitOperator.Save(week, 1, 1, datestr, week.Week1km1fp); YuyueLimitOperator.Save(week, 1, 2, datestr, week.Week1km2fp); YuyueLimitOperator.Save(week, 1, 3, datestr, week.Week1km3fp); YuyueLimitOperator.Save(week, 2, 1, datestr, week.Week2km1fp); YuyueLimitOperator.Save(week, 2, 2, datestr, week.Week2km2fp); YuyueLimitOperator.Save(week, 2, 3, datestr, week.Week2km3fp); YuyueLimitOperator.Save(week, 3, 1, datestr, week.Week3km1fp); YuyueLimitOperator.Save(week, 3, 2, datestr, week.Week3km2fp); YuyueLimitOperator.Save(week, 3, 3, datestr, week.Week3km3fp); YuyueLimitOperator.Save(week, 4, 1, datestr, week.Week4km1fp); YuyueLimitOperator.Save(week, 4, 2, datestr, week.Week4km2fp); YuyueLimitOperator.Save(week, 4, 3, datestr, week.Week4km3fp); YuyueLimitOperator.Save(week, 5, 1, datestr, week.Week5km1fp); YuyueLimitOperator.Save(week, 5, 2, datestr, week.Week5km2fp); YuyueLimitOperator.Save(week, 5, 3, datestr, week.Week5km3fp); YuyueLimitOperator.Save(week, 6, 1, datestr, week.Week6km1fp); YuyueLimitOperator.Save(week, 6, 2, datestr, week.Week6km2fp); YuyueLimitOperator.Save(week, 6, 3, datestr, week.Week6km3fp); YuyueLimitOperator.Save(week, 7, 1, datestr, week.Week7km1fp); YuyueLimitOperator.Save(week, 7, 2, datestr, week.Week7km2fp); YuyueLimitOperator.Save(week, 7, 3, datestr, week.Week7km3fp); }
protected void btnSure_Click(object sender, EventArgs e) { RoleObject dep = new RoleObject(); WebFormHelper.GetDataFromForm(this, dep); dep.RoleString = this.GetRightString(); if (dep.Id < 0) { if (SimpleOrmOperator.Create(dep)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(dep)) { WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } WebTools.CloseSelf(this); }
protected void DataGrid1_ItemCommand1(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Clear") { string idcard = e.CommandArgument.ToString(); //ZwTpOperator.Delete(id); FpStudentObject fso = SimpleOrmOperator.Query <FpStudentObject>(idcard); fso.KM3_VERIFY = "Y"; // fso.FEE_VERIFY_DATE = DateTime.Now; //string idcard = fso.IDCARD.Trim('\''); fso.IDCARD = "'" + idcard + "'"; if (SimpleOrmOperator.Delete(fso)) { //fso.IDCARD = fso.IDCARD.Trim('\''); _FP.FpDeleteUser(idcard); if (fso.STATUE >= FpStudentObject.STATUE_KM3_ENTER) { fso.IDCARD = idcard; FpStudentCleared cleared = new FpStudentCleared(fso); SimpleOrmOperator.Create(cleared); } WebTools.Alert(this, string.Format("{0}:{1} 学员记录删除成功!", fso.LSH, fso.NAME)); } else { WebTools.Alert(this, string.Format("{0}:{1} 学员记录删除失败!", fso.LSH, fso.NAME)); } this.ProcedurePager1.Changed = true; } }
protected void btnSure_Click(object sender, EventArgs e) { DictType entity = new DictType(); WebFormHelper.GetDataFromForm(this, entity); if (entity.Id < 0) { if (SimpleOrmOperator.Create(entity)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(entity)) { WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
protected void btnSure_Click(object sender, EventArgs e) { TerminalEntity entity = new TerminalEntity(); WebFormHelper.GetDataFromForm(this, entity); // entity.MachineMac = FT.Commons.Web.Tools.WebToolsHelper.GetMac(entity.MachineIp); //entity.StartDate = Convert.ToDateTime(this.txtBeginDate.Value.ToString()); // entity.EndDate = Convert.ToDateTime(this.txtEndDate.Value.ToString()); if (entity.Id < 0) { if (SimpleOrmOperator.Create(entity)) { TerminalOnlineMonitorThread.InitTerminalList(); WebTools.Alert(this, "添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(entity)) { TerminalOnlineMonitorThread.InitTerminalList(); WebTools.Alert(this, "修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
protected void btnSure_Click(object sender, EventArgs e) { DepartMent dep = new DepartMent(); WebFormHelper.GetDataFromForm(this, dep); if (dep.Id < 0) { if (SimpleOrmOperator.Create(dep)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(dep)) { WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
public static void CreateOrUpdate(UserInfo model) { if (model.Id < 0) { model.Password = SecurityFactory.GetSecurity().Encrypt(ConfigurationManager.AppSettings["DefaultPassword"].ToString()); if (SimpleOrmOperator.Create(model)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(model)) { WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
private void button1_Click(object sender, EventArgs e) { TestUsers user = this.MockUsers(); SimpleOrmOperator.Create(user); //this.ClearAdd(); //this.LoadData(user); //this.Save(); }
protected void btnSure_Click(object sender, EventArgs e) { int depId = this.Operator.DeptId; DepartMent dep = SimpleOrmOperator.Query <DepartMent>(depId); DrvAuthObject auth = SimpleOrmOperator.Query <DrvAuthObject>(dep.DepCode); if (auth == null || auth.YLR_IND != 1) { WebTools.Alert("未获得授权不能使用预录入功能!"); return; } StudentApplyInfo entity = new StudentApplyInfo(); WebFormHelper.GetDataFromForm(this, entity); entity.Csrq = this.txtCsrq.Value.Trim(); entity.Tjrq = this.txtTjrq.Value.Trim(); //借用一下这个字段 entity.PhotoSrc = this.cbBustype.SelectedValue; if (!string.IsNullOrEmpty(Request.Params["cbDjzsxzqhValue"])) { entity.Djzsxzqh = Request.Params["cbDjzsxzqhValue"]; } entity.CheckDate = DateTime.Now.ToString("yyyy-MM-dd"); // entity.DepName = this.cbDepCodeValue.SelectedItem.Text; if (entity.Id < 0) { entity.Jxdm = this.Operator.Desp3; entity.Jxmc = this.Operator.Desp4; if (SimpleOrmOperator.Create(entity)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(entity)) { WebTools.Alert("修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
public static void Create(WeekRecord week, ArrayList limits) { SimpleOrmOperator.Create(week); string datestr = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至')); DateTime begin = DateTimeHelper.GetMonday(DateTime.Parse(datestr)); foreach (object obj in limits) { YuyueLimit limit = obj as YuyueLimit; YuyueLimitOperator.Save(week, limit, begin); } }
//添加或修改一条学员记录 public static Boolean fnAddOrUpdateStudentRecord(FpStudentObject fso) { string idCard = StringHelper.fnFormatNullOrBlankString(fso.IDCARD, ""); fso.NAME = StringHelper.fnFormatNullOrBlankString(fso.NAME, ""); if (SimpleOrmOperator.Create(fso) || FPSystemBiz.fnStundentUdpate(fso)) { return(true); } else { return(false); } }
protected void btnSave_Click(object sender, EventArgs e) { PersonInfoChange entity = new PersonInfoChange(); WebFormHelper.GetDataFromForm(this, entity); if (SimpleOrmOperator.Create(entity)) { WebTools.Alert("提交驾驶人联系方式变更备案成功!"); } else { WebTools.Alert("提交驾驶人联系方式变更备案失败!"); } }
public static bool ResetPwd(int id, string newpwd) { bool result = DataAccessFactory.GetDataAccess().ExecuteSql("update table_users set c_pwd='" + SecurityFactory.GetSecurity().Encrypt(newpwd) + "' where id=" + id); if (result) { BusLog log = new BusLog(); log.BusType = "重设密码"; log.Content = "admin修改ID为" + id + "的密码"; BusLogOperator.InitByLoginUser(log); SimpleOrmOperator.Create(log); //log.Operator= } return(result); }
protected void btnSave_Click(object sender, EventArgs e) { CarOwnerInfoChange entity = new CarOwnerInfoChange(); WebFormHelper.GetDataFromForm(this, entity); entity.Hmhp = this.txtHmhpPrefix.Text + this.txtHmhpEnd.Text.Trim(); if (SimpleOrmOperator.Create(entity)) { WebTools.Alert("提交车主联系方式变更备案成功!"); } else { WebTools.Alert("提交车主联系方式变更备案失败!"); } }
protected void btnBatchClear_Click(object sender, EventArgs e) { IList <string> idcards = new List <string>(); int checkNum = 0; int reNum = 0; foreach (DataGridItem item in DataGrid1.Items) { CheckBox cb = (CheckBox)item.FindControl("cbIdCard"); if (cb.Checked) { idcards.Add(item.Cells[3].Text); checkNum++; } } if (checkNum == 0) { WebTools.Alert("没有记录被选中"); return; } foreach (string idcard in idcards) { FpStudentObject fso = SimpleOrmOperator.Query <FpStudentObject>(idcard); //fso.KM3_VERIFY = "Y"; //fso.FEE_VERIFY_DATE = DateTime.Now; // string idcard = fso.IDCARD.Trim('\''); fso.IDCARD = "'" + idcard + "'"; if (SimpleOrmOperator.Delete(fso)) { // fso.IDCARD = fso.IDCARD.Trim('\''); _FP.FpDeleteUser(idcard); if (fso.STATUE >= FpStudentObject.STATUE_KM3_ENTER) { fso.IDCARD = idcard; FpStudentCleared cleared = new FpStudentCleared(fso); SimpleOrmOperator.Create(cleared); } reNum++; } } WebTools.Alert(string.Format("删除结果:选中{0}条记录,{1}条成功删除", checkNum, reNum)); this.ProcedurePager1.Changed = true; txtQueryValue.Text = ""; txtQueryValue.Focus(); }
/// <summary> /// 新增指纹采集的姓名和身份证明号码记录 /// </summary> /// <param name="idcard"></param> /// <param name="name"></param> public static void Enroll(string idcard, string name, string pxrq, string studenttype, string car) { LocalFingerRecordObject obj = new LocalFingerRecordObject(); obj.CreateTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); obj.IdCard = idcard; obj.Name = name; obj.UploadTime = string.Empty; SystemConfig config = StaticCacheManager.GetConfig <SystemConfig>(); obj.Lsh = ""; obj.SchoolName = config.SchoolName; obj.SchoolCode = config.SchoolCode; obj.Pxrq = pxrq; obj.StudentType = studenttype; obj.LearnCar = car; SimpleOrmOperator.Create(obj); BackFingerInfo(); }
public static void Save(WeekRecord week, int dayofweek, int km, string begindate, string desc) { if (desc == null || desc.Length == 0) { return; } int weeknum = week.WeekNum; DateTime begin = DateTime.Parse(begindate); ArrayList lists = new ArrayList(); string[] array1 = desc.Trim("<br/>".ToCharArray()).Split(new string[] { "<br/>" }, StringSplitOptions.RemoveEmptyEntries); string[] array2 = null; string[] array3 = null; YuyueLimit limit; for (int i = 0; i < array1.Length; i++) { limit = new YuyueLimit(); limit.WeekNum = weeknum; limit.Operator = week.CheckOperator; limit.Ksrq = begin.AddDays(dayofweek - 1).ToString("yyyy-MM-dd"); limit.DayOfWeek = dayofweek; array2 = array1[i].Split(';'); array3 = array2[0].Split(':'); limit.KsddCode = array3[0]; limit.Ksdd = array3[1]; array3 = array2[1].Split(':'); limit.KsccCode = array3[0]; limit.Kscc = array3[1]; array3 = array2[2].Split(':'); limit.SchoolCode = array3[0]; limit.SchoolName = array3[1]; limit.Km = km; limit.Total = Int32.Parse(array2[3]); SimpleOrmOperator.Create(limit); } // SimpleOrmOperator.Delete<YuyueLimit>(id); }
protected void btnCommit_Click(object sender, EventArgs e) { FpSite site = new FpSite(); site.ID = StringHelper.fnFormatNullOrBlankInt(this.lbId.Text, -1); site.NAME = txtSiteName.Text; site.LIMIT = StringHelper.fnFormatNullOrBlankInt(txtSiteLimit.Text, 0); site.BUSTYPE = this.dllBustype.SelectedValue; site.HOST = this.txtHost.Text; if (SimpleOrmOperator.Update(site)) { WebTools.Alert("修改成功!"); } else if (SimpleOrmOperator.Create(site)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("保存失败!"); } FPSystemBiz.DictFpSites.Clear(); }
protected void btnSure_Click(object sender, EventArgs e) { ProductInfo entity = new ProductInfo(); WebFormHelper.GetDataFromForm(this, entity); // entity.MachineMac = FT.Commons.Web.Tools.WebToolsHelper.GetMac(entity.MachineIp); //entity.StartDate = Convert.ToDateTime(this.txtBeginDate.Value.ToString()); // entity.EndDate = Convert.ToDateTime(this.txtEndDate.Value.ToString()); entity.Imgs = ViewState["imgstr"].ToString(); entity.ImgMain = ViewState["imgmain"].ToString(); entity.Production = System.Web.HttpUtility.HtmlEncode(this.CKEditorControl1.Text); //Server.HtmlEncode(this.i_content.Text); if (entity.Id < 0) { if (SimpleOrmOperator.Create(entity)) { WebTools.Alert(this, "添加成功!"); } else { WebTools.Alert("添加失败!"); } } else { if (SimpleOrmOperator.Update(entity)) { WebTools.Alert(this, "修改成功!"); } else { WebTools.Alert("修改失败!"); } } }
public static void Create(ZwTpObject tp) { SimpleOrmOperator.Create(tp); // DataAccessFactory.GetDataAccess().ExecuteSql("delete from table_yuyue_limit where i_week_num=" + week.WeekNum); }
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); } }
public static Boolean fnStudentCheckIn(ref FpStudentObject fso, FpSite fpSite, DateTime lDtCheckin) { bool isCheckin = false; //FpSite fpSite = SimpleOrmOperator.Query<FpSite>(site_id); string bustype = fpSite.BUSTYPE; int localType = fso.LOCALTYPE; if (fpSite.LIMIT > 0) { string condition = string.Format(" where SITE_ID={0} and BUSTYPE='{1}' and to_char(CHECKIN_DATE,'YYYY-MM-DD') = '{2}' order by CHECKIN_DATE DESC " , fpSite.ID , bustype , lDtCheckin ); int checkinCount = SimpleOrmOperator.QueryCounts <FpSite>(condition); if (checkinCount >= fpSite.LIMIT) { string fullMsg = string.Format("场地:{0} 今天的入场人数已超过{1},不能再入场", fpSite.NAME, fpSite.LIMIT); throw new Exception(fullMsg); } } FpLocalType fpLocalType = null; if (DictFpLocalTypes.ContainsKey(localType)) { fpLocalType = DictFpLocalTypes[localType]; } else { fpLocalType = SimpleOrmOperator.Query <FpLocalType>(localType); DictFpLocalTypes.Add(localType, fpLocalType); } isCheckin = fso.checkin(fpSite, fpLocalType, lDtCheckin); //fso.IDCARD="'"+fso.IDCARD+"'"; SimpleOrmOperator.Update(fso); fso.IDCARD = fso.IDCARD.Trim('\'');; if (isCheckin) { FpCheckinLog log = new FpCheckinLog(); log.BUSTYPE = bustype; log.SITE_ID = fpSite.ID; log.CHECKIN_NAME = fso.NAME; log.CHECKIN_IDCARD = fso.IDCARD; log.CHECKIN_DATE = lDtCheckin; log.REMARK = fso.REMARK; log.CHECKIN_STATUE = fso.STATUE; int statue = fso.STATUE; if (statue == FpStudentObject.STATUE_KM1_ENTER) { log.REMARK = "科目1进场"; } else if (statue == FpStudentObject.STATUE_KM2_ENTER) { log.REMARK = "科目2进场"; } else if (statue == FpStudentObject.STATUE_KM1_ENTER) { log.REMARK = "科目3进场"; } else if (statue == FpStudentObject.STATUE_LESSON_START) { log.REMARK = "上课进场"; } else if (statue == FpStudentObject.STATUE_LESSON_END) { log.REMARK = "下课离场"; } isCheckin = SimpleOrmOperator.Create(log); } return(isCheckin); }
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; }