public void preencheBotoes() { info = GameObject.FindObjectOfType <StaticValue>(); Button [] arr = pegaArray(ParentPanel); int[] selection = new int[arr.Length]; int[] insertion = new int[arr.Length]; int[] shell = new int[arr.Length]; int[] bubble = new int[arr.Length]; int[] quick = new int[arr.Length]; for (int i = 0; i < arr.Length; i++) { selection[i] = int.Parse(arr[i].GetComponentInChildren <Text>().text); insertion[i] = int.Parse(arr[i].GetComponentInChildren <Text>().text); shell[i] = int.Parse(arr[i].GetComponentInChildren <Text>().text); bubble[i] = int.Parse(arr[i].GetComponentInChildren <Text>().text); quick[i] = int.Parse(arr[i].GetComponentInChildren <Text>().text); } bubbleSort(bubble); selectionSort(selection); insertionSort(insertion); shellSort(shell); quickSort(quick, 0, quick.Length - 1); info.lerOperacoes(comparacoesSelection, comparacoesInsertion, comparacoesShell, comparacoesBubble, comparacoesQuick, trocasSelection, trocasInsertion, trocasShell, trocasBubble, trocasQuick); }
void Start() { gerador = GameObject.FindObjectOfType <GeradorNumerosRandom>(); info = GameObject.FindObjectOfType <StaticValue>(); ordenacao = GameObject.FindObjectOfType <MetodosOrdenacao>(); contador = GameObject.FindObjectOfType <Contador>(); gerador.gerarNumeros(); contador.preencheBotoes(); string metodo = info.getMetodo(); if (metodo == "btnSelection") { ordenacao.selection(); } else if (metodo == "btnInsertion") { ordenacao.insertion(); } else if (metodo == "btnShell") { ordenacao.shell(); } else if (metodo == "btnBubble") { ordenacao.bubble(); } else if (metodo == "btnQuick") { ordenacao.quick(); } }
//public PayDetail Clone() //{ // return (PayDetail)MemberwiseClone(); //} /// <summary>检查消费明细中是否存在相同商品。</summary> /// <param name="detailid">消费明细流水号</param> /// <returns></returns> public int ExistsPostSPItems(string payid, int itemid) { string strSql = "select * from paydetails where pdpid='" + payid + "' and pdiid=" + itemid; DataTable objDataTable = StaticValue.SelectTable(strSql); return(objDataTable.Rows.Count); }
/// <summary>查询会员充值记录。</summary> /// <param name="memberid">会员编号</param> /// <param name="year">年</param> /// <param name="month">月</param> /// <param name="day">日</param> /// <returns></returns> public List <Deposit> SelectList(string memberid, int year, int month, int day) { string strSql = "select * from deposit where 1=1"; if (memberid != "") { strSql += " and dmid='" + memberid + "'"; } if (year > 0) { strSql += " and datepart(year,ddate)=" + year; } if (month > 0) { strSql += " and datepart(month,ddate)=" + month; } if (day > 0) { strSql += " and datepart(day,ddate)=" + day; } DataTable objDataTable = StaticValue.SelectTable(strSql); List <Deposit> lstDeposit = new List <Deposit>(); foreach (DataRow objRow in objDataTable.Rows) { lstDeposit.Add(this.GetDepositForDataRow(objRow)); } return(lstDeposit); }
/// <summary>会员信息管理。</summary> /// <param name="mid">会员编号</param> public Member(string mid) { this.UpdateBalance(mid); string strSql = "select * from member where mid='" + mid + "'"; DataRow objRow = StaticValue.SelectTable(strSql).Rows[0]; this.ID = objRow["mid"].ToString(); this.Name = objRow["mname"].ToString(); this.Status = int.Parse(objRow["mstatus"].ToString()); this.CardID = int.Parse(objRow["mcid"].ToString()); this.Password = objRow["mpass"].ToString(); this.Remark = objRow["mremark"].ToString(); this.Sex = int.Parse(objRow["msex"].ToString()); this.Month = int.Parse(objRow["mmonth"].ToString()); this.Day = int.Parse(objRow["mday"].ToString()); this.Phone = objRow["mphone"].ToString(); this.Address = objRow["maddress"].ToString(); this.Other = objRow["mother"].ToString(); this.JoinDate = DateTime.Parse(objRow["mjoin"].ToString()); this.IDCard = objRow["midcard"].ToString(); this.Balance = decimal.Parse(objRow["mbalance"].ToString()); this.Point = int.Parse(objRow["mpoint"].ToString()); try { this.LastTime = DateTime.Parse(objRow["mlastime"].ToString()); } catch { } }
/// <summary>获取会员消费总金额。</summary> /// <param name="memberid">会员卡号</param> /// <param name="type">支付方式(只能输入0现金或1余额)</param> /// <param name="year">年</param> /// <param name="month">月</param> /// <param name="day">日</param> /// <returns></returns> public static decimal GetTotalPayForMember(string memberid, int type, int year, int month, int day) { string strSql = "select sum(pmoney) from pays where ptype=" + type; if (memberid != "") { strSql += " and pmid='" + memberid + "'"; } if (year > 0) { strSql += " and datepart(year,pdate)=" + year; } if (month > 0) { strSql += " and datepart(month,pdate)=" + month; } if (day > 0) { strSql += " and datepart(day,pdate)=" + day; } DataTable objDataTable = StaticValue.SelectTable(strSql); try { return(decimal.Parse(objDataTable.Rows[0][0].ToString())); } catch { } return(0); }
/// <summary>统计会员充值金额(只计算正常充值金额)。</summary> /// <returns></returns> public decimal GetMembersMoney(int year, int month, int day) { string strSql = "select sum(dmoney) from deposit where dmode=0"; if (year > 0) { strSql += " and datepart(year,ddate)=" + year; } if (month > 0) { strSql += " and datepart(month,ddate)=" + month; } if (day > 0) { strSql += " and datepart(day,ddate)=" + day; } DataTable objDataTable = StaticValue.SelectTable(strSql); try { return(decimal.Parse(objDataTable.Rows[0][0].ToString())); } catch { } return(0); }
private void btnOK_Click(object sender, EventArgs e) { if (this.txtNewID.Text.Trim() == "") { MessageBox.Show("【转入会员卡号】不能为空,请输入。", "消息", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.txtNewID.Focus(); return; } if (StaticValue.ValidateMember(this.txtNewID.Text.Trim()) == "") { MessageBox.Show("【转入会员卡号】不存在,请重新输入。", "消息", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.txtNewID.Focus(); return; } if (new Member(this.txtNewID.Text.Trim()).Status == 1) { MessageBox.Show("【转入会员卡号】已停用,不能转账,请重新输入。", "消息", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.txtNewID.Focus(); return; } if (this.txtNewID.Text.Trim() == this._strMemberId) { MessageBox.Show("【转入会员卡号】与转出会员卡号相同,请重新输入。", "消息", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.txtNewID.Focus(); return; } if (this.numMoney.Value <= 0) { MessageBox.Show("【转入金额】必须大于0元,请重新输入。", "消息", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.numMoney.Focus(); return; } //转出 Deposit objDeposit = new Deposit(); objDeposit.Mode = 1; objDeposit.MemberID = this._strMemberId; objDeposit.Money = 0 - this.numMoney.Value; objDeposit.Date = DateTime.Now; objDeposit.Remark = "余额转账:转入到卡号" + this.txtNewID.Text.Trim(); //转入 Deposit objDeposit2 = new Deposit(); objDeposit2.Mode = 2; objDeposit2.MemberID = this.txtNewID.Text.Trim(); objDeposit2.Money = this.numMoney.Value; objDeposit2.Date = objDeposit.Date; objDeposit2.Remark = "余额转账:从卡号" + this._strMemberId + "转出"; if (objDeposit.Transfer(objDeposit2)) { new Member().UpdateBalance(this._strMemberId); //更新会员余额 new Member().UpdateBalance(this.txtNewID.Text.Trim()); //更新会员余额 DialogResult = DialogResult.OK; } this.Close(); }
// Start is called before the first frame update void Start() { info = GameObject.FindObjectOfType <StaticValue>(); txt = gameObject.GetComponent <Text>(); //txt.text = "Teste"; imprimeTexto(info.getMetodo()); }
protected override void ExecuteChild(OauthLoginReq dataReq, ResponseAPI dataRes) { DBMode = dataReq.DBMode; dataRes.ServerAddr = ConnectionString(); ASSETKKF_ADO.Mssql.Asset.muTokenAdo.GetInstant().Delete(this.Token, dataReq.usercode, null, conString); StaticValue.GetInstant().TokenKey(); }
/// <summary>获取员工数量</summary> /// <param name="postid">职位编号</param> /// <returns></returns> public int GetEmployeeNumber(int postid) { string strSql = "select count(*) from employee where epid=" + postid; DataTable objDataTable = StaticValue.SelectTable(strSql); int iCount = int.Parse(objDataTable.Rows[0][0].ToString()); return(iCount); }
/// <summary>检查员工工号是否存在(除离职外)。</summary> /// <param name="code">工号</param> /// <returns>员工ID</returns> public int ExistsEmployeeCode(int code) { string strSql = "select * from employee where estatus<>3 and ecode=" + code; DataTable objDataTable = StaticValue.SelectTable(strSql); if (objDataTable.Rows.Count > 0) { return int.Parse(objDataTable.Rows[0]["eid"].ToString()); } return 0; }
/// <summary>会员卡类型管理。</summary> /// <param name="cid">会员类型标识</param> public Card(int cid) { string strSql = "select * from card where cid=" + cid; DataRow objRow = StaticValue.SelectTable(strSql).Rows[0]; this.CardId = int.Parse(objRow["cid"].ToString()); this.CardName = objRow["cname"].ToString(); this.Discount = double.Parse(objRow["cdiscount"].ToString()); this.Money = decimal.Parse(objRow["cmoney"].ToString()); }
/// <summary>获取员工奖/扣金额</summary> /// <param name="empid"></param> /// <param name="year"></param> /// <param name="month"></param> /// <param name="type">类型(0扣,1奖)</param> /// <returns></returns> public decimal GetMoney(int empid, int year, int month, int type) { string strSql = "select sum(emmoney) from emp_money where empid=" + empid + " and emtype=" + type + " and datepart(year,emtime)=" + year + " and datepart(month,emtime)=" + month; try { return(decimal.Parse(StaticValue.SelectTable(strSql).Rows[0][0].ToString())); } catch { } return(0); }
/// <summary>科目管理。</summary> /// <param name="subId">科目标识(ID)</param> public Subject(int subId) { string strSql = "select * from subject where sid=" + subId; DataRow objRow = StaticValue.SelectTable(strSql).Rows[0]; this.ID = int.Parse(objRow["sid"].ToString()); this.Name = objRow["sname"].ToString(); this.Type = int.Parse(objRow["stype"].ToString()); this.Readme = objRow["sreadme"].ToString(); this.IsEnabled = int.Parse(objRow["senabled"].ToString()); }
private BASE() { conn = null; dbDetail = new DBConnection(); dbDetail.ip = "52.79.127.111"; dbDetail.port = "8086"; dbDetail.uid = "hsai"; dbDetail.passwd = "han401#"; val = new StaticValue(); }
/// <summary>检查商品名称是否存在。</summary> /// <param name="name">商品名称</param> /// <returns></returns> public int ExistsPostName(string name) { string strSql = "select * from items where iname='" + name + "'"; DataTable objDataTable = StaticValue.SelectTable(strSql); if (objDataTable.Rows.Count > 0) { return(int.Parse(objDataTable.Rows[0]["iid"].ToString())); } return(0); }
/// <summary>员工奖扣款记录。</summary> public EmpMoney(decimal id) { string strSql = "select* from emp_money where emid=" + id; DataRow objRow = StaticValue.SelectTable(strSql).Rows[0]; this.ID = decimal.Parse(objRow["emid"].ToString()); this.Money = decimal.Parse(objRow["emmoney"].ToString()); this.Type = int.Parse(objRow["emtype"].ToString()); this.Remark = objRow["emremark"].ToString(); this.Date = DateTime.Parse(objRow["emtime"].ToString()); this.EmpId = int.Parse(objRow["empid"].ToString()); }
private void frmSeleniumSchemacs_Load(object sender, EventArgs e) { try { //StaticValue.LoadSeleniumSchema(dgvSelenium); StaticValue.GetAllSeleniumSchema(treeSchemas, ""); } catch (Exception er) { MessageBox.Show(er.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
/// <summary>消费明细。</summary> /// <param name="detailid">消费单号</param> public PayDetail(decimal detailid) { string strSql = "select * from paydetails where pdid=" + detailid; DataRow objRow = StaticValue.SelectTable(strSql).Rows[0]; this.DetailID = decimal.Parse(objRow["pdid"].ToString()); this.PayID = objRow["pdpid"].ToString(); this.ItemID = int.Parse(objRow["pdiid"].ToString()); this.Number = int.Parse(objRow["pdnum"].ToString()); this.Bonus = double.Parse(objRow["pbonus"].ToString()); this.Money = decimal.Parse(objRow["pmoney"].ToString()); }
/// <summary>收支流水账。</summary> /// <param name="id">ID流水号</param> public WasteBook(decimal id) { string strSql = "select * from wastebook where wbid=" + id; DataRow objRow = StaticValue.SelectTable(strSql).Rows[0]; this.ID = decimal.Parse(objRow["wbid"].ToString()); this.SubjectID = int.Parse(objRow["wbsid"].ToString()); this.Income = decimal.Parse(objRow["wbincome"].ToString()); this.Expend = decimal.Parse(objRow["wbexpend"].ToString()); this.Date = DateTime.Parse(objRow["wbdate"].ToString()); this.Remark = objRow["wbremark"].ToString(); this.Type = objRow["wbtype"].ToString(); }
/// <summary>职位信息管理。</summary> /// <param name="pid">职位标识(ID)</param> public Post(int pid) { string strSql = "select * from post where pid=" + pid; DataRow objRow = StaticValue.SelectTable(strSql).Rows[0]; this.ID = int.Parse(objRow["pid"].ToString()); this.Name = objRow["pname"].ToString(); this.Readme = objRow["preadme"].ToString(); this.Mode = int.Parse(objRow["pmode"].ToString()); this.Sort = int.Parse(objRow["psort"].ToString()); this.Salary = decimal.Parse(objRow["psalary"].ToString()); this.Bonus = double.Parse(objRow["pbonus"].ToString()); }
/// <summary>会员续费</summary> /// <param name="did">续费记录流水号</param> public Deposit(decimal id) { string strSql = "select * from deposit where did=" + id; DataTable objDataTable = StaticValue.SelectTable(strSql); DataRow objRow = objDataTable.Rows[0]; this.ID = decimal.Parse(objRow["did"].ToString()); this.MemberID = objRow["dmid"].ToString(); this.Money = decimal.Parse(objRow["dmoney"].ToString()); this.Date = DateTime.Parse(objRow["ddate"].ToString()); this.Remark = objRow["dremark"].ToString(); this.Mode = int.Parse(objRow["dmode"].ToString()); this.ParentID = decimal.Parse(objRow["dparentid"].ToString()); }
private void LoadSchema(SeleniumSchemaEntity seleniumSchemaEntity) { if (seleniumSchemaEntity != null) { txtSchemaID.Text = seleniumSchemaEntity.Id; txtSchemaName.Text = seleniumSchemaEntity.Name; StaticValue.LoadSeleniumSchema(dgvSelenium, seleniumSchemaEntity); } else { txtSchemaID.Text = ""; txtSchemaName.Text = ""; } }
private void FrmCopyProdefSchema_Load(object sender, EventArgs e) { try { _opaqueCommand.ShowOpaqueLayer(this, 125, true); /* _prodefId = "2d107839-0de3-11e6-b878-000c2984e60c"; * var temp = StaticValue.ServicePath;*/ StaticValue.LoadProdefList(_prodefId, dgvChildProdef, ""); LoadProdefTree(); } catch (Exception er) { MessageBox.Show(er.Message, @"警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
/// <summary>收入</summary> public decimal GetIncomeMoney(int year, int month, int day) { string strSql = "select sum(wbincome) from wastebook where datepart(year,wbdate)=" + year + " and datepart(month,wbdate)=" + month + " and wbtype='i'"; if (day > 0) { strSql += " and datepart(day,wbdate)=" + day; } DataTable objTable = StaticValue.SelectTable(strSql); try { return(decimal.Parse(objTable.Rows[0][0].ToString())); } catch { } return(0); }
private void frmAddElementInfo_Load(object sender, EventArgs e) { try { StaticValue.LoadLocationElementType(cmbChildLoactionType); StaticValue.LocadLocationOpearateType(cmbChildOperateType, false); //selectIframe = "1c8dd507-0790-4338-9173-0fe90c3df281"; //childElementId = "6ca7a031-b933-4af3-8360-a1e48539bb7e"; //prodefId = "pid-ccce3e0a-89e2-453b-a271-1a9f376f8a9b"; CreateActionUtil.ReadChildLocationElement(_selectIframeId, locationElementId, prodefId, "", dgvChildElement, childProdefId); } catch (Exception er) { MessageBox.Show(er.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void 设为执行方案ToolStripMenuItem_Click(object sender, EventArgs e) { try { var nodeSelect = treeSchemas.SelectedNode; if (nodeSelect != null) if (nodeSelect.Name.IndexOf("SCHEMA_") > -1) { var seleniumSchemaEntity = (SeleniumSchemaEntity) nodeSelect.Tag; StaticValue.SetExecuteSeleniumSchema(seleniumSchemaEntity); StaticValue.GetAllSeleniumSchema(treeSchemas, seleniumSchemaEntity.Id); } } catch (Exception er) { MessageBox.Show(er.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
/// <summary>获取会员充值总金额。</summary> /// <param name="memberid">会员卡号</param> /// <returns></returns> public static decimal GetTotalMoneyForMember(string memberid) { string strSql = "select sum(dmoney) from deposit where 1=1"; if (memberid != "") { strSql += " and dmid='" + memberid + "'"; } DataTable objDataTable = StaticValue.SelectTable(strSql); decimal dSum = 0; try { dSum = decimal.Parse(objDataTable.Rows[0][0].ToString()); } catch { } return(dSum); }
/// <summary>查询消费明细</summary> /// <param name="payid">消费单号</param> /// <returns></returns> public static List <PayDetail> SelectList(string payid) { string strSql = "select * from paydetails where pdpid='" + payid + "'"; DataTable objDataTable = StaticValue.SelectTable(strSql); List <PayDetail> lstPayDetail = new List <PayDetail>(); foreach (DataRow objRow in objDataTable.Rows) { PayDetail objDetail = new PayDetail(); objDetail.DetailID = decimal.Parse(objRow["pdid"].ToString()); objDetail.PayID = objRow["pdpid"].ToString(); objDetail.ItemID = int.Parse(objRow["pdiid"].ToString()); objDetail.Number = int.Parse(objRow["pdnum"].ToString()); objDetail.Bonus = double.Parse(objRow["pbonus"].ToString()); objDetail.Money = decimal.Parse(objRow["pmoney"].ToString()); lstPayDetail.Add(objDetail); } return(lstPayDetail); }