private DataTable InitialDataTable(string Department) { DataTable dt = DataAnalysis.CreateDataTable(); string cWeek = Session["CurrentWeek"].ToString(); if (cWeek == "0")//没有校历的情况 { return(dt); } else { for (int i = Convert.ToInt32(cWeek); i > 0; i--) { string str1 = i.ToString(); if (str1.Length == 1) { str1 = "0" + str1; //周次 } int Late = DataAnalysis.GetEveryAttendanceNumber(Department, str1, "迟到"); int Early = DataAnalysis.GetEveryAttendanceNumber(Department, str1, "早退"); int Attandance = DataAnalysis.GetEveryAttendanceNumber(Department, str1, "旷课"); int Leave = DataAnalysis.GetEveryAttendanceNumber(Department, str1, "请假"); DataRow dr = DataAnalysis.CreatDataRow(dt, str1, Department, Late, Early, Attandance, Leave); dt.Rows.Add(dr); } DataRow drLast = DataAnalysis.InsertLastRow(dt); dt.Rows.Add(drLast); return(dt); } }
public void Initilize() { var cp = CommonDataManager.GetCPCase(base.LocalID); var rule = CommonDataManager.GetAminRule(base.LocalID); this.TeacherClasses = DataAnalysis.GetTeacherClassAnalysisResult(cp, rule); }
public void Initilize() { var cp = CommonDataManager.GetCPCase(base.LocalID); var rule = CommonDataManager.GetAminRule(base.LocalID); this.ClassTimeSlots = DataAnalysis.GetClassTimeSlotAnalysisResult(cp, rule); if (this.ClassTimeSlots != null) { this.ClassCount = this.ClassTimeSlots.Count; this.TotalClassHour = cp.GetAvaliablePositions(); } this.TeacherAnalysises = DataAnalysis.GetGeneralTeacherAnalysisResult(cp); if (this.TeacherAnalysises != null) { this.TeacherCount = this.TeacherAnalysises.Count; } var rules = DataAnalysis.GetRuleAnalysisResult(cp, rule); int no = 0; rules.ForEach(r => { r.NO = ++no; }); this.Rules = rules; }
public string getDataName2 = "new Array()"; //缺勤率 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Session["CurrentWeek"] = 17;//调试用 InitDropList(DropDownList1, Convert.ToInt32(Session["CurrentWeek"])); string[] AllDepartment = { "会计系", "信息工程系", "经济管理系", "食品工程系", "机械工程系", "商务外语系", "建筑工程系" }; getButtomTag = BuildButtomTag(AllDepartment); getClassName = "new Array('缺勤人数','缺勤率')"; //获取缺勤人数,传入时间,返回各系总缺勤人数,缺勤率 DataTable dt = DataAnalysis.GetDataAndCreateChartBySum(1, Convert.ToInt32(Session["CurrentWeek"])); string[] dataname1 = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { dataname1[i] = dt.Rows[i]["Sum"].ToString(); } getDataName1 = BuildButtomTag(dataname1); string[] dataname2 = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { dataname2[i] = dt.Rows[i]["SumRate"].ToString().TrimEnd('%'); } getDataName2 = BuildButtomTag(dataname2); GridView1.DataSource = dt; GridView1.DataBind(); } }
public Core() { VehMap = new Dictionary <string, string>(); //获取当前未完成的任务 GetBussMap(); //初始化业务服务器连接 Bs = new BssClient() { LocalPort = SysParameters.BssLocalPort, RemoteIpep = new IPEndPoint(IPAddress.Parse(SysParameters.BssServerIp), SysParameters.BssServerPort) }; Bs.HandShakeMsg = $"[3000DWBH:{SysParameters.LocalUnitCode}*#DWMC:*#ZJM:{GetZJM()}*#TLX:TFC*#TH:1*#ZBY:*#ZT:1*#LSH:*#ZBBC:*#]"; Bs.Client.Connected += BSClient_Connected; Bs.Client.DisConnected += BSClient_DisConnected; //初始化GPS业务服务器连接 Gs = new GServer() { LocalPort = SysParameters.GpsLocalPort }; Gs.Client.Connected += GSClient_Connected; Gs.Client.DisConnected += GSClient_DisConnected; //初始化数据库连接 DA = new DataAnalysis(); DA.Connected += DA_Connected; DA.DisConnected += DA_DisConnected; }
public void Initilize() { var cl = base.GetClCase(base.LocalID); var rule = base.GetClRule(base.LocalID); this.studentLessonAnalysis = DataAnalysis.GetStudentLessonAnalysisResult(cl); this.StudentCombinations = DataAnalysis.GetStudentSelectionCombinationAnalysisResult(cl); }
public void Initilize() { var cl = base.GetClCase(base.LocalID); var rule = base.GetClRule(base.LocalID); this.TeacherAnalysis = DataAnalysis.GetTeacherClassAnalysisResult(cl, rule); }
public void Progress8Mock1_InputBetween45and49_AwardGradeOnePointFive() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.progress8Mock1(45); //assert Assert.AreEqual(result, 1.5); }
public void Progress8Mock1_InputBetween40and44_AwardGradeOnePointZero() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.progress8Mock1(40); //assert Assert.AreEqual(result, 1.00); }
public void Progress8Mock1_InputBetween60and64_AwardGradeFourPointZero() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.progress8Mock1(64); //assert Assert.AreEqual(result, 4.00); }
public void Progress8Mock1_InputBetween65and69_AwardGradeFivePointFive() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.progress8Mock1(67); //assert Assert.AreEqual(result, 5.50); }
public void DistanceTravelled_AverageMock1AndMock2Result_ReturnAverage() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.distanceTravelled(48, 55); //assert Assert.AreEqual(result, 51.5); }
public void Progress8Mock1_InputBetween70and75_AwardGradeSevenPointZero() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.progress8Mock1(70); //assert Assert.AreEqual(result, 7.00); }
public void Progress8Mock2_InputBetween0and39_AwardGradeZero() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.progress8Mock2(12); //assert Assert.AreEqual(result, 0.00); }
public void DistanceTravelled_Mock2Zero_returnMock1Only() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.distanceTravelled(48, 0); //assert Assert.AreEqual(result, 48); }
public void Progress8Mock1_InputBetween76and80_AwardGradeEightPointFive() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.progress8Mock1(77); //assert Assert.AreEqual(result, 8.50); }
public void Progress8Mock2_InputBetween55and59_AwardGradeThreePointZero() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.progress8Mock2(55); //assert Assert.AreEqual(result, 3.00); }
public void Progress8Mock1_InputBetween50and54_AwardGradeTwoPointZero() { //arrange DataAnalysis da = new DataAnalysis(); //act double result = da.progress8Mock1(52); //assert Assert.AreEqual(result, 2.00); }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { string[] AllDepartment = { "会计系", "信息工程系", "经济管理系", "食品工程系", "机械工程系", "商务外语系", "建筑工程系" }; getButtomTag = BuildButtomTag(AllDepartment); getClassName = "new Array('缺勤人数','缺勤率')"; if (DropDownList1.SelectedItem.Text == "开学至今") { //开学至今 //获取缺勤人数,传入时间,返回各系总缺勤人数,缺勤率 DataTable dt = DataAnalysis.GetDataAndCreateChartBySum(1, Convert.ToInt32(Session["CurrentWeek"])); string[] dataname1 = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { dataname1[i] = dt.Rows[i]["Sum"].ToString(); } getDataName1 = BuildButtomTag(dataname1); string[] dataname2 = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { dataname2[i] = dt.Rows[i]["SumRate"].ToString().TrimEnd('%'); } getDataName2 = BuildButtomTag(dataname2); GridView1.DataSource = dt; GridView1.DataBind(); } else { //单个周次 string dropSele = DropDownList1.SelectedItem.Text; int selectWeek = Convert.ToInt32(dropSele.Length == 5?(dropSele.Substring(2, 1)):dropSele.Substring(2, 2));//获取选择的周 //获取缺勤人数,传入时间,返回各系总缺勤人数,缺勤率 DataTable dt = DataAnalysis.GetDataAndCreateChartBySum(selectWeek, selectWeek);// string[] dataname1 = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { dataname1[i] = dt.Rows[i]["Sum"].ToString(); } getDataName1 = BuildButtomTag(dataname1); string[] dataname2 = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { dataname2[i] = dt.Rows[i]["SumRate"].ToString().TrimEnd('%'); } getDataName2 = BuildButtomTag(dataname2); GridView1.DataSource = dt; GridView1.DataBind(); } }
/// <summary> /// Configures the buttons in the "symbol shortcuts" group box. The entire box is /// disabled unless "symbol" is selected. Other options are selectively enabled or /// disabled as appropriate for the current input. If we disable the selection option, /// the selection will be reset to default. /// </summary> private void ConfigureSymbolShortcuts() { // operandOnlyRadioButton: always enabled // labelInsteadRadioButton: symbol is unknown and operand address has no label // operandAndLabelRadioButton: same as labelInstead // operandAndProjRadioButton: symbol is unknown and operand address is outside project string labelStr = symbolTextBox.Text; ShortcutArg = -1; // Is this a known symbol? If so, disable most options and bail. if (mProject.SymbolTable.TryGetValue(labelStr, out Symbol sym)) { labelInsteadRadioButton.Enabled = operandAndLabelRadioButton.Enabled = operandAndProjRadioButton.Enabled = false; operandOnlyRadioButton.Checked = true; return; } if (mAttr.OperandOffset >= 0) { // Operand target is inside the file. Does the target offset already have a label? int targetOffset = DataAnalysis.GetBaseOperandOffset(mProject, mAttr.OperandOffset); bool hasLabel = mProject.UserLabels.ContainsKey(targetOffset); labelInsteadRadioButton.Enabled = operandAndLabelRadioButton.Enabled = !hasLabel; operandAndProjRadioButton.Enabled = false; ShortcutArg = targetOffset; } else if (mAttr.OperandAddress >= 0) { // Operand target is outside the file. labelInsteadRadioButton.Enabled = operandAndLabelRadioButton.Enabled = false; operandAndProjRadioButton.Enabled = true; ShortcutArg = mAttr.OperandAddress; } else { // Probably an immediate operand. labelInsteadRadioButton.Enabled = operandAndLabelRadioButton.Enabled = operandAndProjRadioButton.Enabled = false; } // Select the default option if the currently-selected option is no longer available. if ((labelInsteadRadioButton.Checked && !labelInsteadRadioButton.Enabled) || (operandAndLabelRadioButton.Checked && !operandAndLabelRadioButton.Enabled) || (operandAndProjRadioButton.Checked && !operandAndProjRadioButton.Enabled)) { operandOnlyRadioButton.Checked = true; } }
public void peopleBillNumTest() { string path = @"D:\resource\test.txt"; ReadFile file = new ReadFile(path); string[] data = file.data(); DataAnalysis dataanalysis = new DataAnalysis(data); int[] peopleBillNum = dataanalysis.peopleBillNum(); Assert.AreEqual(peopleBillNum[1], 2); }
public void Initilize() { var cl = base.GetClCase(base.LocalID); var rule = base.GetClRule(base.LocalID); var rules = DataAnalysis.GetRuleAnalysisDetailResult(cl, rule); int no = 0; rules.ForEach(r => { r.NO = ++no; }); this.Rules = rules; }
public DB_AGIN_Baccarat Clone() { DB_AGIN_Baccarat baccarat = new DB_AGIN_Baccarat(); baccarat.Id = Id; baccarat.CoordinateX = CoordinateX; baccarat.CoordinateY = CoordinateY; baccarat.FileNames = FileNames; baccarat.DataAnalysis = DataAnalysis.Clone(); baccarat.CreatedOn = CreatedOn; baccarat.CreatedBy = CreatedBy; baccarat.LastModifiedOn = LastModifiedOn; baccarat.LastModifiedBy = LastModifiedBy; return(baccarat); }
/// <summary> /// /// </summary> /// <param name="lockname"></param> /// <param name="starttime"></param> /// <param name="endtime"></param> /// <param name="username"></param> /// <returns></returns> public string TotalDataAnalysis(string lockname, string starttime, string endtime) { string msg = string.Empty; RecordGolable obj = DataAnalysis.GetInstance().totalAnalysis(out msg, EventClass.GetInstance()._gloabledataTable, lockname, starttime, endtime); if (msg != "Success") { return(msg); } else { string json = JsonConvert.SerializeObject(obj._analysisData); return(json); } }
/// <summary> /// 数据分析接口 /// </summary> /// <param name="lockname"></param> /// <param name="starttime"></param> /// <param name="endtime"></param> /// <param name="username"></param> /// <returns></returns> public string StatisticalAnalysis(string lockname, string starttime, string endtime, string username) { string msg = string.Empty; RecordGolable obj = DataAnalysis.GetInstance().StatisticalAnalysis(out msg, EventClass.GetInstance()._gloabledataTable, lockname, starttime, endtime, username); if (msg != "Success") { return(msg); } else { string json = JsonConvert.SerializeObject(obj._monthlydisplaysList); return(json); } }
public void Initilize() { var cp = CommonDataManager.GetCPCase(base.LocalID); var rule = CommonDataManager.GetAminRule(base.LocalID); var rules = DataAnalysis.GetRuleAnalysisDetailResult(cp, rule); int no = 0; rules.ForEach(r => { r.NO = ++no; }); this.Rules = rules; }
public void PersonIndexTest() { string path = @"D:\resource\test.txt"; ReadFile file = new ReadFile(path); string[] data = file.data(); DataAnalysis dataanalysis = new DataAnalysis(data); int[] personBillNum = dataanalysis.peopleBillNum(); int[] personNum = dataanalysis.peopleNum(); int[] personIndex = GetPersonIndex.PersonIndex(data.Length, personBillNum); Assert.AreEqual(4, personIndex[1]); }
/// <summary> /// TCPVOBC数据回调 /// </summary> /// <param name="receData">回调数据</param> void TcpVobc_EBackData(byte[] receData) { VOBCProduct pro = CDeviceDataFactory.Instance.GetProductByIpPort(vobcServerIP, vobcServerPort); DataAnalysis.VOBCDataAnalysis(receData, pro.CTcpClient); //if (pro != null) //{ // //第一次建链即触发回调,在收到更新结果回复时在这里直接处理 // if (receData[2] == 0x06) // { // pro.WaitForUpdateResult(); // } //} //else //{ // LogManager.InfoLog.LogCommunicationError("VOBCCommand", "TcpVobc_EBackData", pro.ProductID + "未找到接收到的VOBC对象!"); //} }
public void PersonBillTest() { string path = @"D:\resource\test.txt"; ReadFile file = new ReadFile(path); string[] data = file.data(); DataAnalysis dataanalysis = new DataAnalysis(data); int[] personBillNum = dataanalysis.peopleBillNum(); int[] personNum = dataanalysis.peopleNum(); int[] personIndex = GetPersonIndex.PersonIndex(data.Length, personBillNum); int[] groupIndex = GetGroupIndex.GroupIndex(data.Length, personNum); float[,] personBill = GetPersonBill.PersonBill(personIndex, groupIndex, data); decimal result = 30; Assert.AreEqual(result, (decimal)personBill[0, 0]); }
/// <summary> /// Crée les objets d'affichage pour l'affichage de la grille. /// </summary> /// <param name="saveRef"></param> private void displayGrid(MonthlySave saveRef = null) { var gridData = new List <DataAnalysis>(); foreach (DistinctBudget budget in controler.getSortedBudgets()) { gridData.Add(new DataAnalysis(budget, saveRef)); } DataAnalysis totalRow = new DataAnalysis(); gridData.Add(totalRow); grdBudgets.DataSource = gridData; grdBudgets.Visible = true; bool isNull = MonthlySave.isNull(saveRef); grdBudgets.Columns[2].Visible = !isNull; // mois de ref grdBudgets.Columns[4].Visible = !isNull; // Evolution grdBudgets.Columns[2].HeaderText = ($"{Const.MONTHLYEXPENSES_HEADER} {dtpDateRef.Value.ToString("MMMM")} {dtpDateRef.Value.ToString("yyyy")}"); setHoverText(); }