public async Task <ActionResult <check> > Postcheck(check check) { _context.check.Add(check); await _context.SaveChangesAsync(); return(CreatedAtAction("Getcheck", new { id = check.checkId }, check)); }
public async Task <IActionResult> Edit(int id, [Bind("checkId,checkName")] check check) { if (id != check.checkId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(check); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!checkExists(check.checkId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(check)); }
protected void Page_Load(object sender, EventArgs e) { check ck = new check(); string u = "0"; string sql = ""; u = ck.CheckNumber(GetRequestCookies("user_id", "0")); if (u == "8299" | u == "9089") { PlaceHolder1.Visible = true; } else { PlaceHolder1.Visible = false; } data_conn cn = new data_conn(); DataSet ds = new DataSet(); //显示未读消息 //sql = "select count(mid) as count from TB_PM where readed = 0 and listener = " + u; //ds = cn.mdb_ds(sql, "tb_pm"); //ltrPm.Text = ds.Tables["tb_pm"].Rows[0]["count"].ToString(); //sql = "select count(oid) as count from TB_ORDER where (order_status = 2 or order_status = 4) and order_forward = " + u; //ds = cn.mdb_ds(sql, "TB_ORDER"); //ltrNewBooking.Text = ds.Tables["TB_ORDER"].Rows[0]["count"].ToString(); }
public void LoadRecord(string page,string search) { check ck = new check(); data_conn cn = new data_conn(); string sql = ""; int item = (Convert.ToInt32(page) - 1) * 100; sql += "select top 100 * from "; sql += "(select id,number,name from TB_HS "; sql += "where 1=1 "; if (search != "") { sql += "and (number like '%" + search + "%' or name like '%" + search + "%') "; } sql += ") as T "; sql += "where id not in "; sql += "(select top " + item + " id from TB_HS "; sql += "where 1=1 "; if (search != "") { sql += "and (number like '%" + search + "%' or name like '%" + search + "%') "; } sql += "order BY TB_HS.id DESC) "; sql += "ORDER BY id DESC"; DataSet ds = cn.mdb_ds(sql, "HS"); Repeater1.DataSource = ds.Tables["HS"].DefaultView; Repeater1.DataBind(); LoadTotalCount(); }
public byte[] PrepareReport(check check) { _Check = check; #region _document = new Document(PageSize.A4, 0f, 0f, 0f, 0f); _document.SetPageSize(PageSize.A4); _document.SetMargins(20f, 20f, 20f, 20f); _pdfTable.WidthPercentage = 100; _pdfTable.HorizontalAlignment = Element.ALIGN_LEFT; _fontStyle = FontFactory.GetFont("Calibri", 8f, 1); PdfWriter.GetInstance(_document, _memoryStream); _document.Open(); _pdfTable.SetWidths(new float[] { 50f, 50f, 50f }); #endregion this.ReportHeader(); this.ReportBody(); this.ReportFooter(); _pdfTable.HeaderRows = 2; _document.Add(_pdfTable); _document.Close(); return(_memoryStream.ToArray()); }
static void Main(String[] args) { Info f = new Info(); Eventhere h = new Eventhere(); f.Mailcheck += h.Mailhere; check c = new check(f.Digits); Console.WriteLine("Enter The Mobile No"); var input = Console.ReadLine(); while (!c(input)) { Console.WriteLine("Wrong Mobile No Enter Again"); input = Console.ReadLine(); } Console.WriteLine($"{input} Added Success!"); Console.WriteLine($"Thank You for Adding Mobile No"); Console.WriteLine("Enter Gmail id"); input = Console.ReadLine(); check d = new check(f.Gmailcheck); while (!d(input)) { Console.WriteLine("Wrong Gamil Account Enter Again"); input = Console.ReadLine(); } Console.WriteLine($"{input} Added Success!"); Console.WriteLine($"Thank You for Adding Google Account"); f.Display(); }
protected void Page_Load(object sender, EventArgs e) { Literal1.Text = "<strong><img style=\"margin:0 6px -6px 0;\" src=\"/images/mail/6464_034.png\" width=\"32\" height=\"32\" />您的申请已提交,感谢您的支持!</strong>"; GetRequest GetRequest1 = new GetRequest(); SymmetricMethod ss = new SymmetricMethod(); check ck = new check(); string uid = "0"; try { uid = ck.CheckNumber(ss.Decrypto(GetRequest1.GetRequestQueryString("uid", ""))); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = ""; sql = "SELECT userid FROM TB_TOPIC_REG WHERE userid = " + uid + ""; ds = cn.mdb_ds(sql, "user"); if (ds.Tables["user"].Rows.Count > 0) { Literal1.Text = "<strong><img style=\"margin:0 6px -6px 0;\" src=\"/images/mail/wr.gif\" width=\"32\" height=\"32\" />您已经提交过申请!</strong>"; } else { sql = "INSERT INTO TB_TOPIC_REG (userid) VALUES (" + uid + ")"; cn.mdb_exe(sql); Literal1.Text = "<strong><img style=\"margin:0 6px -6px 0;\" src=\"/images/mail/6464_034.png\" width=\"32\" height=\"32\" />您的申请已提交,感谢您的支持!</strong>"; } } catch { Literal1.Text = "<strong><img style=\"margin:0 6px -6px 0;\" src=\"/images/mail/wr.gif\" width=\"32\" height=\"32\" />抱歉,您需在注册邮件或普通会员注册页面中点击申请链接!</strong>"; } }
private void textBox_TextChanged(object sender, TextChangedEventArgs e) { if (phonetxt.Text != "PHONE NUMBER" && phonetxt.Text != "" && Regex.Match(cctxt.Text + phonetxt.Text, @"^([+91]\d[0-9]{11})$").Success) { check phoneav = dbhandler.checkifPhonenumberavailable(cctxt.Text, phonetxt.Text); if (phoneav.available) { book_avail avail = new book_avail(); avail = dbhandler.book_retrieve(cctxt.Text + phonetxt.Text); if (avail.available == "true") { string[] roomtypet = avail.room_type.Split(','); string[] bokkedtt = avail.book_time.Split(','); string[] checkoutd = avail.checkout_date.Split(','); string[] checkoutt = avail.checkout_time.Split(','); string[] countt = avail.count.Split(','); string[] advancet = avail.advance_paid.Split(','); string[] ramountt = avail.amount.Split(','); for (int i = 0; i < (roomtypet.Length - 1); i++) { // _items.Add(new Item { ROOMNO = "book", ROOMTYPE = roomtypet[i], COUNT = countt[i], AMOUNT = ramountt[i], CHECKIN1 = (avail.book_date + " " + bokkedtt[i] + ":00 HR"), CHECKOUT1 = (checkoutd[i] + " " + checkoutt[i] + ":00 HR"), STATUS = "booked", butname = "EDIT", but_color = "Blue", but_stat = "1" }); // ramttotal += Convert.ToInt32(ramountt[i]); // info_ramount.Text = ramttotal.ToString(); // info_ramount.Foreground = new SolidColorBrush(Colors.Black); //room_list_con.Items.Add(new roomlist() { ROOMNO = "", ROOMTYPE = roomtypet[i], COUNT = countt[i], AMOUNT = ramountt[i], CHECKIN1 = (avail.book_date + " " + bokkedtt[i] + ":00 HR"), CHECKOUT1 = (checkoutd[i] + " " + checkoutt[i] + ":00 HR"), STATUS = "booked" }); } // roomgrid.ItemsSource = Items; } } } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { check ck = new check(); data_conn bbscn = new data_conn(); DataSet bbsds = new DataSet(); string bbssql = "select * from TB_User,TB_BBSLevel where TB_User.UserID=TB_BBSLevel.UserID and UserName='******' and UserPassword='******'"; bbsds = bbscn.mdb_ds(bbssql, "bbsuser"); if (bbsds.Tables["bbsuser"].Rows.Count > 0) { Response.Cookies["bbsadmin"].Value = "yes"; Response.Cookies["bbsadmin_id"].Value = bbsds.Tables["bbsuser"].Rows[0]["UserID"].ToString(); //Response.Cookies["user_name"].Value = Server.UrlEncode(usernm); //Response.Cookies["bbslevel"].Value = bbsds.Tables["bbsuser"].Rows[0]["bbsadmin"].ToString(); Response.Redirect("/bbsmessage/BBSadminList.aspx"); } else { //Response.Cookies["bbsadmin"].Value = "no"; //Response.Redirect("/admin/bbsadmin/BBSadminList.aspx"); //MessageBox("error", "用户名或密码错误"); } }
protected void Button1_Click1(object sender, EventArgs e) { try { string userid = "0"; string message = ""; if (TextBox1.Value.Length > 200) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "提示", "alert('评论内容不能大于200字')", true); } else { check ck = new check(); message = ck.CheckInput(TextBox1.Value); if (TextBox1.Value == "想发表自己的看法吗?写在这里吧。") { message = ""; } if (CheckBox1.Checked == true) { userid = "0"; } else { if (Request.Cookies["user_id"] == null) { userid = "0"; } else { if (Request.Cookies["user_id"].Value.ToString() == "") { userid = "0"; } else { userid = Request.Cookies["user_id"].Value.ToString(); } } } data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = ""; sql = "insert into TB_Message_Comment (UserID,PostDate,Data,type,BBSID,issuer,goodbad) values (" + userid + ",getdate(),'" + message + "',20090630," + "0,0," + RadioButtonList1.SelectedItem.Value + ")"; //TextBox1.Value = sql; //ds = cn.mdb_ds(sql, "BBS"); LoadMessage(); ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "提示", "alert('评论发布成功!')", true); ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "提示", "movepos();", true); TextBox1.Value = ""; } } catch { } }
protected void Page_Load(object sender, EventArgs e) { check check1 = new check(); GetRequest GetRequest1 = new GetRequest(); string u = ""; u = check1.CheckNumber(GetRequest1.GetRequestCookies("user_id", "0")); if (u == "0") { PlaceHolder1.Visible = false; PlaceHolder2.Visible = true; } else { PlaceHolder1.Visible = true; PlaceHolder2.Visible = false; string[] udetail; AllinUser AllinUser1 = new AllinUser(); udetail = AllinUser1.GetUserDetail(u); string uhomeid = udetail[10]; string name = udetail[3]; Literal1.Text = "<A class=login_thumb href=\"/home/space.php?uid=" + udetail[10] + "\"><IMG height=20 alt=" + udetail[3] + " src=\"/uc/avatar.php?uid=" + udetail[10] + "&size=small&type=virtual\" width=20></A> <A class=loginName href=\"/home/space.php?uid=" + udetail[10] + "\">" + udetail[3] + "</A>"; } }
public void LoadRecord(string page,string search) { check ck = new check(); data_conn cn = new data_conn(); string sql = ""; int item = (Convert.ToInt32(page) - 1) * 200; sql += "select top 200 * from "; sql += "(select id,编号,名称,优惠,普通,出口税率,增值税率,消费税,计量单位,监管条件 from TB_Tax "; sql += "where 1=1 "; if (search != "") { sql += "and (编号 like '%" + search + "%' or 名称 like '%" + search + "%' or 优惠 like '%" + search + "%' or 普通 like '%" + search + "%' or 出口税率 like '%" + search + "%' or 增值税率 like '%" + search + "%' or 消费税 like '%" + search + "%' or 计量单位 like '%" + search + "%' or 监管条件 like '%" + search + "%') "; } sql += ") as T "; sql += "where id not in "; sql += "(select top " + item + " id from TB_Tax "; sql += "where 1=1 "; if (search != "") { sql += "and (编号 like '%" + search + "%' or 名称 like '%" + search + "%' or 优惠 like '%" + search + "%' or 普通 like '%" + search + "%' or 出口税率 like '%" + search + "%' or 增值税率 like '%" + search + "%' or 消费税 like '%" + search + "%' or 计量单位 like '%" + search + "%' or 监管条件 like '%" + search + "%') "; } sql += "order BY TB_Tax.id DESC) "; sql += "ORDER BY id DESC"; DataSet ds = cn.mdb_ds(sql, "HS"); Repeater1.DataSource = ds.Tables["HS"].DefaultView; Repeater1.DataBind(); LoadTotalCount(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["uid"] == null) //用户合法性检查 { Response.Redirect("login.aspx"); } else { string strUid = Session["uid"].ToString(); check cls = new check(); bool bPermit = cls.getPermit(strUid, "08"); if (!bPermit) { Response.Redirect("nonPermit.aspx"); } } sqlCon = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\StudentDB_Data.MDF;Integrated Security=True"); //创建数据库连接对象 if (!IsPostBack) { this.BindInse(); this.BindDept(); } if (lstDept.Rows == 1) { btnDeleteDept.OnClientClick = "return confirm('你确认删除该专业吗?'删除后该学院信息也将被删除!)"; } }
public AndCondition(check check, params check[] checks) { check[] checkArray = new check[checks.Length + 1]; checkArray[0]=check; checks.CopyTo(checkArray, 1); _checks = checkArray; }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { check ck = new check(); //string username = FormsAuthentication.HashPasswordForStoringInConfigFile(ck.CheckInput(txtName.Text.ToString()), "MD5"); //string password = FormsAuthentication.HashPasswordForStoringInConfigFile(ck.CheckInput(txtPass.Text.ToString()), "MD5"); string username = ck.CheckInput(txtName.Text.ToString()); string password = ck.CheckInput(txtPass.Text.ToString()); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = ""; //定义SQL语句,查询某一用户发布的3种运价及货盘各自的总数 sql = sql + "SELECT * FROM TB_ADMIN_ACCOUNT "; sql = sql + "WHERE aname = '" + username + "' "; sql = sql + "AND apassword = '******' "; ds = cn.mdb_ds(sql, "count"); if (ds.Tables["count"].Rows.Count > 0) { Response.Cookies["admin"].Value = "yes"; Response.Cookies["admin_id"].Value = ds.Tables["count"].Rows[0]["aid"].ToString(); Response.Cookies["admin_group"].Value = Server.UrlEncode(ds.Tables["count"].Rows[0]["agroup"].ToString()); Response.Cookies["admin_name"].Value = Server.UrlEncode(ds.Tables["count"].Rows[0]["aname"].ToString()); Response.Redirect("/admin/"); } else { Response.Cookies["admin"].Value = "no"; Response.Redirect("/admin/"); MessageBox("error", "用户名或密码错误"); } }
public async Task <IActionResult> Putcheck(int id, check check) { if (id != check.checkId) { return(BadRequest()); } _context.Entry(check).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!checkExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
static void Main(string[] args) { //vector<int> x {1,2,5,6}; //removeif (x.begin(),x.end(), // [] (int a) {return a%2; }) // List<int> l = new List<int> { 1, 2, 4, 6, 4, 7, 2, 5 }; check ch = new check(isOdd); //l = filter(l, ch); l = filter(l, delegate (int value) { return (value % 2) == 1; } ); foreach (int x in l) { Console.WriteLine(x); } Man Eleonor = new Man("Eleonor Rigby"); Eleonor.WorkEnded += new EventHandler(ManWorkEndedHanler); Eleonor.Work(); }
protected void Page_Load(object sender, EventArgs e) { check ck = new check(); string u = "0"; u = ck.CheckNumber(GetRequestCookies("user_id", "0")); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = ""; sql = "SELECT Realname FROM TB_User WHERE userid = " + u; ds = cn.mdb_ds(sql, "tb_user"); ltrMyName.Text = ds.Tables["tb_user"].Rows[0][0].ToString(); //显示未读消息 sql = "select count(mid) as count from TB_PM where readed = 0 and listener = " + u; ds = cn.mdb_ds(sql, "tb_pm"); ltrPm.Text = ds.Tables["tb_pm"].Rows[0]["count"].ToString(); }
protected void Page_Load(object sender, EventArgs e) { //Session["uid"] = "1998090001"; if (Session["uid"] == null) //用户合法性检查 { Response.Redirect("login.aspx"); } else { string strUid = Session["uid"].ToString(); check cls = new check(); bool bPermit = cls.getPermit(strUid, "01"); if (!bPermit) { Response.Redirect("nonPermit.aspx"); } } sqlCon = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\StudentDB_Data.MDF;Integrated Security=True"); //创建数据库连接对象 if (!IsPostBack) { drpInstitute_content(); drpDept_content(); BindData(); } }
protected void Page_Load(object sender, EventArgs e) { check ck = new check(); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string orderid = ck.CheckInput(GetRequestQueryString("orderid", "")); string sql = ""; sql = ""; sql += "SELECT * FROM TB_ORDER WHERE order_code = '" + orderid + "'"; ds = cn.mdb_ds(sql, "order"); string order_type_string = ""; switch (ds.Tables["order"].Rows[0]["freight_type"].ToString()) { case "8": order_type_string = "fcl"; break; case "9": order_type_string = "lcl"; break; case "10": order_type_string = "air"; break; default: break; }//获得订单类型 Response.Redirect("/search/" + order_type_string + "_order.aspx?filter=view&role=forward&orderid=" + orderid); }
public JsonResult GetUserName(string userName) { check Check = new check(); Check.count = 0; try { var user = db.AspNetUsers.Where(x => x.UserName == userName); if (user.Count() > 0) { Check.count = 1; Check.by = user.Select(x => x.AspNetRoles.Select(y => y.Name).FirstOrDefault()).FirstOrDefault(); } else { Check.count = 0; } } catch { Check.count = 0; } return(Json(Check, JsonRequestBehavior.AllowGet)); }
protected void Page_Load(object sender, EventArgs e) { if (Session["uid"] == null) //用户合法性检查 { Response.Redirect("login.aspx"); //用户不合法则重定向到登录页面 } else //合法用户 { string strUid = Session["uid"].ToString(); //将帐号保存到Session变量中 check cls = new check(); bool bPermit = cls.getPermit(strUid, "04"); if (!bPermit) { Response.Redirect("nonPermit.aspx"); } } //连接数据库,为初始化窗体显示信息做准备 conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\StudentDB_Data.MDF;Integrated Security=True"); //创建数据库连接对象 if (!IsPostBack) //如果是第一次加载该页面 { drpInstitute_content(); //初始化“学院名称”下拉列表 drpDept_content(); //初始化“系别名称”下拉列表 drpCour_content(); //初始化“课程名称”下拉列表 } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { GetRequest GetRequest1 = new GetRequest(); check check1 = new check(); string pro1 = check1.CheckInput(CheckBox1.Checked == true ? "1" : "0"); //Response.Write(pro1 + ":" + pro2 + ":" + pro3 + ":" +pro4); string userid = check1.CheckInput(GetRequest1.GetRequestQueryString("user_id", "0")); string companyname = check1.CheckInput(TextBox1.Text); string realname = check1.CheckInput(TextBox2.Text); string gender = RadioButtonList1.SelectedValue; string rank = check1.CheckInput(TextBox3.Text); string phone = check1.CheckInput(TextBox4.Text + "-" + TextBox7.Text + "-" + TextBox8.Text); string movephone = check1.CheckInput(TextBox5.Text); string useremail = check1.CheckInput(TextBox6.Text); if (pro1 == "0") { MessageBox("", "您好!请至少选择一件产品"); } else { if (companyname == "" | realname == "" | gender == "" | rank == "" | TextBox7.Text == "" | TextBox8.Text == "" | movephone == "" | useremail == "") { MessageBox("", "您好!请将表格填写完整"); } else { data_conn cn = new data_conn(); string sql = ""; sql += "INSERT INTO TB_PRODUCTS_APPLY "; sql += "("; sql += "pro7,"; sql += "userid,"; sql += "companyname,"; sql += "realname,"; sql += "gender,"; sql += "rank,"; sql += "phone,"; sql += "movephone,"; sql += "useremail "; sql += ") VALUES ("; sql += "" + pro1 + ","; sql += "" + userid + ","; sql += "'" + companyname + "',"; sql += "'" + realname + "',"; sql += "'" + gender + "',"; sql += "'" + rank + "',"; sql += "'" + phone + "',"; sql += "'" + movephone + "',"; sql += "'" + useremail + "' "; sql += ")"; cn.mdb_exe(sql); Response.Redirect("success.aspx"); } } }
public Tutorial(string name, string instructions, Uri source, check checker, string fact = null) { _name = name; _fact = fact; _instructions = instructions; _source = source; _checker = checker; }
protected void Button1_Click(object sender, EventArgs e) { check ck = new check(); data_conn cn = new data_conn(); string sql = "update TB_En_News set title='" + txtTitle.Text + "',content='" + ck.CheckRecord(Editor1.Text) + "',Postdate='" + TextBox1.Text + "' where id=" + this.Request["id"].ToString(); cn.mdb_exe(sql); this.Response.Redirect("En_NewList.aspx"); }
public void insert() { //if (Session["cargo_a"] == "" | Session["cargo_a"] == null) //{ // Response.Redirect("../search/err.aspx"); //} //else //{ //} if (nums.Value != "" && BasicDatePicker1_TextBox.Value != "" && tbGoodsName.Value != "") { string typem = "", ISDANGER; DropDownList type = new DropDownList(); if (rbldange_0.Checked) { ISDANGER = "0"; } else { ISDANGER = "1"; } check ck = new check(); data_conn cn = new data_conn(); string column = "userId,price,TITLE,POSTDATE,LAUNCHDATE,AMOUNT,PAYMENT,NAME,DESCRIPTION,LINE,STARTPORT,DESTPORT,TYPE,TYPES,TYPEM,ISDANGER,showtel,showmo,showadd,showemail,showcom"; string value = this.Request.Cookies["user_id"].Value + ",'" + ck.CheckInput(price.Value) + "','" + ck.CheckInput(txttitle.Value) + "',getdate(),'" + ck.CheckInput(BasicDatePicker1_TextBox.Value) + "','" + ck.CheckInput(nums.Value) + "','" + ck.CheckInput(ddlPayType.SelectedValue) + "','" + ck.CheckInput(tbGoodsName.Value) + "','" + ck.CheckInput(tbremark.Value) + "','" + ck.CheckInput(DropDownList1.SelectedValue) + "','" + ck.CheckInput(StartPort.Value) + "','" + ck.CheckInput(CityName.Value) + "','" + ck.CheckInput(type1.SelectedValue) + "','" + ck.CheckInput(types.SelectedValue) + "','海运货盘'," + ISDANGER + "," + tureToInt(chkTel.Checked) + "," + tureToInt(chkMobile.Checked) + "," + tureToInt(chkAddress.Checked) + "," + tureToInt(chkEmail.Checked) + "," + tureToInt(chkCompany.Checked) + ""; cn.mdb_exe("insert into TB_AIRGOODS (" + column + ") values (" + value + ")"); Session["cargo_a"] = ""; Response.Redirect("cargolist.aspx"); } else { MessageBox("", "必填项不能为空"); } //if (IsValidate()) //{ // SymmetricMethod ss = new SymmetricMethod(); // if (ss.Encrypto(Session["validate"].ToString()) == this.Request["validate"].ToString()) // { // } // else // { // this.Response.Write("原来就是你这个SB啊"); // } //} //else //{ // this.Response.Write("原来就是你这个SB啊"); //} }
public EditCheckWindow(check check) { InitializeComponent(); _viewModel = DataContext as EditCheckViewModel; _viewModel?.Initilize(check); if (_viewModel != null) _viewModel.RegistrationEvent += _viewModel_RegistrationEvent; StatusComboBox.ItemsSource = ProjectSettings.DbContext.status_check.ToList(); StatusComboBox.DisplayMemberPath = "Text"; }
public void GetUserInfo() { check ck = new check(); string id = ck.CheckNumber(GetRequestCookies("user_id", "0")); data_conn cn = new data_conn(); DataSet ds = cn.mdb_ds("select * from TB_User where UserID=" + id, "user"); TextBox1.Text = ds.Tables["user"].Rows[0]["introduction"].ToString(); }
static List<int> filter(List<int> list, check ch) { List<int> result = new List<int>(); foreach(int x in list) { if (ch(x)) { result.Add(x); } } return result; }
static void Main(string[] args) { // Starting execution // Creating object of class check check chk = new check(); chk.accept(); //Invoking accept method chk.print(); //Invoking print method Console.ReadLine(); }
protected void Button1_Click(object sender, EventArgs e) { check ck = new check(); data_conn cn = new data_conn(); string sql = "update TB_BBS set title='" + txtTitle.Text + "',Data='" + ck.CheckRecord(content1.Value) + "',EditDate=getdate(),Postdate='" + BasicDatePicker1_TextBox.Value + "',types = " + DropDownList1.SelectedValue.ToString() + ",UserID=41 where id=" + this.Request["id"].ToString(); cn.mdb_exe(sql); //this.Response.Write(sql); this.Response.Redirect("NewList.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { check ck = new check(); data_conn cn = new data_conn(); string sql = "update TB_BBS set title='" + txtTitle.Text + "',Data='" + ck.CheckRecord(Editor1.Text) + "',EditDate=getdate(),Postdate='" + TextBox1.Text + "',UserID=381 where id=" + this.Request["id"].ToString(); cn.mdb_exe(sql); //this.Response.Write(sql); this.Response.Redirect("NewList.aspx"); }
void PageRecord() { check ck = new check(); string request; if (Request.ServerVariables["HTTP_REFERER"] == null) { request = ""; } else { request = Request.ServerVariables["HTTP_REFERER"].ToString(); request = ck.CheckRecord(request); } string page = Request.Url.ToString(); page = ck.CheckRecord(page); string pagefile = Request.Url.AbsolutePath.ToString(); pagefile = ck.CheckRecord(pagefile); string pagesql = "select pagearea from TB_PageArea where pageaddress = '" + pagefile + "'"; data_conn cn = new data_conn(); DataSet ds = new DataSet(); ds = cn.mdb_ds(pagesql, "TB_PageArea"); string pagearea = ""; if (ds.Tables["TB_PageArea"].Rows.Count > 0) { pagearea = ds.Tables["TB_PageArea"].Rows[0][0].ToString(); } string address = Page.Request.UserHostAddress; if (this.Request.Cookies["user_id"] == null) { string sql = "insert into TB_BrowseRecord (Userid,UserIP,Pageid,NowTime,Request,page,pagearea) values (0,'" + address + "',1,Getdate(),'" + request + "','" + page + "','" + pagearea + "')"; cn.mdb_exe(sql); } else { if (this.Request.Cookies["user_id"].Value == "") { string sql = "insert into TB_BrowseRecord (Userid,UserIP,Pageid,NowTime,Request,page,pagearea) values (0,'" + address + "',1,Getdate(),'" + request + "','" + page + "','" + pagearea + "')"; cn.mdb_exe(sql); } else { string a = this.Request.Cookies["user_id"].Value; string sql = "insert into TB_BrowseRecord (Userid,UserIP,Pageid,NowTime,Request,page,pagearea) values (" + this.Request.Cookies["user_id"].Value + ",'" + address + "',1,Getdate(),'" + request + "','" + page + "','" + pagearea + "')"; cn.mdb_exe(sql); } } }
public void LoadRecord(string page) { check ck = new check(); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = ""; //item是(页码-1)x10,用来计算分页用 int item = (Convert.ToInt32(page) - 1) * 15; sql = "select top 15 "; sql = sql + "* "; sql = sql + "FROM (select * from TB_Commodity where 1=1 "; if (this.Request["city"] != null) { sql = sql + " and city='" + this.Request["city"] + "' "; } sql = sql + ") AS T "; sql = sql + "WHERE id NOT IN "; sql = sql + "(SELECT TOP " + item.ToString() + " id "; sql = sql + "FROM "; sql = sql + "TB_Commodity "; sql = sql + "WHERE "; sql = sql + "1=1 "; if (this.Request["city"] != null) { sql = sql + " and city='" + this.Request["city"] + "' "; } sql = sql + " ORDER BY TB_Commodity.id desc "; sql = sql + ") "; sql = sql + "ORDER BY id desc"; ds = cn.mdb_ds(sql, "yunjia"); if (ds.Tables["yunjia"].Rows.Count != 0) { Hidden1.Value = ds.Tables["yunjia"].Rows[0]["description"].ToString(); for (int i = 1; i < ds.Tables["yunjia"].Rows.Count; i++) { Hidden1.Value += "$" + ds.Tables["yunjia"].Rows[i]["description"].ToString(); } } Repeater1.DataSource = ds.Tables["yunjia"].DefaultView; Repeater1.DataBind(); //计算页数 LoadTotalCount(); }
protected void Page_Load(object sender, EventArgs e) { GetRequest GetRequest1 = new GetRequest(); SymmetricMethod ss = new SymmetricMethod(); check ck = new check(); string uid = "0"; uid = ck.CheckNumber(GetRequest1.GetRequestQueryString("uid", "")); Response.Redirect("index.aspx?uid=" + ss.Encrypto(uid)); }
protected void Button1_Click(object sender, EventArgs e) { //Label1.Text = Editor1.Text; check ck = new check(); data_conn cn = new data_conn(); string sql = "insert into TB_Exhibition (title,detail,PostDate) values ('" + txtTitle.Text + "','" + ck.CheckRecord(Editor1.Text) + "',getdate())"; //this.Response.Write(sql); cn.mdb_exe(sql); this.Response.Redirect("ExhibitionList.aspx"); }
public async Task <IActionResult> Create([Bind("checkId,checkName")] check check) { if (ModelState.IsValid) { _context.Add(check); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(check)); }
protected void LoadRecord() { data_conn cn = new data_conn(); DataSet ds = new DataSet(); check ck = new check(); string date1 = ""; string date2 = ""; string sqldate1 = ""; string sqldate2 = ""; date1 = BasicDatePicker1_TextBox.Value.ToString(); date2 = BasicDatePicker2_TextBox.Value.ToString(); if (date1 != "") { date1 = date1 + " 00:00:00"; sqldate1 = sqldate1 + "AND PostDate >= '" + date1 + "' "; } if (date2 != "") { date2 = date2 + " 23:59:59"; sqldate2 = sqldate2 + "AND PostDate <= '" + date2 + "' "; } string sql = ""; sql = "select tb_user.userid,tb_user.username,tb_user.realname,tb_user.companyname,a.c "; sql += "from tb_user, "; sql += "(select userid,count(userid) as c from "; sql += "(select tb_yunjiainfo.id as yid,tb_yunjia.userid as userid,tb_yunjia.postdate as postdate "; sql += "from tb_yunjia,tb_yunjiainfo "; sql += "where tb_yunjia.id = tb_yunjiainfo.yunjiaid "; sql = sql + sqldate1; sql = sql + sqldate2; sql += "union all "; sql += "select T_AIRPRICE.id as yid,T_AIRINFO.userid as userid,T_AIRINFO.postdate as postdate "; sql += "from T_AIRINFO,T_AIRPRICE "; sql += "where T_AIRINFO.id = T_AIRPRICE.airid "; sql = sql + sqldate1; sql = sql + sqldate2; sql += ") t "; sql += "group by userid) a "; sql += "where tb_user.userid = a.userid and c >= 20 "; sql += "order by c desc "; //Response.Write(sql); ds = cn.mdb_ds(sql, "TB_BrowseRecord"); Repeater1.DataSource = ds.Tables["TB_BrowseRecord"].DefaultView; Repeater1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { GetRequest GetRequest1 = new GetRequest(); SymmetricMethod ss = new SymmetricMethod(); check ck = new check(); string uid = "0"; uid = ck.CheckNumber(GetRequest1.GetRequestCookies("user_id", "")); Literal1.Text = "<area shape=\"rect\" coords=\"533,672,844,732\" href=\"join.aspx?uid=" + ss.Encrypto(uid) + "\" />"; }
protected void Button1_Click(object sender, EventArgs e) { //Label1.Text = Editor1.Text; check ck = new check(); data_conn cn = new data_conn(); string sql = "update TB_Exhibition set title='" + txtTitle.Text + "',detail='" + ck.CheckRecord(Editor1.Text) + "',PostDate=getdate() where id=" + this.Request["id"].ToString(); //this.Response.Write(sql); cn.mdb_exe(sql); this.Response.Redirect("ExhibitionList.aspx"); }
public IEnumerable <check> Execute(PlanSetup ps) { // TODO: Add your code here. List <check> check_list = new List <check>(); check c1 = new check() { Name = "Target" }; bool t_exists = !String.IsNullOrEmpty(ps.TargetVolumeID); c1.Evaluation = t_exists ? "Target Volume: " + ps.TargetVolumeID : "No Target Volume"; c1.Result = t_exists ? "Pass" : "Fail"; check_list.Add(c1); //is max dose inside target volume. check c2 = new check() { Name = "Max Dose in Target" }; Structure target = ps.StructureSet.Structures.First(x => x.Id == ps.TargetVolumeID); c2.Evaluation = target.IsPointInsideSegment(ps.Dose.DoseMax3DLocation) ? $"Max Dose {ps.Dose.DoseMax3D} is inside {target.Id}" : $"Max Dose {ps.Dose.DoseMax3D} not in target"; c2.Result = target.IsPointInsideSegment(ps.Dose.DoseMax3DLocation) ? "Pass" : "Fail"; check_list.Add(c2); if (m_options["Modality"] == "IMRT") { //check if the LMC MU = Beam's MU double dmax = 0; double fmu = 0; Beam b = ps.Beams.First(); foreach (string line in b.CalculationLogs.First(x => x.Category == "LMC").MessageLines) { if (line.Contains("Maximum MU")) { dmax = Convert.ToDouble(line.Split('=').Last()); } if (line.Contains("Lost MU factor")) { fmu = Convert.ToDouble(line.Split('=').Last()); } } double lmc_mu = dmax * fmu; double b_mu = b.Meterset.Value; bool compare = Math.Abs(lmc_mu - b_mu) < 0.05 * b_mu; check c3 = new check() { Name = "MU renormalization" }; c3.Evaluation = $"LMC MU = {lmc_mu}; Beam MU = {b_mu}"; c3.Result = compare ? "Pass" : "Fail"; check_list.Add(c3); } return(check_list); }
public string GetCallbackResult() { try { //等待0.1秒显示结果,给予服务器缓冲时间,并增强浏览效果 System.Threading.Thread.Sleep(300); string[] p = returnValue.Split('|'); if (p[0] == "username") { //取表单上的用户名 check ck = new check(); string name; name = p[1]; //检查用户名是否被注册过 data_conn cn = new data_conn(); string sql = ""; sql = sql + "select * "; sql = sql + "from TB_User "; sql = sql + "where UserName = '******'"; DataSet ds = new DataSet(); ds = cn.mdb_ds(sql, "T_User"); if (ds.Tables["T_User"].Rows.Count > 0) { return "failed"; } else { return "success"; } } else if (p[0] == "verifycode") { if (string.Compare(p[1].ToString().Trim(), p[2].ToString().Trim(), true) != 0) { return "failed"; } else { return "success"; } } return ""; } catch (Exception ex) { return ex.ToString(); } }
public void LoadNews() { check ck = new check(); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string p = "1"; if (Request.QueryString["page"] != null) { p = ck.CheckInput(Request.QueryString["page"].ToString()); } int ps = (Convert.ToInt32(p) - 1) * 20; string sql = ""; sql = "SELECT TOP 20 * "; sql += "FROM "; sql += "TB_BBS "; sql += "WHERE TYPES = 5"; sql += "ORDER BY id DESC "; ds = cn.mdb_ds(sql, "news"); //Response.Write(sql); //Response.Write("<br/>"); //Response.Write(Request.Url.ToString()); Repeater4.DataSource = ds.Tables["news"].DefaultView; Repeater4.DataBind(); sql = "SELECT TOP 8 * "; sql += "FROM "; sql += "TB_BBS "; sql += "WHERE TYPES = 11"; sql += "ORDER BY id DESC "; ds = cn.mdb_ds(sql, "news"); //Response.Write(sql); //Response.Write("<br/>"); //Response.Write(Request.Url.ToString()); Repeater1.DataSource = ds.Tables["news"].DefaultView; Repeater1.DataBind(); sql = "select * from TB_IMGIndex where id = 4"; ds = cn.mdb_ds(sql, "news"); Literal1.Text = ds.Tables["news"].Rows[0]["txttitle"].ToString(); Literal2.Text = ds.Tables["news"].Rows[0]["txttext"].ToString(); Literal3.Text = "<a href=\"" + ds.Tables["news"].Rows[0]["txtlink"].ToString() + "\" target=\"_blank\"><img src=\"/images2/index/news_top.jpg\" border=\"0\" width=\"200\" height=\"150\" /></a>"; Literal4.Text = "<a href=\"" + ds.Tables["news"].Rows[0]["txtlink"].ToString() + "\" target=\"_blank\">"; Literal5.Text = "<a href=\"" + ds.Tables["news"].Rows[0]["txtlink"].ToString() + "\" target=\"_blank\">"; }
public void srchCustomerIDTest() { try { check obj = new check(); obj.generateRent("25/08/2019", 3); } catch (Exception ex) { Assert.Fail(); } }
private void filter_Click(object sender, EventArgs e) { using (Context dbcontext = new Context()) { if (numberFrom.Text != "" && numberTo.Text != "" && bankCombo.SelectedItem != null && pasvand.Text != "") { int from = int.Parse(numberFrom.Text); int tedad = int.Parse(numberTo.Text); if (tedad > 0) { string ischeck = ""; for (int i = 0; i < tedad; i++) { string checknumber = pasvand.Text + "/" + (from + i).ToString(); int selectedBank = int.Parse(bankCombo.SelectedValue.ToString()); List <check> isexist = dbcontext.checks.Where(x => x.checkNumber == checknumber && x.bankID == selectedBank).ToList(); if (isexist.Count() > 0) { ischeck = checknumber; } } if (ischeck == "") { for (int i = 0; i < tedad; i++) { string checknumber = pasvand.Text + "/" + (from + i).ToString(); check isexist = dbcontext.checks.SingleOrDefault(x => x.checkNumber == checknumber); if (isexist == null) { check model = new check() { bankID = int.Parse(bankCombo.SelectedValue.ToString()), isUsed = false, checkNumber = checknumber, }; dbcontext.checks.Add(model); } } dbcontext.SaveChanges(); DataTable dt = new DataTable(); checkList checkList = new checkList(dt); checkList.Show(); this.Hide(); } else { header.Text = "چک با شماره " + ischeck + " قبلا ثبت شده است "; } } } } }
public void init(string body) { if (tp <= 0 || tp > 3) { tp = 1; } if (size <= 0 || size > 6) { size = tp == 3 ? 4 : 2; } var c = new check(chk); sb_html.Append("<div class='li text " + name + " " + css + "' id='li_" + name + "' >"); if (string.IsNullOrEmpty(title)) { sb_html.Append(getinput(c)); } else if (title.Contains(" ")) { var ti = title.Split(' '); if (!string.IsNullOrEmpty(ti[0]) && !string.IsNullOrEmpty(ti[1])) { sb_html.Append("<div class='input-prepend input-append'>"); sb_html.Append("<span class='add-on'>" + ti[0] + "</span>"); sb_html.Append(getinput(c)); sb_html.Append("<span class='add-on'>" + ti[1] + "</span>"); } else if (!string.IsNullOrEmpty(ti[0])) { sb_html.Append("<div class='input-prepend'>"); sb_html.Append("<span class='add-on'>" + ti[0] + "</span>"); sb_html.Append(getinput(c)); } else { sb_html.Append("<div class='input-append'>"); sb_html.Append(getinput(c)); sb_html.Append("<span class='add-on'>" + ti[1] + "</span>"); } sb_html.Append("</div>"); } else { sb_html.AppendFormat("<label class='lbe' for='id_{0}'>" + (c.no ? "<span class='star'>*</span>" : "") + "{1}</label>", name, title + ":"); sb_html.Append(getinput(c)); } sb_html.Append("</div>"); }
void Update() { if (Input.GetKeyDown(KeyCode.E)) { chekcing++; } if (Input.GetKeyDown(KeyCode.Q)) { chekcing--; } chekcing = (check)Mathf.Clamp((int)chekcing, 0, 3); }
public ActionResult ReportAdmin(int?id) { dbChecks checkModel = new dbChecks(); checkList checkList = new checkList(); check_list _List = checkList.check_list.Find(id); check edit = checkModel.Checks.Find(id); string serverIp = "localhost"; string username = "******"; string password = ""; string databaseName = "bgcheck"; string dbConnectionString = string.Format("server={0};uid={1};pwd={2};database={3};", serverIp, username, password, databaseName); string query = "SELECT * FROM checks WHERE id = '" + id + "'"; var conn = new MySqlConnection(dbConnectionString); conn.Open(); TempData["checkID"] = id; var cmd = new MySqlCommand(query, conn); var reader = cmd.ExecuteReader(); while (reader.Read()) { var u_id = reader["check_id"]; TempData["checkID"] = u_id; } conn.Close(); string query1 = "SELECT * FROM check_list WHERE checks_id = '" + TempData["checkID"] + "'"; conn.Open(); var cmd1 = new MySqlCommand(query1, conn); var reader1 = cmd1.ExecuteReader(); while (reader1.Read()) { var checks = reader1["checks"]; TempData["checks"] = checks; } return(View(edit)); }
static void Main(string[] args) { Console.OutputEncoding = Encoding.Unicode; product[] products = new product[3]; products[0] = new product("Жаба", 50, 2); products[1] = new product("Дирижер", 100, 1); products[2] = new product("Дирижабль", 150, 1); check ch = new check(products); ch.printLikeSys(); Console.ReadKey(); Console.WriteLine(); ch.printOnEn_Us(); Console.ReadKey(); }
protected bool?check_priority(check ck1, check ck2) { if (ck1 == check.esatta && ck2 != check.esatta || ck1 == check.nulla && ck2 == check.errata) { return(true); } else if (ck2 == check.esatta && ck1 != check.esatta || ck2 == check.nulla && ck1 == check.errata) { return(false); } return(null); }
protected void Page_Load(object sender, EventArgs e) { if (Session["uid"] == null) //用户合法性检查 { Response.Redirect("login.aspx"); } else { string strUid = Session["uid"].ToString(); check cls = new check(); bool bPermit = cls.getPermit(strUid, "09"); if (!bPermit) { Response.Redirect("nonPermit.aspx"); } } }
public string Postlogin([FromBody] check value) { if (_context.check.Any(user => user.checkName.Equals(value.checkName))) { check User = _context.check.Where(u => u.checkName.Equals(value.checkName)).First(); if (value.checkName.Equals(User.checkName)) { return(JsonConvert.SerializeObject(User)); } else { return(JsonConvert.SerializeObject("wrong password")); } } else { return(JsonConvert.SerializeObject("user not exist")); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["uid"] == null) //用户合法性检查 { Response.Redirect("login.aspx"); } else { string strUid = Session["uid"].ToString(); check cls = new check(); //自定义权限检查类 bool bPermit = cls.getPermit(strUid, "07"); //判断当前帐号是否具有操作该模块的权限 if (!bPermit) //Permit为False,表示当前帐号无此权限,并重定向页面 { Response.Redirect("nonPermit.aspx"); } } if (!IsPostBack) { SqlConnection sqlCon = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\StudentDB_Data.MDF;Integrated Security=True"); //创建数据库连接对象 sqlCon.Open(); SqlCommand sqlComGet = new SqlCommand(); sqlComGet.Connection = sqlCon; sqlComGet.CommandText = "select U_id from tbl_UserInfo"; SqlDataReader sqlDr = sqlComGet.ExecuteReader(); //创建并实例化SqlDataReader对象 int i = 0; string[] strUid = new string[10]; //定义用户帐号数组 strUid[0] = "请选择"; //用户帐号数组的第0个元素为提示信息 drpUid.Items.Add(new ListItem(strUid[0], strUid[0])); //初始化drpUid下拉列表 while (sqlDr.Read()) //填充“用户帐号”下拉列表 { i = i + 1; strUid[i] = sqlDr.GetString(0); //从数据库中获得下一个用户帐号 drpUid.Items.Add(new ListItem(strUid[i], strUid[i])); } sqlDr.Close(); sqlCon.Close(); pnlUname.Enabled = false; //使Panel不可用 pnlLimits.Enabled = false; } }
string getinput(check c) { if (tp == 1) { return("<input type='text' id='id_" + name + "' name='" + name + "' x-check='" + c.ToString() + "' title='" + title + "' placeholder='" + (string.IsNullOrEmpty(tip) ? title : tip) + "' class='input-" + sizes[size - 1] + "' value='" + def + "' />"); } else if (tp == 2) { return("<input type='password' id='id_" + name + "' name='" + name + "' title='" + title + "' x-check='" + c.ToString() + "' placeholder='" + (string.IsNullOrEmpty(tip) ? title : tip) + "' class='input-" + sizes[size - 1] + "' value='" + def + "' />"); } else if (tp == 3) { return(string.Format("<textarea id='id_{0}' name='{0}' placeholder='{1}' x-check='{2}' class='input-{3}' title='" + title + "' >{4}</textarea>", name, string.IsNullOrEmpty(tip) ? title : tip, c.ToString(), sizes[size - 1], def)); } return(""); }
public string Post([FromBody] check value) { if (!_context.check.Any(user => user.checkId.Equals(value.checkId))) { check tblUser = new check(); // tblUser.checkId= value.checkId; tblUser.checkName = value.checkName; try { _context.Add(tblUser); _context.SaveChanges(); return(JsonConvert.SerializeObject("register succefully")); } catch (Exception ex) { return(JsonConvert.SerializeObject(ex.Message)); } } else { return(JsonConvert.SerializeObject("User is existing in database")); } }
private void textBox_TextChanged(object sender, TextChangedEventArgs e) { if (checkout_ph.Text != "PHONE NUMBER" && checkout_ph.Text != "" && Regex.Match(checkout_cc.Text + checkout_ph.Text, @"^([+91]\d[0-9]{11})$").Success) { check checkout = dbhandler.checkifPhonenumberavailable(checkout_cc.Text, checkout_ph.Text); { if (checkout.available) { checkout_cust.Text = checkout.customer.name; check_in_check chout = dbhandler.checkout_check(checkout_cc.Text + checkout_ph.Text); if (chout.available) { XmlDocument doc = new XmlDocument(); doc.Load("hotel_tariff.xml"); string[] hname = chout.customer.hotel_name.Split(','); string[] roomno = chout.customer.room_no.Split(','); string[] checkind = chout.customer.checkin_date.Split(','); string[] checkint = chout.customer.checkin_time.Split(','); string[] ckot = chout.customer.kot_amount.Split(','); string[] cpost = chout.customer.post_charges.Split(','); string[] ccount = chout.customer.no_of_persons.Split(','); string[] rtype = chout.customer.room_type.Split(','); string[] cdiscount = chout.customer.discount.Split(','); string[] cadvance = chout.customer.advance_paid.Split(','); string[] cadvance_use = chout.customer.advance_used.Split(','); string[] ckot_use = chout.customer.kot_paid.Split(','); string[] cpost_use = chout.customer.post_paid.Split(','); string[] croom_use = chout.customer.room_paid.Split(','); int room_count = 0, room_amount = 0; int size = roomno.Length; for (int i = 0; i < size - 1; i++) { string room_pcount = "", room_amt = "", room_xtra = "", room_pxtra = ""; XmlNode node = doc.DocumentElement; foreach (XmlNode pnode in node) { if (pnode.Attributes[0].InnerText == hname[i]) { XmlNodeList child = pnode.ChildNodes; foreach (XmlNode room in child) { if (room.Attributes[0].InnerText == rtype[i]) { foreach (XmlNode room_ch in room.ChildNodes) { if (room_ch.Name == "NUMBER") { room_pcount = room_ch.InnerText; } if (room_ch.Name == "NORMAL_TARIFF") { room_amt = room_ch.InnerText; } if (room_ch.Name == "EXTRA_TARIFF") { room_xtra = room_ch.InnerText; } if (room_ch.Name == "EXTRA") { room_pxtra = room_ch.InnerText; } } } } } } if (Convert.ToInt32(ccount[i]) == Convert.ToInt32(room_pcount)) { room_amount = Convert.ToInt32(room_amt); } else { room_amount = Convert.ToInt32(room_amt) + Convert.ToInt32(room_xtra); } TimeSpan diff = DateTime.Now.Date - DateTime.Parse(checkind[i]); TimeSpan cd = TimeSpan.Parse(checkint[i]); int chour = Convert.ToInt32(cd.Days); int d = Convert.ToInt32(diff.Days); if (DateTime.Now.Hour > 11) { d++; } if (chour < 10) { d++; } int val = i + 1; discount = Convert.ToDouble(cdiscount[i]); advance = Convert.ToDouble(cadvance[i]); advance_used = Convert.ToBoolean(cadvance_use[i]); kot_used = Convert.ToBoolean(ckot_use[i]); post_used = Convert.ToBoolean(cpost_use[i]); room_used = Convert.ToBoolean(croom_use[i]); double kd = Convert.ToDouble(ckot[i]) - (Convert.ToDouble(ckot[i]) * (discount / 100)); double kp = Convert.ToDouble(cpost[i]) - (Convert.ToDouble(cpost[i]) * (discount / 100)); double kr = Convert.ToDouble(d * room_amount) - (Convert.ToDouble(d * room_amount) * (discount / 100)); if (kot_used) { kd = 0; } if (post_used) { kp = 0; } if (room_used) { kr = 0; } _items.Add(new Item { NUM = (val).ToString(), ROOMNO = roomno[i], CHECKIN = checkind[i] + " " + checkint[i], KOT = kd.ToString(), POST = kp.ToString(), TARIFF = kr.ToString(), kot_check = false, post_check = false, room_check = false, all_check = false, all_dis = true }); d = 0; chour = 0; } advance_checkbox.IsEnabled = !advance_used; checkout_adv.Text = (advance).ToString(); checkout_dist.Text = (discount).ToString(); dataGrid.ItemsSource = Items; } } else { MaterialMessageBox.ShowError(@"customer doesn't exist"); } } } }
private void filter_Click(object sender, EventArgs e) { var tamintxt = tamin.Text; if (tamintxt == "") { header.Text = "تامین انتخاب نشده است"; header.ForeColor = Color.Red; return; } tamin model = context.tamins.SingleOrDefault(x => x.shomareSanad == tamintxt); if (model == null) { header.Text = "شماره تامین وجود ندارد"; header.ForeColor = Color.Red; return; } Context dbcontext = new Context(); string sanad = shomareSanad1.Text; if (sanad == "") { header.Text = "شماره سند انتخاب نشده است"; header.ForeColor = Color.Red; return; } Int64 mbl = model.mablagh; string shenasnameTitle = model.shnesnameTitle; archive pastmodel = dbcontext.Archives.SingleOrDefault(x => x.shomareTamin == tamintxt && x.shomareSanad == sanad); if (pastmodel != null) { header.Text = "برای پارامتر های موجود فاکتور انتخاب شده است"; header.ForeColor = Color.Red; return; } functions fns = new functions(); var directory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string mrk = ""; mrk = (from sh in dbcontext.shenasnames join ma in dbcontext.markazs on sh.markaz equals ma.parent where sh.title == shenasnameTitle select ma).First().title; string root = Path.Combine(directory, "FIM"); System.IO.Directory.CreateDirectory(root); string markazPath = Path.Combine(root, mrk); System.IO.Directory.CreateDirectory(markazPath); string shenasnamePath = Path.Combine(markazPath, shenasnameTitle); System.IO.Directory.CreateDirectory(shenasnamePath); string pardPath = Path.Combine(shenasnamePath, "فاکتور های پرداختی"); System.IO.Directory.CreateDirectory(pardPath); string sourcAddress = sourceLable.Text; string trkh = date.GetSelectedDateInPersianDateTime().ToShortDateString().Replace("/", ""); string finalPrice = ""; float intprice = model.mablagh; if (intprice / 1000000 > 1) { finalPrice = (intprice / 1000000) + "MT"; } else { finalPrice = (intprice / 1000) + "HT"; } string finalname = ""; if (bank.Text == "") { finalname = "تامینی" + "_" + shomareSanad1.Text + Path.GetExtension(sourcAddress); } else { string sv = checkNumber.SelectedValue.ToString(); finalname = "check" + "_" + bank.Text + "_" + sv + Path.GetExtension(sourcAddress); } imageName.Text = Path.Combine(pardPath, finalname).Replace(directory, ""); string finalPath = pardPath + "\\" + finalname; bool isreferbish = referbish.Text == "0" ? false : true; DateTime trk = date.GetSelectedDateInPersianDateTime().ToShortDateString().ToGeorgianDateTime(); archive newITem = new archive() { radif = "", mablagh = 0, markaz = "", project = "", shnesnameTitle = "", radifTitle = "", shomareSanad = sanad, shomareTamin = tamintxt, subject = "", tarikh = trk, type = "", hesab = "0", imageName = imageName.Text, bankName = bank.Text, checkNumber = checkNumber.Text, referbish = isreferbish }; check checkitem = context.checks.SingleOrDefault(x => x.checkNumber == checkNumber.Text); checkitem.isUsed = true; context.Archives.Add(newITem); context.SaveChanges(); System.IO.File.Move(sourcAddress, finalPath); DataTable dt = new DataTable(); PardakhtiReport daryaftirp = new PardakhtiReport(dt); daryaftirp.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { WriteLog.WriteError("初始化成功*****************************"); string mcode = im.eyLogin.GetMachineCode(); if (mcode == "37797B15343158143F7C7B15CA627BDE" || im.commonHelp.checkT(mcode)) { //if (true) //{ //模拟器选择 int dm_ret = 0; dm_ret = dmae.BindWindow(); if (dm_ret == 0) { MessageBox.Show("绑定窗口错误"); } dmae.SetDict();//设置系统路径和字典 if (im.commonHelp.CheckClientSize(dmae) == false) { MessageBox.Show(" 当前分辨率有问题,脚本将会出错。 "); } if (dm_ret == 1) { //注意这里要检查UICFG版本号 //if (Settings.Default.FirstTimeU == true) //{ // MessageBox.Show("检测到第一次运行,请校对颜色", "少女前线"); // var SetColor = new SetColor(im); // SetColor.StartPosition = FormStartPosition.CenterParent; // SetColor.ShowDialog(this); //} im.Form1.button1.Enabled = false; im.Form1.button8.Enabled = true; im.Form1.button9.Enabled = true; im.Form1.button10.Enabled = true; im.Form1.button11.Enabled = true; im.Form1.button12.Enabled = true; im.Form1.button13.Enabled = true; im.Form1.button2.Enabled = true; im.Form1.button16.Enabled = true; im.Form1.button6.Enabled = true; im.Form1.button5.Enabled = true; im.Form1.button3.Enabled = true; im.Form1.button7.Enabled = true; im.Form1.button15.Enabled = true; im.Form1.button17.Enabled = true; im.Form1.button18.Enabled = true; im.Form1.button19.Enabled = true; im.Form1.button20.Enabled = true; im.Form1.button34.Enabled = true; im.Form1.button21.Enabled = true; im.Form1.button35.Enabled = true; im.Form1.button36.Enabled = true; im.Form1.button37.Enabled = true; im.Form1.button38.Enabled = true; im.Form1.button39.Enabled = true; im.CountDown = new Thread(im.backGroundThread.CountDown); im.CountDown.IsBackground = true; im.CountDown.Start(); im.CompleteMisson = new Thread(im.backGroundThread.CompleteMisson); im.CompleteMisson.IsBackground = true; im.CompleteMisson.Start(); im.ThreadT = new Thread(im.backGroundThread.ThreadT); im.ThreadT.IsBackground = true; im.ThreadT.Start(); im.MonitorPic = new Thread(im.backGroundThread.MonitorPic);//2线程用于监控,如闪退 im.MonitorPic.IsBackground = true; im.MonitorPic.Start(); WriteLog.WriteError("初始化成功*****************************"); } else { //if(variables.Simulator == 0)//使用的是猩猩模拟器 { if (dm_ret == -2) { MessageBox.Show("-2找不到游戏窗口句柄,请尝试手动指定", "少女前线"); } if (dm_ret == -1) { MessageBox.Show("-1因为模拟器有保护,或者模拟器没有以管理员权限打开导致初始化失败", "少女前线"); } if (dm_ret == 0) { MessageBox.Show("0因为模拟器有保护,或者模拟器没有以管理员权限打开导致初始化失败", "少女前线"); } if (dm_ret == -81) { MessageBox.Show("此窗口不适合ogl模式导致初始化失败", "少女前线"); } if (dm_ret == -91) { MessageBox.Show("此窗口不适合ogl模式导致初始化失败", "少女前线"); } if (dm_ret == -92) { MessageBox.Show("-92因为模拟器有保护,或者模拟器没有以管理员权限打开导致初始化失败", "少女前线"); } } } } //验证失败代码 else { var Battle = new check(mcode); Battle.StartPosition = FormStartPosition.CenterParent; Battle.ShowDialog(this); } }//初始化按钮
void ITemplate.InstantiateIn(System.Web.UI.Control container) { switch (_templateType) { case ListItemType.Header: { _iField++; if (_typeCtrl != TypeTemplateCol.action && _typeCtrl != TypeTemplateCol.action_url && _typeCtrl != TypeTemplateCol.request && _typeCtrl != TypeTemplateCol.tabledel && _typeCtrl != TypeTemplateCol.tablelink) { html_ctrl fld = new html_ctrl("div", new attrs(new string[, ] { { "class", "header-col" } })); // titolo colonna attrs atrs = new attrs(new string[, ] { { "colgrid", "true" }, { "oncontextmenu", "col_contextmenu('" + _grid_id + "', '" + _fld_name + "')" } }); XmlNode h_node = refHeader(); ctrl c_title = h_node != null ? (ctrl) new link(_col_title, xmlDoc.node_val(h_node, "title") != "" ? xmlDoc.node_val(h_node, "title") : _col_des, "title-col" , _page.page.parse(h_node.Attributes["ref"].Value), atrs) : (ctrl) new label(_col_title, "title-col", _col_des, atrs); fld.add(c_title.control); // freccine ordinamento string direction; bool sorted = grid_ctrl.find_sort_field(grid_ctrl.xmlOfGrid(_page, _grid_id), _fld_name, out direction); ctrl f_ctrl = new div(null, "<div class='arrows' title=\".\" " + " field_name='" + _fld_name + "' onclick=\"updateGridSort('" + _grid_id + "', '" + _fld_name + "')\" oncontextmenu=\"col_contextmenu('" + _grid_id + "', '" + _fld_name + "')\">" + (!sorted ? "<a class='mif-arrow-up arrow-col'></a>" : (direction.ToLower() == "asc" ? "<a class='mif-arrow-up arrow-col-active'></a>" : "<a class='mif-arrow-down arrow-col-active'></a>")) + "</div>"); fld.add(f_ctrl.control); container.Controls.Add(fld.control); } } break; case ListItemType.Item: { _iField++; // creazione del controllo WebControl ctrl = null; bool notTransparent = false; if (_typeCtrl == TypeTemplateCol.text) { ctrl = refItem() != null ? new link(new EventHandler(textlink_DataBinding)).w_ctrl : new text(new EventHandler(text_DataBinding), true).w_ctrl; } else if (_typeCtrl == TypeTemplateCol.integer) { ctrl = refItem() != null ? new link(new EventHandler(intlink_DataBinding)).w_ctrl : new label(new EventHandler(int_DataBinding)).lbl; } else if (_typeCtrl == TypeTemplateCol.euro) { ctrl = refItem() != null ? new link(new EventHandler(eurolink_DataBinding)).w_ctrl : new label(new EventHandler(euro_DataBinding)).lbl; } else if (_typeCtrl == TypeTemplateCol.real) { ctrl = refItem() != null ? new link(new EventHandler(reallink_DataBinding)).w_ctrl : new label(new EventHandler(real_DataBinding)).lbl; } else if (_typeCtrl == TypeTemplateCol.check) { ctrl = new check(_page.newIdControl, new EventHandler(check_DataBinding), false).w_ctrl; } else if (_typeCtrl == TypeTemplateCol.date || _typeCtrl == TypeTemplateCol.date_hour) { if (refItem() != null) { throw new Exception("refitem non supportato per la colonna 'date'"); } else { ctrl = new label(new EventHandler(date_DataBinding)).lbl; } } else if (_typeCtrl == TypeTemplateCol.link) { ctrl = new link(new EventHandler(link_DataBinding)).w_ctrl; } else if (_typeCtrl == TypeTemplateCol.action) { notTransparent = true; ctrl = new link(new EventHandler(action_DataBinding), _icon + " icon-btn").w_ctrl; } else if (_typeCtrl == TypeTemplateCol.action_url) { notTransparent = true; ctrl = new link(new EventHandler(actionurl_DataBinding), _icon + " icon-btn").w_ctrl; } else if (_typeCtrl == TypeTemplateCol.request) { notTransparent = true; ctrl = new link(new EventHandler(request_DataBinding), _icon + " icon-btn").w_ctrl; } else if (_typeCtrl == TypeTemplateCol.tabledel) { notTransparent = true; ctrl = new link(new EventHandler(requestDel_DataBinding), _icon + " icon-btn").w_ctrl; } else if (_typeCtrl == TypeTemplateCol.tablelink) { notTransparent = true; ctrl = new link(new EventHandler(requestLink_DataBinding), _icon + " icon-btn").w_ctrl; } else { throw new Exception("campo '" + _typeCtrl.ToString() + "' non supportato!"); } // aggiunta controllo alla griglia if (ctrl != null) { if (_typeCtrl == TypeTemplateCol.action || _typeCtrl == TypeTemplateCol.action_url || _typeCtrl == TypeTemplateCol.request || _typeCtrl == TypeTemplateCol.tabledel || _typeCtrl == TypeTemplateCol.tablelink) { ctrl.ToolTip = _col_des; } if (xmlDoc.node_bool(_colNode, "show_title")) { ctrl.Attributes.Add("show_title", "true"); } ctrl.Style.Add(HtmlTextWriterStyle.Width, "95%"); if (!notTransparent) { ctrl.Style.Add(HtmlTextWriterStyle.BackgroundColor, "transparent"); } container.Controls.Add(ctrl); } } break; case ListItemType.EditItem: //... break; case ListItemType.Footer: { _iField++; // creazione del controllo WebControl ctrl = null; if (_typeCtrl == TypeTemplateCol.euro) { ctrl = new label(new EventHandler(eurosum_DataBinding)).lbl; } else if (_typeCtrl == TypeTemplateCol.real) { ctrl = new label(new EventHandler(realsum_DataBinding)).lbl; } else { throw new Exception("campo '" + _typeCtrl.ToString() + "' non supportato!"); } // aggiunta controllo alla griglia if (ctrl != null) { ctrl.ToolTip = _col_des; ctrl.Style.Add(HtmlTextWriterStyle.Width, "95%"); ctrl.Style.Add(HtmlTextWriterStyle.BackgroundColor, "transparent"); container.Controls.Add(ctrl); } } break; } }