Ejemplo n.º 1
0
        private void CaiJiChartView_Load(object sender, EventArgs e)
        {
            String str = CaiJiHelperClient.GetRealTimeTestData(caiJiID);

            string RealTimeData = str;

            try
            {
                str = BizCommon.JZCommonHelper.GZipDecompressString(RealTimeData);
            }
            catch
            {
                str = RealTimeData;
            }

            List <JZRealTimeData> list = Newtonsoft.Json.JsonConvert.DeserializeObject <List <JZRealTimeData> >(str);

            if (list != null && list.Count > 0)
            {
                DateTime last = list[0].Time;
                for (int i = 0; i < list.Count; i++)
                {
                    ChartLine(Math.Round((list[i].Time - last).TotalMilliseconds / 1000, 2), list[i].Value);
                }
            }
        }
Ejemplo n.º 2
0
        private void ShowLabel(Guid id)
        {
            var table = CaiJiHelperClient.GetTestOverTimeByID(id);

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            var row = table.Rows[0];

            tb_reason.Text  = (row["SGComment"] ?? "").ToString();
            tb_process.Text = (row["JLComment"] ?? "").ToString();
            int Status = int.Parse(row["Status"].ToString());

            if (Status == 0)
            {
                tb_reason.Enabled = true;
                bt_save.Enabled   = true;
            }
            else
            {
                tb_reason.Enabled = false;
                bt_save.Enabled   = false;
            }
            #region 显示填写与处理
            if (row["LastSGUser"] != DBNull.Value)
            {
                lb_reason.Text = row["LastSGUser"].ToString() + " 于 " +
                                 row["LastSGTime"].ToString() + " 填写";
            }
            else
            {
                lb_reason.Text = "未填写";
            }

            if (row["ApprovedJLUser"] != DBNull.Value)
            {
                int    status = int.Parse(row["Status"].ToString());
                String result = " 未处理";
                if (status == 1)
                {
                    result = " 通过";
                }
                else if (status == 2)
                {
                    result = " 拒绝";
                }
                lb_process.Text = row["ApprovedJLUser"].ToString() + " 于 " +
                                  row["ApprovedTime"].ToString() + result;
            }
            else
            {
                lb_process.Text = "未处理";
            }
            #endregion
        }
Ejemplo n.º 3
0
 private void btnManualUploadMQ_Click(object sender, EventArgs e)
 {
     CaiJiHelperClient.ManualUploadMQ();
     EnableTime = 60;
     btnManualUploadMQ.Enabled = false;
     tmManual.AutoReset        = true;
     tmManual.Elapsed         += new System.Timers.ElapsedEventHandler(tmManual_Elapsed);
     tmManual.Interval         = 1000;
     tmManual.Enabled          = true;
     tmManual.Start();
 }
Ejemplo n.º 4
0
 private void ProcessOverTime(Int32 status, Guid[] ids)
 {
     try
     {
         CaiJiHelperClient.ProcessTestOverTime(ids, tb_process.Text.Trim(), status);
         MessageBox.Show("处理成功,查看处理过的试验请到\"审批\"-->\"查看已审批的过期试验中查看\"");
         if (ApplyAll.Checked == true)
         {
             this.Close();
         }
         SetDataSource();
     }
     catch
     {
         MessageBox.Show("保存失败,请联系管理员", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 5
0
        private void btnReset_Click(object sender, EventArgs e)
        {
            var rows = FarPointExtensions.GetSelectionRows(Sheet);
            var ids  = new List <Guid>();

            if (ApplyAll.Checked)
            {
                foreach (Row row in Sheet.Rows)
                {
                    if (row.Tag == null)
                    {
                        continue;
                    }

                    var id = new Guid(row.Tag.ToString());

                    ids.Add(id);
                }
            }
            else
            {
                foreach (var row in rows)
                {
                    var id = new Guid(row.Tag.ToString());
                    if (id == null)
                    {
                        continue;
                    }

                    ids.Add(id);
                }
            }

            if (ids.Count == 0)
            {
                MessageBox.Show("请选择要处理的数据", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                CaiJiHelperClient.UpdateTestOverTimeStatus(ids.ToArray(), 0);
                SetDataSource();
                this.Close();
                //ProcessOverTime(1, ids.ToArray());
            }
        }
Ejemplo n.º 6
0
        private void btnReloadMQ_Click(object sender, EventArgs e)
        {
            string strStartTime = txtWTBH.Text.Trim().Replace(",", "");

            if (!string.IsNullOrEmpty(strStartTime))
            {
                bool     bIsDate     = false;
                DateTime dtStartTime = new DateTime();
                bIsDate = DateTime.TryParse(strStartTime, out dtStartTime);

                if (Yqun.Common.ContextCache.ApplicationContext.Current.UserCode != "-2" && bIsDate == true)
                {
                    return;
                }
                CaiJiHelperClient.ReloadRabbitMQ(strStartTime);
                MessageBox.Show("重新入库成功");
            }
        }
Ejemplo n.º 7
0
 private void Table_SelectionChanged(object sender, FarPoint.Win.Spread.SelectionChangedEventArgs e)
 {
     if (e.Range.Row > 0)
     {
         string ID  = "";
         var    row = Sheet.Rows[e.Range.Row];
         if (row == null)
         {
             return;
         }
         ID = row.Tag.ToString();
         DataTable dt = CaiJiHelperClient.GetTestOverTimeByID(new Guid(ID));
         if (dt != null && dt.Rows.Count > 0)
         {
             tb_reason.Text = (dt.Rows[0]["SGComment"] ?? "").ToString();
         }
     }
     else
     {
         tb_reason.Text = "";
     }
 }
Ejemplo n.º 8
0
        private void SearchUnusedTestData(string strWTBH)
        {
            DataTable Data = CaiJiHelperClient.GetUnusedTestData(strWTBH);

            if (Data != null)
            {
                FpSpread_Info.Columns[0].Width  = 80;
                FpSpread_Info.Columns[1].Width  = 80;
                FpSpread_Info.Columns[2].Width  = 120;
                FpSpread_Info.Columns[3].Width  = 100;
                FpSpread_Info.Columns[4].Width  = 100;
                FpSpread_Info.Columns[5].Width  = 40;
                FpSpread_Info.Columns[6].Width  = 80;
                FpSpread_Info.Columns[7].Width  = 400;
                FpSpread_Info.Columns[8].Width  = 100;
                FpSpread_Info.Columns[9].Width  = 100;
                FpSpread_Info.Columns[10].Width = 100;
                FpSpread_Info.Columns[11].Width = 120;

                FpSpread_Info.Rows.Count = Data.Rows.Count;

                int    i, j;
                string strModuleIDs = string.Empty;

                foreach (DataRow Row in Data.Rows)
                {
                    strModuleIDs += "'" + Row["ModuleID"].ToString() + "',";
                }
                if (strModuleIDs.Length > 0)
                {
                    strModuleIDs = strModuleIDs.Substring(0, strModuleIDs.Length - 1);
                }
                DataTable dtSheet = ModuleHelperClient.GetSheetIDAndName(strModuleIDs);
                foreach (System.Data.DataColumn Column in Data.Columns)
                {
                    i = Data.Columns.IndexOf(Column);

                    FpSpread_Info.Columns[i].VerticalAlignment = CellVerticalAlignment.Center;
                    FpSpread_Info.Columns[i].Label             = Column.ColumnName;

                    foreach (DataRow Row in Data.Rows)
                    {
                        j = Data.Rows.IndexOf(Row);
                        if (i == 7)//解析试验结果
                        {
                            string        strTestData     = Row[Column.ColumnName].ToString();
                            StringBuilder strTestDataName = new StringBuilder();
                            try
                            {
                                List <JZTestCell> lstJZTC      = Newtonsoft.Json.JsonConvert.DeserializeObject <List <JZTestCell> >(strTestData);
                                string            strSheetName = string.Empty;
                                bool bHaveSheet = false;;
                                foreach (JZTestCell tcItem in lstJZTC)
                                {
                                    if (bHaveSheet == false)
                                    {
                                        bHaveSheet   = true;
                                        strSheetName = GetSheetName(dtSheet, tcItem.SheetID.ToString());
                                        if (string.IsNullOrEmpty(strSheetName))
                                        {
                                            strTestDataName.Append(tcItem.SheetID + "|");
                                        }
                                        else
                                        {
                                            strTestDataName.Append(strSheetName + "|");
                                        }
                                    }
                                    switch (tcItem.Name)
                                    {
                                    case JZTestEnum.DHBJ:
                                        strTestDataName.Append("断后标距:" + tcItem.Value);
                                        break;

                                    case JZTestEnum.LDZDL:
                                        strTestDataName.Append("拉断最大力:" + tcItem.Value);
                                        break;

                                    case JZTestEnum.PHHZ:
                                        strTestDataName.Append("破坏荷载:" + tcItem.Value);
                                        break;

                                    case JZTestEnum.QFL:
                                        strTestDataName.Append("屈服力:" + tcItem.Value);
                                        break;

                                    default:
                                        break;
                                    }
                                    strTestDataName.Append(";");
                                }
                            }
                            catch (Exception ex)
                            {
                                //logger.Error(string.Format("解析Json出错,TestData:{0},Exception:{1}", strTestData, ex.Message));
                                strTestDataName.Append(strTestData);
                                //continue;
                            }
                            FpSpread_Info.Cells[j, i].Value = strTestDataName.ToString();
                        }
                        else
                        {
                            FpSpread_Info.Rows[j].HorizontalAlignment = CellHorizontalAlignment.Center;
                            FpSpread_Info.Cells[j, i].Value           = Row[Column.ColumnName].ToString();
                        }
                        FpSpread_Info.Rows[j].Tag = Row["ID"];
                    }
                }
            }
        }
Ejemplo n.º 9
0
        private void SetDataSource()
        {
            Sheet.Rows.Count = 0;
            var result = CaiJiHelperClient.GetTestOverTimeByDataID(DataID);

            if (result == null || result.Rows.Count == 0)
            {
                return;
            }

            Sheet.Rows.Count = result.Rows.Count;
            for (var i = 0; i < result.Rows.Count; i++)
            {
                var row = result.Rows[i];
                Sheet.Cells[i, 0].Value = row["标段名称"];
                Sheet.Cells[i, 1].Value = row["单位名称"];
                Sheet.Cells[i, 2].Value = row["试验室名称"];
                Sheet.Cells[i, 3].Value = row["模板名称"];
                Sheet.Cells[i, 4].Value = row["WTBH"];
                Sheet.Cells[i, 6].Value = (row["实际试验日期"] == DBNull.Value || row["实际试验日期"] == null) ? "" : ((DateTime)(row["实际试验日期"])).ToString("yyyy-MM-dd");
                Sheet.Cells[i, 7].Value = (row["龄期到期日期"] == DBNull.Value || row["龄期到期日期"] == null) ? "" : ((DateTime)(row["龄期到期日期"])).ToString("yyyy-MM-dd");

                var builder = new StringBuilder();
                var data    = Newtonsoft.Json.JsonConvert.DeserializeObject <List <JZTestCell> >(row["TestData"].ToString());
                var value   = string.Format("[{0}] ", row["SerialNumber"]);

                foreach (var d in data)
                {
                    switch (d.Name)
                    {
                    case JZTestEnum.DHBJ:
                        value += "断后标距:" + (d.Value ?? "").ToString() + ";";
                        break;

                    case JZTestEnum.LDZDL:
                        value += "拉断最大力:" + (d.Value ?? "").ToString() + ";";
                        break;

                    case JZTestEnum.PHHZ:
                        value += "破坏荷载:" + (d.Value ?? "").ToString() + ";";
                        break;

                    case JZTestEnum.QFL:
                        value += "屈服力:" + (d.Value ?? "").ToString() + ";";
                        break;

                    default:
                        break;
                    }
                }

                if (!string.IsNullOrEmpty(value))
                {
                    builder.Append(value + " ");
                }

                Sheet.Cells[i, 5].Value = builder.ToString();
                Sheet.Rows[i].Tag       = new Guid(row["ID"].ToString());
            }

            ShowLabel(new Guid(result.Rows[0]["ID"].ToString()));
        }
Ejemplo n.º 10
0
        private void SetDataSource()
        {
            Sheet.Rows.Count = 0;
            var result = CaiJiHelperClient.GetTestOverTimeByDataID(DataID);

            Sheet.Rows.Count = result.Rows.Count;
            #region
            for (var i = 0; i < result.Rows.Count; i++)
            {
                var row = result.Rows[i];
                Sheet.Cells[i, 0].Value = row["标段名称"];
                Sheet.Cells[i, 1].Value = row["单位名称"];
                Sheet.Cells[i, 2].Value = row["试验室名称"];
                Sheet.Cells[i, 3].Value = row["模板名称"];
                Sheet.Cells[i, 4].Value = row["WTBH"];
                Sheet.Cells[i, 6].Value = (row["实际试验日期"] == DBNull.Value || row["实际试验日期"] == null) ? "" : ((DateTime)(row["实际试验日期"])).ToString("yyyy-MM-dd");
                Sheet.Cells[i, 7].Value = (row["龄期到期日期"] == DBNull.Value || row["龄期到期日期"] == null) ? "" : ((DateTime)(row["龄期到期日期"])).ToString("yyyy-MM-dd");


                var builder = new StringBuilder();
                var data    = Newtonsoft.Json.JsonConvert.DeserializeObject <List <JZTestCell> >(row["TestData"].ToString());
                var value   = string.Format("[{0}] ", row["SerialNumber"]);

                foreach (var d in data)
                {
                    switch (d.Name)
                    {
                    case JZTestEnum.DHBJ:
                        value += "断后标距:" + (d.Value ?? "").ToString() + ";";
                        break;

                    case JZTestEnum.LDZDL:
                        value += "拉断最大力:" + (d.Value ?? "").ToString() + ";";
                        break;

                    case JZTestEnum.PHHZ:
                        value += "破坏荷载:" + (d.Value ?? "").ToString() + ";";
                        break;

                    case JZTestEnum.QFL:
                        value += "屈服力:" + (d.Value ?? "").ToString() + ";";
                        break;

                    default:
                        break;
                    }
                }

                if (!string.IsNullOrEmpty(value))
                {
                    builder.Append(value + " ");
                }

                Sheet.Cells[i, 5].Value = builder.ToString();
                Sheet.Rows[i].Tag       = row["ID"];
            }
            #endregion

            if (result.Rows.Count > 0)
            {
                ShowLabel(new Guid(result.Rows[0]["ID"].ToString()));

                //DataTable dt = CaiJiHelperClient.GetTestOverTimeByID(new Guid(result.Rows[0]["ID"].ToString()));
                //if (dt != null && dt.Rows.Count > 0)
                //{
                //    tb_reason.Text = (dt.Rows[0]["SGComment"] ?? "").ToString();
                //    int Status = int.Parse(dt.Rows[0]["Status"].ToString());
                //    if (Status == 0)
                //    {
                //        tb_reason.Enabled = true;
                //        bt_save.Enabled = true;
                //    }
                //    else
                //    {
                //        tb_reason.Enabled = false;
                //        bt_save.Enabled = false;
                //    }
                //}
            }
        }
Ejemplo n.º 11
0
        private void bt_save_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tb_reason.Text.Trim()))
            {
                MessageBox.Show("延时原因不能为空!");
                return;
            }
            var ids = new List <Guid>();

            if (chkAll.Checked)
            {
                for (int i = 0; i < Sheet.Rows.Count; i++)
                {
                    var t = Sheet.Rows[i].Tag.ToString();
                    if (string.IsNullOrEmpty(t))
                    {
                        continue;
                    }

                    ids.Add(new Guid(t));
                }
            }
            else
            {
                var rows = FarPointExtensions.GetSelectionRows(Sheet);
                foreach (var row in rows)
                {
                    var t = row.Tag.ToString();
                    if (string.IsNullOrEmpty(t))
                    {
                        continue;
                    }

                    ids.Add(new Guid(t));
                }
            }

            if (ids.Count <= 0)
            {
                MessageBox.Show("请选择要处理的数据!");
                return;
            }

            try
            {
                CaiJiHelperClient.SubmitCommentMulti(ids.ToArray(), tb_reason.Text.Trim(), 2);

                SetDataSource();
                MessageBox.Show("保存成功,请等待监理审批!");
                if (chkAll.Checked)
                {
                    this.Close();
                }
            }
            catch
            {
                MessageBox.Show("保存失败,请联系管理员");
            }
            //try
            //{
            //    CaiJiHelperClient.SubmitComment(id, tb_reason.Text.Trim());
            //    MessageBox.Show("保存成功");
            //}
            //catch
            //{
            //    MessageBox.Show("保存失败,请联系管理员");
            //}
            //this.Close();
        }