private void GetMIDDB() { StringBuilder builder = new StringBuilder(""); bool flag = false; object objValue = null; string sErr = ""; builder.Remove(0, builder.Length); this.nCount_IF_BillIn = 0; this.nCount_IF_BillOut = 0; this.nCount_IF_BillCheck = 0; this.nCount_IF_BillRemove = 0; builder.Append("select count(*) nCount from TMID_BillIn where nRWTag=0 and nBClass=1"); flag = DBFuns.GetValueBySql(base.AppInformation.SvrSocket, builder.ToString(), "", "nCount", out objValue, out sErr); if ((sErr.Trim() != "") && (sErr.Trim() != "0")) { MessageBox.Show(sErr); } if (flag && (objValue != null)) { this.nCount_IF_BillIn = Convert.ToInt32(objValue); } builder.Remove(0, builder.Length); builder.Append("select count(*) nCount from TMID_BillIn where nRWTag=0 and nBClass=2"); flag = DBFuns.GetValueBySql(base.AppInformation.SvrSocket, builder.ToString(), "", "nCount", out objValue, out sErr); if ((sErr.Trim() != "") && (sErr.Trim() != "0")) { MessageBox.Show(sErr); } if (flag && (objValue != null)) { this.nCount_IF_BillOut = Convert.ToInt32(objValue); } builder.Remove(0, builder.Length); builder.Append("select count(*) nCount from TMID_BillCheck where nRWTag=0"); flag = DBFuns.GetValueBySql(base.AppInformation.SvrSocket, builder.ToString(), "", "nCount", out objValue, out sErr); if ((sErr.Trim() != "") && (sErr.Trim() != "0")) { MessageBox.Show(sErr); } if (flag && (objValue != null)) { this.nCount_IF_BillCheck = Convert.ToInt32(objValue); } builder.Remove(0, builder.Length); builder.Append("select count(*) nCount from TMID_BillRemove where nRWTag=0"); flag = DBFuns.GetValueBySql(base.AppInformation.SvrSocket, builder.ToString(), "", "nCount", out objValue, out sErr); if ((sErr.Trim() != "") && (sErr.Trim() != "0")) { MessageBox.Show(sErr); } if (flag && (objValue != null)) { this.nCount_IF_BillRemove = Convert.ToInt32(objValue); } builder.Remove(0, builder.Length); builder = null; }
private void frmMain_Load(object sender, EventArgs e) { this.ainfo.AppICON = base.Icon; //new MyRegister { RootKey = Registry.LocalMachine }.RegWrite(@"Software\SunEast\WMS", "WMSPath", Application.StartupPath); if (this.userInfo != null) { this.stlbCompany.Text = "单位【" + this.userInfo.UnitName + "】"; this.stlbDept.Text = "部门【" + this.userInfo.DeptName + "】"; this.stlbUser.Text = "用户【" + this.userInfo.UserName + "】"; } this.stlbDate.Text = "日期【" + DateTime.Now.ToString("yyyy-MM-dd") + "】"; string str = ""; switch (DateTime.Now.DayOfWeek) { case DayOfWeek.Sunday: str = "日"; break; case DayOfWeek.Monday: str = "一"; break; case DayOfWeek.Tuesday: str = "二"; break; case DayOfWeek.Wednesday: str = "三"; break; case DayOfWeek.Thursday: str = "四"; break; case DayOfWeek.Friday: str = "五"; break; case DayOfWeek.Saturday: str = "六"; break; } this.stlbWeek.Text = "【星期" + str + "】"; this.GetUserRights(this.userInfo); this.frmMain_SizeChanged(null, null); string sSql = "select isnull(cParValue,0) cParValue from TPS_SysPar where cParId='bIsDoMidDBByForeGround'"; string sErr = ""; bool flag = false; object objValue = null; flag = DBFuns.GetValueBySql(sSql, "", "cParValue", out objValue, out sErr); if ((sErr.Trim() != "") && (sErr.Trim() != "0")) { MessageBox.Show(sErr); } if (flag && (objValue != null)) { this.bIsUseMIDForeGround = Convert.ToInt16(objValue) == 1; } sSql = "select isnull(cParValue,0) cParValue from TPS_SysPar where cParId='nIsLinkMis'"; flag = DBFuns.GetValueBySql(sSql, "", "cParValue", out objValue, out sErr); if ((sErr.Trim() != "") && (sErr.Trim() != "0")) { MessageBox.Show(sErr); } if (flag && (objValue != null)) { this.bIsUseIOMIDDB = Convert.ToInt16(objValue) == 1; } this.tmrMain.Enabled = this.bIsUseIOMIDDB; }