public bool FormCheck() { #region 设置自己要判断的信息 if (txtName.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写姓名!');</script>"); txtName.Focus(); return(false); } if (txtProName.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写项目名称!');</script>"); txtName.Focus(); return(false); } if (txtCreateTime.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写日期!');</script>"); txtCreateTime.Focus(); return(false); } if (CommHelp.VerifesToDateTime(txtCreateTime.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>"); return(false); } //if (ddlPers.SelectedItem == null || ddlPers.Text == "") //{ // base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择各户代表!');</script>"); // ddlPers.Focus(); // return false; //} if (ddlPers.Visible == true && ddlPers.SelectedItem == null) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择下一步审核人!');</script>"); ddlPers.Focus(); return(false); } if (DBHelp.ExeScalar(string.Format("select ID from tb_User where loginName='{0}'", txtName.Text)) == null) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写申请用户不存在!');</script>"); txtName.Focus(); return(false); } #endregion return(true); }
protected void btnIsSelected_Click(object sender, EventArgs e) { if (btnEdit.Text == "取消编辑") { StringBuilder where = new StringBuilder(); for (int i = 0; i < this.gvList.Rows.Count; i++) { Label lblIds = (gvList.Rows[i].FindControl("Id")) as Label; TextBox EditGuestName = (gvList.Rows[i].FindControl("EditGuestName")) as TextBox; TextBox EditReceived = (gvList.Rows[i].FindControl("EditReceived")) as TextBox; if (CommHelp.VerifesToNum(EditReceived.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('到款金额格式错误!');</script>"); return; } //where.AppendFormat("update KIS.[KingdeeInvoice].[dbo].[Invoice] set GuestName='{1}',Received={2} where Id={0};", lblIds.Text, EditGuestName.Text, EditReceived.Text); where.AppendFormat("update [KingdeeInvoice].[dbo].[Invoice] set GuestName='{1}',Received={2} where Id={0};", lblIds.Text, EditGuestName.Text, EditReceived.Text); } if (where.ToString() != "") { DBHelp.ExeCommand(where.ToString()); } } if (ViewState["cbIsIsorder"] == null) { string where = " Id in ("; string expWhere = " Id in ("; for (int i = 0; i < this.gvList.Rows.Count; i++) { CheckBox cb = (gvList.Rows[i].FindControl("cbIsIsorder")) as CheckBox; if (cb.Checked) { Label lblIds = (gvList.Rows[i].FindControl("Id")) as Label; where += "'" + lblIds.Text + "',"; } else { Label lblIds = (gvList.Rows[i].FindControl("Id")) as Label; expWhere += "'" + lblIds.Text + "',"; } } if (where != " Id in (") { where = where.Substring(0, where.Length - 1) + ")"; //var sql = "update KIS.[KingdeeInvoice].[dbo].[Invoice] set Isorder=1 where " + where; var sql = "update [KingdeeInvoice].[dbo].[Invoice] set Isorder=1 where " + where; DBHelp.ExeCommand(sql); } if (expWhere != " Id in (") { expWhere = expWhere.Substring(0, expWhere.Length - 1) + ")"; //var sql = "update KIS.[KingdeeInvoice].[dbo].[Invoice] set Isorder=null where " + expWhere; var sql = "update [KingdeeInvoice].[dbo].[Invoice] set Isorder=null where " + expWhere; DBHelp.ExeCommand(sql); } base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('保存成功!');</script>"); } }
public bool FormCheck() { if (this.ddlCarNo.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择车牌号!');</script>"); this.ddlCarNo.Focus(); return(false); } if (this.txtMaintenanceTime.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写保养/加油时间!');</script>"); this.txtMaintenanceTime.Focus(); return(false); } if (txtMaintenanceTime.Text != "") { try { Convert.ToDateTime(txtMaintenanceTime.Text); } catch (Exception) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写的日期格式有误!');</script>"); txtMaintenanceTime.Focus(); return(false); } } if (this.txtDistance.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写公里数!');</script>"); this.txtDistance.Focus(); return(false); } if (CommHelp.VerifesToNum(txtDistance.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('公里数 格式错误!');</script>"); this.txtDistance.Focus(); return(false); } if (txtTotal.Text != "") { try { Convert.ToDecimal(txtTotal.Text); } catch (Exception) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('金额格式有误!');</script>"); this.txtTotal.Focus(); return(false); } } return(true); }
private static void GlobalMutex() { // 是否第一次创建mutex bool newMutexCreated = false; string mutexName = "Global\\" + "WareHouseMis"; try { mutex = new Mutex(false, mutexName, out newMutexCreated); } catch (Exception ex) { Console.Write(ex.Message); Thread.Sleep(1000); Environment.Exit(1); } // 第一次创建mutex if (newMutexCreated) { Console.WriteLine("程序已启动"); } else { CommHelp.ShowTips("另一个窗口已在运行,不能重复运行。"); Thread.Sleep(1000); Environment.Exit(1);//退出程序 } }
private void tool_TakeOut_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (User.CurrentPatient == null) { CommHelp.ShowWarning("请选择需要拍摄的患者"); } else { var form = new FormPicture(); if (form.ShowDialog() == DialogResult.OK) { LoadMdiForm(this, typeof(FormPatientEdit)); if (form.imgList.Count > 0) { foreach (var f in this.MdiChildren) { if (f.GetType() == typeof(FormPatientEdit)) { ((FormPatientEdit)f).SaveImgToHistory(form.imgList); } } } } } }
private bool Check() { if (string.IsNullOrEmpty(txtSupplierName.Text)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, string.Format("<script>alert('供应商名称不能为空!');</script>")); return false; } if (string.IsNullOrEmpty(txtTotal.Text)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, string.Format("<script>alert('金额不能为空!');</script>")); return false; } if (CommHelp.VerifesToNum(txtTotal.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, string.Format("<script>alert('金额格式错误!');</script>")); return false; } if (string.IsNullOrEmpty(dllUse.Text)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, string.Format("<script>alert('请选择用途!');</script>")); return false; } return true; }
private void DeleteCurrentImg() { var rows = winExplorerView1.GetSelectedRows(); if (rows.Count() == 0) { CommHelp.ShowWarning("请选择要删除的图片"); return; } var v = (DataRowView)winExplorerView1.GetRow(rows[0]); var img = currentHistory.imgInfos.FirstOrDefault(f => f.ID == Convert.ToInt32(v["Index"])); currentHistory.imgInfos.Remove(img); if (currentHistory.HistoryNo != null) { var path = Path.Combine(User.DBPath, User.CurrentPatient.FName + User.CurrentPatient.BirthDay, currentHistory.HistoryNo, img.FileName); if (File.Exists(path + ".bmp")) { File.Delete(path + ".bmp"); } if (File.Exists(path + ".ini")) { File.Delete(path + ".ini"); } User.SaveHistorys(currentHistory); } winExplorerView1.DeleteSelectedRows(); }
protected void btnSave_Click(object sender, EventArgs e) { var propertyList = this.FIN_PropertyService.GetListArray(" MyProperty='个性'"); List <FIN_SpecCost> commCostList = new List <FIN_SpecCost>(); foreach (var m in propertyList) { if (!string.IsNullOrEmpty(Request["pro_" + m.Id])) { var newM = new FIN_SpecCost(); newM.CaiYear = ddlYear.Text + ddlMonth.Text; newM.CompId = Convert.ToInt32(ddlCompany.Text); newM.CostTypeId = m.Id; if (CommHelp.VerifesToNum(Request["pro_" + m.Id].ToString()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('数值 格式错误!');</script>"); return; } newM.Total = Convert.ToDecimal(Request["pro_" + m.Id]); newM.UserID = Convert.ToInt32(ddlUser.Text); commCostList.Add(newM); } } FIN_SpecCostService commSer = new FIN_SpecCostService(); commSer.AddList(commCostList); base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('保存成功!');</script>"); }
private bool Check() { if (CommHelp.VerifesToNum(txtZhangQi.Text) == false || Convert.ToDecimal(txtZhangQi.Text) < 0) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目财务成本账期 格式有问题!');</script>"); return(false); } if (CommHelp.VerifesToNum(txtCeSuanDian.Text) == false || Convert.ToDecimal(txtCeSuanDian.Text) < 0 || Convert.ToDecimal(txtCeSuanDian.Text) > 1) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('财务成本测算点 格式有问题!');</script>"); return(false); } if (CommHelp.VerifesToNum(txtMonthLiLv.Text) == false || Convert.ToDecimal(txtMonthLiLv.Text) < 0 || Convert.ToDecimal(txtMonthLiLv.Text) > 1) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('财务成本月利率 格式有问题!');</script>"); return(false); } if (txtFrom.Text == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('考核前期日期 不能为空!');</script>"); return(false); } if (txtFrom.Text != "") { if (CommHelp.VerifesToDateTime(txtFrom.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('考核前期日期 格式错误!');</script>"); return(false); } } return(true); }
public bool FormCheck() { string strErr = ""; if (this.txtBasePoType.Text.Trim().Length == 0) { strErr += "名称不能为空!\\n"; } if (CommHelp.VerifesToNum(txtReward.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('系数 格式错误!');</script>"); return(false); } try { Convert.ToDecimal(txtReward.Text); } catch (Exception) { strErr += "系数格式错误!\\n"; } if (strErr != "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, string.Format("<script>alert('{0}');</script>", strErr)); return(false); } return(true); }
public bool FormCheck() { if (this.txtBusCardDate.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写日期!');</script>"); this.txtBusCardDate.Focus(); return(false); } if (CommHelp.VerifesToDateTime(txtBusCardDate.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>"); return(false); } if (this.txtBusCardTotal.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填金额!');</script>"); this.txtBusCardTotal.Focus(); return(false); } try { Convert.ToDecimal(txtBusCardTotal.Text); } catch (Exception) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写的数字格式有误!');</script>"); txtBusCardTotal.Focus(); return(false); } return(true); }
private void ShowOil() { string sql = " 1=1 "; if (txtOilFrom.Text != "") { if (CommHelp.VerifesToDateTime(txtOilFrom.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('加油日期 格式错误!');</script>"); return; } sql += string.Format(" and MaintenanceTime>='{0} 00:00:00'", txtOilFrom.Text); } if (txtOilTo.Text != "") { if (CommHelp.VerifesToDateTime(txtOilTo.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('加油日期 格式错误!');</script>"); return; } sql += string.Format(" and MaintenanceTime<='{0} 23:59:59'", txtOilTo.Text); } if (ddlOilCarNo.Text != "") { sql += string.Format(" and CardNo like '%{0}%'", ddlOilCarNo.Text); } if (txtFromChongZhi.Text != "") { if (CommHelp.VerifesToDateTime(txtFromChongZhi.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('充值时间 格式错误!');</script>"); return; } sql += string.Format(" and ChongZhiDate>='{0} 00:00:00'", txtFromChongZhi.Text); } if (txtToChongZhi.Text != "") { if (CommHelp.VerifesToDateTime(txtToChongZhi.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('充值时间 格式错误!');</script>"); return; } sql += string.Format(" and ChongZhiDate<='{0} 23:59:59'", txtToChongZhi.Text); } List <TB_CarOilMaintenance> cars = this.CarOilSer.GetListArray(sql); AspNetPager2.RecordCount = cars.Count; this.gvOil.PageIndex = AspNetPager2.CurrentPageIndex - 1; this.gvOil.DataSource = cars; this.gvOil.DataBind(); }
//(NO.4) public bool FormCheck() { #region 设置自己要判断的信息 if (txtDepartName.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写部门!');</script>"); txtDepartName.Focus(); return(false); } if (txtName.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写姓名!');</script>"); txtName.Focus(); return(false); } if (txtDateTime.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写日期!');</script>"); txtDateTime.Focus(); return(false); } else { if (CommHelp.VerifesToDateTime(txtDateTime.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('时间 格式错误!');</script>"); return(false); } } if (txtToolName.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写工具名称!');</script>"); txtToolName.Focus(); return(false); } if (DBHelp.ExeScalar(string.Format("select ID from tb_User where loginName='{0}'", txtName.Text)) == null) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写申请用户不存在!');</script>"); txtName.Focus(); return(false); } #endregion if (ddlPers.Visible == true && ddlPers.SelectedItem == null) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择下一步审核人!');</script>"); ddlPers.Focus(); return(false); } return(true); }
private void btnEdit_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtName.Text)) { CommHelp.ShowTips("请选择要修改的账号"); return; } SetControl(ActionType.Edit); }
private void Show() { string where = ""; if (txtFrom.Text != "") { if (CommHelp.VerifesToDateTime(txtFrom.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目时间 格式错误!');</script>"); return; } where += string.Format(" and CG_POOrder.PODate>='{0} 00:00:00'", txtFrom.Text); } if (txtTo.Text != "") { if (CommHelp.VerifesToDateTime(txtTo.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目时间 格式错误!');</script>"); return; } where += string.Format(" and CG_POOrder.PODate<='{0} 23:59:59'", txtTo.Text); } if (ddlCompany.Text == "-1" && ddlUser.Text != "-1") { where += string.Format(" and exists (select id from tb_User where ID={0} and CG_POOrder.appName=id)", ddlUser.Text); } if (ddlCompany.Text != "-1") { string where1 = string.Format(" CompanyCode='{0}'", ddlCompany.Text.Split(',')[0]); if (ddlUser.Text != "-1") { where1 += string.Format(" and ID={0} ", ddlUser.Text); } where += string.Format(" and exists (select id from tb_User where {0} and CG_POOrder.appName=id)", where1); } if (ddlIsClose.Text != "-1") { where += " and IsClose=" + ddlIsClose.Text; } if (ddlJieIsSelected.Text != "-1") { where += " and JieIsSelected=" + ddlJieIsSelected.Text; } if (ddlSpecial.Text != "-1") { where += string.Format(" and CG_POOrder.IsSpecial={0}", ddlSpecial.Text); } ds = DBHelp.getDataSet(GetSql("").ToString()); noSellAndCaiGoodsList = new RuSellReportService().getHT(where); resut_SellGoodsList = new Model.HashTableModel().HashTableToList(noSellAndCaiGoodsList); resut_SellGoodsList.Sort(); dt_Fund = DBHelp.getDataTable(GetFundWrong()); GetSumPOTotal(); //dt_GetSumPOTotal = DBHelp.getDataTable(); }
private void DeleteCurrentImg() { if (File.Exists($"{dirName}\\{copyInfo.FileName}.ini")) { File.Delete($"{dirName}\\{copyInfo.FileName}.ini"); } CommHelp.ShowTips("图片已经删除,请选择其它图片编辑"); this.Close(); }
private void Show() { string sql = " 1=1 "; if (txtFrom.Text != "") { if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>"); return; } sql += string.Format(" and CreateTime>='{0} 00:00:00'", txtFrom.Text); } if (txtTo.Text != "") { if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>"); return; } sql += string.Format(" and CreateTime<='{0} 23:59:59'", txtTo.Text); } if (txtProName.Text != "") { sql += string.Format(" and ProName like '%{0}%'", txtProName.Text); } if (txtProNo.Text != "") { sql += string.Format(" and ProNo like '%{0}%'", txtProNo.Text); } sql += " and UserId=" + Session["currentUserId"].ToString(); // sql += string.Format(@" and id in (select allE_id from tb_EForm where proId in ( //select pro_Id from A_ProInfo where pro_Type='工程材料审计清单') and state='通过')"); List <Tb_ProjectInvs> pos = this.proInvSer.GetListArray_Rep(sql); decimal total = 0; foreach (Tb_ProjectInvs model in pos) { total += model.Total == null?0:Convert.ToDecimal(model.Total); } lblTotal.Text = total.ToString(); this.gvList.DataSource = pos; this.gvList.DataBind(); }
private void Show() { string sql = " 1=1 "; if (txtFrom.Text != "") { if (CommHelp.VerifesToDateTime(txtFrom.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('保养日期 格式错误!');</script>"); return; } sql += string.Format(" and MaintenanceTime>='{0} 00:00:00'", txtFrom.Text); } if (txtTo.Text != "") { if (CommHelp.VerifesToDateTime(txtTo.Text) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('保养日期 格式错误!');</script>"); return; } sql += string.Format(" and MaintenanceTime<='{0} 23:59:59'", txtTo.Text); } if (ddlCarNo.Text != "") { sql += string.Format(" and CardNo like '%{0}%'", ddlCarNo.Text); } sql += string.Format(@" and TB_CarMaintenance.id in (select allE_id from tb_EForm where proId in ( select pro_Id from A_ProInfo where pro_Type='车辆保养申请表') and state='通过')"); List <TB_CarMaintenance> cars = this.CarSer.GetListArray(sql); decimal total = 0; foreach (var model in cars) { if (model.Total != null) { total += Convert.ToDecimal(model.Total); } } lbltotal.Text = total.ToString(); AspNetPager1.RecordCount = cars.Count; this.gvList.PageIndex = AspNetPager1.CurrentPageIndex - 1; this.gvList.DataSource = cars; this.gvList.DataBind(); }
private void button1_Click(object sender, EventArgs e) { AuthRequest.Password = textBox1.Text; if (!AuthRequest.IsPasswordValid) { CommHelp.ShowWarning("密码不符合要求,请重新输入!"); return; } this.DialogResult = DialogResult.OK; }
private void btnOK_Click(object sender, EventArgs e) { if (currentAction == ActionType.Add || currentAction == ActionType.Edit) { if (string.IsNullOrEmpty(txtName.Text)) { CommHelp.ShowTips("必须输入姓名"); return; } else if (string.IsNullOrEmpty(txtBirthDay.Text)) { CommHelp.ShowTips("必须输入生日"); return; } else { var v = new Patient { FName = txtName.Text, Name = "", Address1 = txtAdress.Text, Address2 = "", Address3 = "", BirthDay = txtBirthDay.Text, SECU = txtNo.Text, Tel1 = txtLink.Text, Tel2 = "" }; if (currentAction == ActionType.Add) { v.Number = CreateNum(); if (User.Patients == null) { User.Patients = new List <Patient>(); } User.Patients.Add(v); } else { v.Number = User.CurrentPatient.Number; if (v.FName != User.CurrentPatient.FName || v.BirthDay != User.CurrentPatient.BirthDay) { try { Directory.Move(User.PatientPath, $"{User.DBPath}\\{v.FName + v.BirthDay}"); } catch (Exception ex) { CommHelp.ShowError($"{GetText("修改信息失败,请检查")}{User.PatientPath}{GetText("没有被占用")}"); return; } } var index = User.Patients.FindIndex(f => f.Number == v.Number); User.CurrentPatient = v; User.Patients[index] = v; } SavePatients(); InitData(); SetControl(ActionType.None); } } }
public void Print() { List <DataRowView> rows = new List <DataRowView>(); for (int i = 0; i < winExplorerView1.RowCount; i++) { var view = (DataRowView)winExplorerView1.GetRow(i); if (Convert.ToBoolean(view["IsSelect"])) { rows.Add(view); } } if (rows.Count() > 4) { CommHelp.ShowWarning("一次只能打印4张图片"); return; } if (rows.Count() == 0) { CommHelp.ShowWarning("请选择要打印的图片"); return; } ReportSource source = new ReportSource(); source.Name = User.CurrentPatient.FName; source.Birthday = User.CurrentPatient.BirthDay; source.No = User.CurrentPatient.SECU; source.Yijian = currentHistory.Yijian; source.Img1 = Help.Base64Util.GetBase64FromImage((Bitmap)rows[0]["Image"]); if (rows.Count() > 1) { source.Img2 = Help.Base64Util.GetBase64FromImage((Bitmap)rows[1]["Image"]); } if (rows.Count() > 2) { source.Img3 = Help.Base64Util.GetBase64FromImage((Bitmap)rows[2]["Image"]); } if (rows.Count() > 3) { source.Img4 = Help.Base64Util.GetBase64FromImage((Bitmap)rows[3]["Image"]); } ReportViewerDialog dlg = new ReportViewerDialog(); dlg.DataSourceDict = new List <ReportSource>() { source }; dlg.ReportFilePath = "Report/Report.rdlc"; dlg.ShowDialog(); }
private void Show() { string sql = " 1=1 "; if (txtFrom.Text != "") { if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('违章时间 格式错误!');</script>"); return; } sql += string.Format(" and BreakTime>='{0} 00:00:00'", txtFrom.Text); } if (txtTo.Text != "") { if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('违章时间 格式错误!');</script>"); return; } sql += string.Format(" and BreakTime<='{0} 23:59:59'", txtTo.Text); } if (ddlCarNo.Text != "") { sql += string.Format(" and CarNo like '%{0}%'", ddlCarNo.Text); } if (txtDriver.Text != "") { sql += string.Format(" and Driver like '%{0}%'", txtDriver.Text); } if (ddlState.Text != "") { sql += string.Format(" and state like '%{0}%'", ddlState.Text); } List <TB_BreakRulesCar> cars = this.braRuleCarSer.GetListArray(sql); AspNetPager1.RecordCount = cars.Count; this.gvList.PageIndex = AspNetPager1.CurrentPageIndex - 1; this.gvList.DataSource = cars; this.gvList.DataBind(); }
private bool Check() { if (!CommHelp.VerifesToDateTime(txtFrom.Text) || !CommHelp.VerifesToDateTime(txtTo.Text) || !CommHelp.VerifesToDateTime(txtpayableFrom.Text) || !CommHelp.VerifesToDateTime(txtpayableTo.Text)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('时间格式错误!');</script>"); return(false); } if (Convert.ToDateTime(txtFrom.Text) > Convert.ToDateTime(txtTo.Text)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('发票开始时间 必须小于等于 结束时间!');</script>"); return(false); } if (Convert.ToDateTime(txtpayableFrom.Text) > Convert.ToDateTime(txtpayableTo.Text)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('发票开始时间 必须小于 结束时间!');</script>"); return(false); } if (txtInvoiceDate.Text.Trim() == "" || txtpayableDate.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('运行时间不能为空!');</script>"); return(false); } if (CommHelp.VerifesToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + txtInvoiceDate.Text.Trim()) == false || CommHelp.VerifesToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + txtpayableDate.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('运行时间 格式错误!');</script>"); return(false); } if (string.IsNullOrEmpty(txtIP.Text)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('IP地址不能为空!');</script>"); return(false); } if (string.IsNullOrEmpty(txtUserId.Text)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('用户名不能为空!');</script>"); return(false); } if (string.IsNullOrEmpty(txtPwd.Text)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('密码不能为空!');</script>"); return(false); } return(true); }
private void btnSave_Click(object sender, EventArgs e) { //ParmA.Baipingheng = tbBaipinghengA.Value; //ParmA.Baoguang = tbBaoguangA.Value; ParmA.Baohedu = tbBaoheduA.Value; ParmA.Duibidu = tbDuibiduA.Value; ParmA.Gama = tbGamaA.Value; ParmA.Liangdu = tbLiangduA.Value; ParmA.Niguangduibi = tbNiguangduibiA.Value; ParmA.Qingxidu = tbQinxiduA.Value; //ParmA.Sediao = tbSediaoA.Value; ParmA.IsChange = ParmA.Equals(CameraParm); ParmA.Type = ParmType.A; //ParmB.Baipingheng = tbBaipinghengB.Value; //ParmB.Baoguang = tbBaoguangB.Value; ParmB.Baohedu = tbBaoheduB.Value; ParmB.Duibidu = tbDuibiduB.Value; ParmB.Gama = tbGamaB.Value; ParmB.Liangdu = tbLiangduB.Value; ParmB.Niguangduibi = tbNiguangduibiB.Value; ParmB.Qingxidu = tbQinxiduB.Value; //ParmB.Sediao = tbSediaoB.Value; ParmB.IsChange = ParmB.Equals(CameraParm); ParmB.Type = ParmType.B; //ParmC.Baipingheng = tbBaipinghengC.Value; //ParmC.Baoguang = tbBaoguangC.Value; ParmC.Baohedu = tbBaoheduC.Value; ParmC.Duibidu = tbDuibiduC.Value; ParmC.Gama = tbGamaC.Value; ParmC.Liangdu = tbLiangduC.Value; ParmC.Niguangduibi = tbNiguangduibiC.Value; ParmC.Qingxidu = tbQinxiduC.Value; //ParmC.Sediao = tbSediaoC.Value; ParmC.IsChange = ParmC.Equals(CameraParm); ParmC.Type = ParmType.C; var aPath = Path.Combine(path, "Microspur.set"); var bPath = Path.Combine(path, "Panorama.set"); var cPath = Path.Combine(path, "Portrait.set"); File.WriteAllText(aPath, ParmA.ToJson()); File.WriteAllText(bPath, ParmB.ToJson()); File.WriteAllText(cPath, ParmC.ToJson()); CommHelp.ShowTips(LanguageHelp.GetTextLanguage("保存成功")); }
private void select() { string sql = " 1=1 "; if (txtFrom.Text != "") { if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('时间 格式错误!');</script>"); return; } sql += string.Format(" and DisDate>='{0} 00:00:00'", txtFrom.Text); } if (txtTo.Text != "") { if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('时间 格式错误!');</script>"); return; } sql += string.Format(" and DisDate<='{0} 23:59:59'", txtTo.Text); } if (txtOutDispater.Text != "") { sql += string.Format(" and loginName like '%{0}%'", txtOutDispater.Text); } if (txtDispatcher.Text != "") { sql += string.Format(" and Dispatcher like '%{0}%'", txtDispatcher.Text); } if (txtSuiTong.Text != "") { sql += string.Format(" and SuiTongRen like '%{0}%'", txtSuiTong.Text); } List <DispatchingRep> users = this.DispatchingSer.GetListArrayReport(sql); //AspNetPager1.RecordCount = users.Count; //this.gvList.PageIndex = AspNetPager1.CurrentPageIndex - 1; this.gvList.DataSource = users; this.gvList.DataBind(); }
public bool FormCheck() { string strErr = ""; if (this.txtJDate.Text.Trim().Length == 0 || CommHelp.VerifesToDateTime(txtJDate.Text) == false) { strErr += "日期格式不正确!\\n"; } if (strErr != "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, string.Format("<script>alert('{0}');</script>", strErr)); return(false); } return(true); }
private void Show() { string sql = " 1=1 "; if (txtFrom.Text != "") { if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>"); return; } sql += string.Format(" and DataTime>='{0} 00:00:00'", txtFrom.Text); } if (txtTo.Text != "") { if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>"); return; } sql += string.Format(" and DataTime<='{0} 23:59:59'", txtTo.Text); } if (txtInvName.Text != "") { sql += string.Format(" and InvName like '%{0}%'", txtInvName.Text); } if (txtSeller.Text != "") { sql += string.Format(" and Seller like '%{0}%'", txtSeller.Text); } if (txtUnitName.Text != "") { sql += string.Format(" and UnitName like '%{0}%'", txtUnitName.Text); } sql += string.Format(" and CreateUser={0}", Session["currentUserId"].ToString()); List <TB_PO> pos = this.poSer.GetListArray(sql); AspNetPager1.RecordCount = pos.Count; this.gvList.PageIndex = AspNetPager1.CurrentPageIndex - 1; this.gvList.DataSource = pos; this.gvList.DataBind(); }
private void btnImgEdit_Click(object sender, EventArgs e) { var rows = winExplorerView1.GetSelectedRows(); if (rows.Count() == 0) { CommHelp.ShowWarning("请选择要编辑的图片"); return; } var v = (DataRowView)winExplorerView1.GetRow(rows[0]); var img = currentHistory.imgInfos.FirstOrDefault(f => f.ID == Convert.ToInt32(v["Index"])); FormImageEdit form = new FormImageEdit(img, currentHistory); form.ShowDialog(); User.ReadCurrentPatientHistorys(); BindImg(); }
private void btnLink_Click(object sender, System.EventArgs e) { var ssid = lbxWIFI.SelectedItem.ToString(); var password = ""; if (wifiInfo != null && wifiInfo.Any(w => w.SSID == ssid)) { password = Encoding.UTF8.GetString(Convert.FromBase64String(wifiInfo.FirstOrDefault(w => w.SSID == ssid).Password)); } var point = accessPoints.FirstOrDefault(w => w.Name == ssid); AuthRequest authRequest = new AuthRequest(point); WifiPassword form = new WifiPassword(password); form.AuthRequest = authRequest; if (form.ShowDialog() == DialogResult.OK) { password = form.Password; if (wifiInfo == null) { wifiInfo = new List <WifiInfo>(); } if (!wifiInfo.Any(w => w.SSID == ssid)) { wifiInfo.Add(new WifiInfo { SSID = ssid, Password = Convert.ToBase64String(Encoding.UTF8.GetBytes(password)) }); } if (form.IsRPwd) { SaveWifiInfo(); } if (point.Connect(form.AuthRequest, true)) { User.LinkType = LinkType.WIFI; this.DialogResult = DialogResult.OK; } else { CommHelp.ShowError("无法连接到网络"); } } }
public bool FormCheck() { if (this.txtPAItemName.Text.Trim() == "") { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写绩效考核项名称!');</script>"); this.txtPAItemName.Focus(); return(false); } if (!string.IsNullOrEmpty(txtPAItemScore.Text)) { if (CommHelp.VerifesToNum(txtPAItemScore.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('分值 格式错误!');</script>"); return(false); } } if (!string.IsNullOrEmpty(txtPAItemAmount.Text)) { if (CommHelp.VerifesToNum(txtPAItemAmount.Text.Trim()) == false) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('奖罚金额 格式错误!');</script>"); return(false); } } if (base.Request["PAItemId"] != null) { if (Convert.ToInt32(DBHelp.ExeScalar(string.Format("select count(*) from A_PAItem where A_PAItemName='{0}' and A_PAItemId<>{1}", this.txtPAItemName.Text.Trim(), base.Request["PAItemId"]))) > 0) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('绩效考核项名称已经存在,请重新填写!');</script>"); this.txtPAItemName.Focus(); return(false); } } else { if (Convert.ToInt32(DBHelp.ExeScalar(string.Format("select count(*) from A_PAItem where A_PAItemName='{0}'", this.txtPAItemName.Text.Trim()))) > 0) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('绩效考核项名称已经存在,请重新填写!');</script>"); this.txtPAItemName.Focus(); return(false); } } return(true); }