Exemplo n.º 1
0
        private SortedList GetProcedures()
        {
            CnasRemotCall RemoteClient = new CnasRemotCall();
            SortedList    procedures   = new SortedList();
            DataTable     data         = RemoteClient.RemotInterface.SelectData("HCS-procedure-sec002", null);

            if (data != null)
            {
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    Dictionary <string, string> item = new Dictionary <string, string>();
                    DataRow row = data.Rows[i] as DataRow;
                    if (row["id"] != null)
                    {
                        item.Add("id", row["id"].ToString());
                    }
                    if (row["pd_code"] != null)
                    {
                        item.Add("pd_code", row["pd_code"].ToString());
                    }
                    if (row["pd_bcode"] != null)
                    {
                        item.Add("pd_bcode", row["pd_bcode"].ToString());
                    }
                    if (row["pd_name"] != null)
                    {
                        item.Add("pd_name", row["pd_name"].ToString());
                    }
                    if (row["pd_scan"] != null)
                    {
                        item.Add("pd_scan", row["pd_scan"].ToString());
                    }
                    if (row["pd_description"] != null)
                    {
                        item.Add("pd_description", row["pd_description"].ToString());
                    }
                    if (row["pd_Type"] != null)
                    {
                        item.Add("pd_Type", row["pd_Type"].ToString());
                    }
                    if (row["state"] != null)
                    {
                        item.Add("state", row["state"].ToString());
                    }
                    if (row["split_count"] != null)
                    {
                        item.Add("split_count", row["split_count"].ToString());
                    }
                    if (row["cyc_location"] != null)
                    {
                        item.Add("cyc_location", row["cyc_location"].ToString());
                    }
                    if (row["si_id"] != null)
                    {
                        item.Add("si_id", row["si_id"].ToString());
                    }
                    procedures.Add(i, item);
                }
            }
            return(procedures);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 读取数据
        /// </summary>
        private void Loaddata()
        {
            dgv_01.Rows.Clear();
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            sttemp01.Add(1, CnasBaseData.SystemID);
            string    sterilizer = reCnasRemotCall.RemotInterface.CheckSelectData("hcs-sterilizer-device-sec001", sttemp01);
            DataTable getdt      = reCnasRemotCall.RemotInterface.SelectData("hcs-sterilizer-device-sec001", sttemp01);

            if (getdt != null && getdt.Rows.Count > 0)
            {
                int ii = getdt.Rows.Count;
                if (ii <= 0)
                {
                    return;
                }
                dgv_01.RowCount = ii;
                for (int i = 0; i < ii; i++)
                {
                    if (getdt.Rows[i]["id"] != null)
                    {
                        dgv_01.Rows[i].Cells["id"].Value = getdt.Rows[i]["id"].ToString();
                    }
                    if (getdt.Rows[i]["bar_code"] != null)
                    {
                        dgv_01.Rows[i].Cells["bar_code"].Value = getdt.Rows[i]["bar_code"].ToString();
                    }
                    if (getdt.Rows[i]["ca_name"] != null)
                    {
                        dgv_01.Rows[i].Cells["ca_name"].Value = getdt.Rows[i]["ca_name"].ToString();
                    }
                    if (getdt.Rows[i]["ca_model"] != null)
                    {
                        dgv_01.Rows[i].Cells["ca_model"].Value = getdt.Rows[i]["ca_model"].ToString();
                    }
                    if (getdt.Rows[i]["run_times"] != null)
                    {
                        dgv_01.Rows[i].Cells["run_times"].Value = getdt.Rows[i]["run_times"].ToString();
                    }
                    if (getdt.Rows[i]["cre_date"] != null)
                    {
                        dgv_01.Rows[i].Cells["cre_date"].Value = getdt.Rows[i]["cre_date"].ToString();
                    }
                    if (getdt.Rows[i]["mod_date"] != null)
                    {
                        dgv_01.Rows[i].Cells["mod_date"].Value = getdt.Rows[i]["mod_date"].ToString();
                    }
                    if (getdt.Columns.Contains("price") && getdt.Rows[i]["price"] != null && !string.IsNullOrEmpty(getdt.Rows[i]["price"].ToString()))
                    {
                        dgv_01.Rows[i].Cells["price"].Value = Convert.ToDouble(getdt.Rows[i]["price"].ToString()).ToString("C");
                    }
                    if (getdt.Rows[i]["ca_remarks"] != null)
                    {
                        dgv_01.Rows[i].Cells["ca_remarks"].Value = getdt.Rows[i]["ca_remarks"].ToString();
                    }
                    if (getdt.Rows[i]["ca_vender"] != null)
                    {
                        if (!string.IsNullOrEmpty(getdt.Rows[i]["ca_vender"].ToString()))
                        {
                            dgv_01.Rows[i].Cells["ca_vender"].Value = sl_VenderType[getdt.Rows[i]["ca_vender"].ToString()].ToString();
                        }
                    }
                    if (getdt.Rows[i]["sales_id"] != null)
                    {
                        dgv_01.Rows[i].Cells["sales_id"].Value = sl_SalesType[getdt.Rows[i]["sales_id"].ToString()].ToString();
                    }
                    if (getdt.Rows[i]["bd_test_time"] != null)
                    {
                        dgv_01.Rows[i].Cells["bd_test_time"].Value = getdt.Rows[i]["bd_test_time"].ToString();
                    }
                    if (getdt.Rows[i]["if_bdtest"] != null)
                    {
                        dgv_01.Rows[i].Cells["if_bdtest"].Value = (getdt.Rows[i]["if_bdtest"].ToString() == "1") ? "需要" : "不需要";
                    }
                    if (getdt.Rows[i]["std_stu"] != null)
                    {
                        dgv_01.Rows[i].Cells["std_stu"].Value = getdt.Rows[i]["std_stu"].ToString();
                    }
                    if (getdt.Rows[i]["min_stu"] != null)
                    {
                        dgv_01.Rows[i].Cells["min_stu"].Value = getdt.Rows[i]["min_stu"].ToString();
                    }
                    if (getdt.Rows[i]["max_stu"] != null)
                    {
                        dgv_01.Rows[i].Cells["max_stu"].Value = getdt.Rows[i]["max_stu"].ToString();
                    }
                }
                dgv_01.CurrentRow = dgv_01.Rows[0];
            }
        }
Exemplo n.º 3
0
        public List <Dictionary <string, string> > GetPdOperations(string pdCode)
        {
            List <Dictionary <string, string> > operations = new List <Dictionary <string, string> >();
            CnasRemotCall RemoteClient = new CnasRemotCall();
            SortedList    condition    = new SortedList();

            condition.Add(1, pdCode);
            string    sqlTest = RemoteClient.RemotInterface.CheckSelectData("HCS-ca-operation-sec001", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-ca-operation-sec001", condition);

            if (data != null)
            {
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    DataRow row = data.Rows[i] as DataRow;
                    Dictionary <string, string> operation = new Dictionary <string, string>();
                    if (row["id"] != null)
                    {
                        operation.Add("id", row["id"].ToString());
                    }
                    if (row["op_name"] != null)
                    {
                        operation.Add("op_name", row["op_name"].ToString());
                    }
                    if (row["op_brietcode"] != null)
                    {
                        operation.Add("op_brietcode", row["op_brietcode"].ToString());
                    }
                    if (row["function_name"] != null)
                    {
                        operation.Add("function_name", row["function_name"].ToString());
                    }
                    if (row["state"] != null)
                    {
                        operation.Add("state", row["state"].ToString());
                    }
                    if (row["op_ico"] != null)
                    {
                        operation.Add("op_ico", row["op_ico"].ToString());
                    }
                    if (row["sort_id"] != null)
                    {
                        operation.Add("sort_id", row["sort_id"].ToString());
                    }
                    if (row["op_barCode"] != null)
                    {
                        operation.Add("op_barCode", row["op_barCode"].ToString());
                    }
                    if (row["is_contextmenu"] != null)
                    {
                        operation.Add("is_contextmenu", row["is_contextmenu"].ToString());
                    }
                    if (row["op_objectType"] != null)
                    {
                        operation.Add("op_objectType", row["op_objectType"].ToString());
                    }
                    operations.Add(operation);
                    //buttonGroup.Items.Add(operation);
                }
            }

            return(operations);
        }
Exemplo n.º 4
0
        private void rBut_ok_Click(object sender, EventArgs e)
        {
            DataSet   set            = new DataSet();
            DataTable windowsXPTable = new DataTable("WindowsXP"); //新建一个柱型来显示数据
            DataTable windows7Table  = new DataTable("Windows7");  //新建一个柱型来显示数据

            set.Tables.Clear();                                    //清除一个柱型的数据
            windowsXPTable.Rows.Clear();                           //清除柱型数据
            windows7Table.Rows.Clear();                            //清除柱型数据
            radChartView1.Series.Clear();                          //清除数据柱型图数据
            set.Tables.Add(windowsXPTable);                        //给柱型添加数据
            set.Tables.Add(windows7Table);                         //给柱型添加数据
            foreach (DataTable table in set.Tables)                //循环给每条柱型添加数据
            {
                table.Columns.Add("Month");                        //表示柱型下面的数据
                table.Columns.Add("Usage", typeof(double));        //给每条柱型添加数值
                // table.Columns.Add("Usage1", typeof(double));
            }

            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            int           yearInt         = int.Parse(cb_year.Text);                            //讲年份转化成int类型

            SortedList bb = new SortedList();                                                   // 给存储过程传值的集合

            bb.Add("firstTime", new DateTime(yearInt - 1, 1, 1));                               //时间
            DataSet result = reCnasRemotCall.RemotInterface.ExecuteProcedure("secondsend", bb); //根据时间,类型查询返回所需要的数据

            if (result != null && result.Tables != null && result.Tables.Count > 0)
            {
                int       selectYearTotal = 0;
                int       beforeYearTotal = 0;
                DataTable table           = result.Tables[0];
                for (int i = 0; i < 2; i++)//用于判断是哪一年的
                {
                    int calYear = i == 0 ? yearInt : yearInt - 1;
                    //j表示哪一月
                    for (int j = 1; j < 13; j++)
                    {
                        string  calMonth = calYear.ToString() + j.ToString().PadLeft(2, '0');
                        DataRow rowData  = null;
                        if (table.Rows != null)
                        {
                            foreach (DataRow row in table.Rows)
                            {
                                if (row["calMonth"] != null && row["calMonth"].ToString() == calMonth)
                                {
                                    rowData = row;
                                    break;
                                }
                            }
                        }


                        if (rowData == null)
                        {
                            if (calYear.ToString() == cb_year.Text && j.ToString() == cb_month.Text)
                            {
                                c1RG7.Value = 0;
                            }
                            if (i == 0)
                            {
                                windowsXPTable.Rows.Add(GetMonthLbl(j.ToString()), 0);
                            }
                            else
                            {
                                windows7Table.Rows.Add(GetMonthLbl(j.ToString()), 0);
                            }
                        }
                        else
                        {
                            double calResult = rowData["result"] is DBNull ? 0 : Convert.ToDouble(rowData["result"]);
                            if (calYear.ToString() == cb_year.Text && j.ToString() == cb_month.Text)
                            {
                                c1RG7.Value = calResult;
                            }
                            if (i == 0)
                            {
                                windowsXPTable.Rows.Add(GetMonthLbl(j.ToString()), calResult);
                                selectYearTotal += rowData["ccount"] is DBNull ? 0 : int.Parse(rowData["ccount"].ToString());
                            }
                            else
                            {
                                beforeYearTotal += rowData["ccount"] is DBNull ? 0 : int.Parse(rowData["ccount"].ToString());
                                windows7Table.Rows.Add(GetMonthLbl(j.ToString()), calResult);
                            }
                        }
                    }
                    RefreshDataGrid(table);
                }


                currentYearTxt.Text = selectYearTotal.ToString();
                lastyeartet.Text    = beforeYearTotal.ToString();
                radLabel3.Text      = beforeYearTotal == selectYearTotal ? "平稳" : (beforeYearTotal > selectYearTotal) ? "下降" : "上升";
            }

            this.radChartView1.DataSource = set;
            BarSeries windowsXPSeries = new BarSeries("Usage", "Month");

            windowsXPSeries.DataMember  = "WindowsXP";
            windowsXPSeries.LegendTitle = "Windows XP";
            BarSeries windows7Series = new BarSeries("Usage", "Month");

            windows7Series.DataMember  = "Windows7";
            windows7Series.LegendTitle = "Windows 7";
            windowsXPSeries.ShowLabels = true;
            windows7Series.ShowLabels  = true;
            this.radChartView1.Series.AddRange(windowsXPSeries, windows7Series);
        }
        private void load_pdpar()
        {
            dgv_04.Rows.Clear();
            dgv_05.Rows.Clear();
            cb_par.Items.Clear();
            //sl_PCdata.Clear();
            string     strappid = str_prid;
            SortedList sttemp02 = new SortedList();

            //sttemp02.Add(1, strappid);
            sttemp02.Add(1, CnasBaseData.SystemID);
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            DataTable     dt01            = reCnasRemotCall.RemotInterface.SelectData("HCS-pdbasepar-sec01", sttemp02);

            SortedList sttemp01 = new SortedList();

            sttemp01.Add(1, strappid);
            DataTable dt02 = reCnasRemotCall.RemotInterface.SelectData("HCS-pdpar-sec01", sttemp01);

            if (dt01 != null)
            {
                string secid = "";
                for (int i = 0; i < dt01.Rows.Count; i++)
                {
                    secid = dt01.Rows[i]["id"].ToString();
                    dgv_04.RowCount++;
                    //int ii = dgv_04.RowCount - 1;
                    dgv_04.Rows[i].Cells[0].Value = false;
                    if (dt01.Rows[i]["id"] != null)
                    {
                        dgv_04.Rows[i].Cells["id04"].Value = dt01.Rows[i]["id"].ToString();
                    }
                    if (dt01.Rows[i]["pd_id"] != null)
                    {
                        dgv_04.Rows[i].Cells["pd_id04"].Value = dt01.Rows[i]["pd_id"].ToString();
                    }
                    if (dt01.Rows[i]["par_code"] != null)
                    {
                        dgv_04.Rows[i].Cells["par_code04"].Value = dt01.Rows[i]["par_code"].ToString();
                    }
                    if (dt01.Rows[i]["par_name"] != null)
                    {
                        dgv_04.Rows[i].Cells["par_name04"].Value = dt01.Rows[i]["par_name"].ToString();
                    }
                    if (dt01.Rows[i]["par_def_value"] != null)
                    {
                        dgv_04.Rows[i].Cells["par_def_value04"].Value = dt01.Rows[i]["par_def_value"].ToString();
                    }
                    if (dt01.Rows[i]["par_type"] != null)
                    {
                        dgv_04.Rows[i].Cells["par_type04"].Value = dt01.Rows[i]["par_type"].ToString();
                    }
                    if (dt01.Rows[i]["par_description"] != null)
                    {
                        dgv_04.Rows[i].Cells["par_description04"].Value = dt01.Rows[i]["par_description"].ToString();
                    }
                    if (dt02 != null)
                    {
                        DataRow[] arrayDR01 = dt02.Select("par_id=" + secid);
                        if (arrayDR01.Length > 0)
                        {
                            dgv_04.Rows[i].Cells["isselected4"].Value = true;
                            dgv_05.RowCount++;
                            int ii = dgv_05.RowCount - 1;
                            if (dt01.Rows[i]["id"] != null)
                            {
                                dgv_05.Rows[ii].Cells["id05"].Value = dt01.Rows[i]["id"].ToString();
                            }
                            if (dt01.Rows[i]["pd_id"] != null)
                            {
                                dgv_05.Rows[ii].Cells["pd_id05"].Value = dt01.Rows[i]["pd_id"].ToString();
                            }
                            if (dt01.Rows[i]["par_code"] != null)
                            {
                                dgv_05.Rows[ii].Cells["par_code05"].Value = dt01.Rows[i]["par_code"].ToString();
                            }
                            if (dt01.Rows[i]["par_name"] != null)
                            {
                                dgv_05.Rows[ii].Cells["par_name05"].Value = dt01.Rows[i]["par_name"].ToString();
                            }
                            if (dt01.Rows[i]["par_def_value"] != null)
                            {
                                dgv_05.Rows[ii].Cells["par_def_value05"].Value = dt01.Rows[i]["par_def_value"].ToString();
                            }
                            if (dt01.Rows[i]["par_type"] != null)
                            {
                                dgv_05.Rows[ii].Cells["par_type05"].Value = dt01.Rows[i]["par_type"].ToString();
                            }
                            if (dt01.Rows[i]["par_description"] != null)
                            {
                                dgv_05.Rows[ii].Cells["par_description05"].Value = dt01.Rows[i]["par_description"].ToString();
                            }
                            if (arrayDR01[0]["par_priority"] != null)
                            {
                                dgv_05.Rows[ii].Cells["par_priority05"].Value = arrayDR01[0]["par_priority"].ToString();
                            }
                            else
                            {
                                dgv_05.Rows[ii].Cells["par_priority05"].Value = "";
                            }
                            string strkey_code   = dt01.Rows[i]["par_name"].ToString();
                            string strvalue_code = dt01.Rows[i]["par_description"].ToString();
                            //sl_PCdata.Add(strkey_code, strvalue_code);
                            cb_par.Items.Add(strvalue_code + ":" + strkey_code);
                        }
                    }
                }
            }

            if (dgv_05.RowCount > 0)
            {
                tb_26.Text = dgv_05.Rows[0].Cells["id05"].Value.ToString();
            }
            this.loadparvalue();
            but_01.Enabled = true;
        }
Exemplo n.º 6
0
        private void rBut_ok_Click(object sender, EventArgs e)
        {
            //c1RG6.Value = 0;
            DataSet   set            = new DataSet();
            DataTable windowsXPTable = new DataTable("WindowsXP");
            DataTable windows7Table  = new DataTable("Windows7");

            set.Tables.Clear();
            windowsXPTable.Rows.Clear();
            windows7Table.Rows.Clear();
            radChartView1.Series.Clear();
            set.Tables.Add(windowsXPTable);
            set.Tables.Add(windows7Table);
            foreach (DataTable table in set.Tables)
            {
                table.Columns.Add("Month");
                table.Columns.Add("Usage", typeof(double));
                // table.Columns.Add("Usage1", typeof(double));
            }

            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            int           yearInt         = int.Parse(cb_year.Text);

            SortedList bb     = new SortedList();
            DataSet    result = null;

            bb.Add("time", new DateTime(yearInt - 1, 1, 1));
            if (N_type == "207")//湿包项
            {
                bb.Add("norm1", "208");
                bb.Add("norm", N_type);
                result = reCnasRemotCall.RemotInterface.ExecuteProcedure("total_average1", bb);
            }
            else if (N_type == "301")//灭菌失败项
            {
                bb.Add("norm1", "302");
                bb.Add("norm2", "303");
                bb.Add("norm", N_type);
                result = reCnasRemotCall.RemotInterface.ExecuteProcedure("total_average2", bb);
            }
            else
            {
                bb.Add("norm", N_type);
                result = reCnasRemotCall.RemotInterface.ExecuteProcedure("total_average", bb);
            }


            if (result != null && result.Tables != null && result.Tables.Count > 0)
            {
                int       selectYearTotal = 0;
                int       beforeYearTotal = 0;
                DataTable table           = result.Tables[0];
                for (int i = 0; i < 2; i++)
                {
                    int calYear = i == 0 ? yearInt : yearInt - 1;
                    for (int j = 1; j < 13; j++)
                    {
                        string  calMonth = calYear.ToString() + j.ToString().PadLeft(2, '0');
                        DataRow rowData  = null;
                        if (table.Rows != null)
                        {
                            foreach (DataRow row in table.Rows)
                            {
                                if (row["calMonth"] != null && row["calMonth"].ToString() == calMonth)
                                {
                                    rowData = row;
                                    break;
                                }
                            }
                        }


                        if (rowData == null)
                        {
                            if (calYear.ToString() == cb_year.Text && j.ToString() == DateTime.Now.Month.ToString())
                            {
                                c1RG.Value = 0;
                            }
                            if (i == 0)
                            {
                                windowsXPTable.Rows.Add(GetMonthLbl(j.ToString()), 0);
                            }
                            else
                            {
                                windows7Table.Rows.Add(GetMonthLbl(j.ToString()), 0);
                            }
                        }
                        else
                        {
                            double calResult = rowData["total"] is DBNull ? 0 : Convert.ToDouble(rowData["total"]);
                            if (calYear.ToString() == cb_year.Text && j.ToString() == DateTime.Now.Month.ToString())
                            {
                                c1RG.Value = calResult;
                            }
                            if (i == 0)
                            {
                                windowsXPTable.Rows.Add(GetMonthLbl(j.ToString()), calResult);
                                selectYearTotal += rowData["total"] is DBNull ? 0 : int.Parse(rowData["total"].ToString());
                            }
                            else
                            {
                                beforeYearTotal += rowData["total"] is DBNull ? 0 : int.Parse(rowData["total"].ToString());
                                windows7Table.Rows.Add(GetMonthLbl(j.ToString()), calResult);
                            }
                        }
                    }
                }
                RefreshDataGrid(table);
                if (cb_year.Text == DateTime.Now.Year.ToString())//只显示今年和去年的数据
                {
                    currentYearTxt.Text = selectYearTotal.ToString();
                    lastyeartet.Text    = beforeYearTotal.ToString();
                    radLabel3.Text      = beforeYearTotal == selectYearTotal ? "平稳" : (beforeYearTotal > selectYearTotal) ? "下降" : "上升";
                }
            }


            this.radChartView1.DataSource = set;
            BarSeries windowsXPSeries = new BarSeries("Usage", "Month");

            windowsXPSeries.DataMember  = "WindowsXP";
            windowsXPSeries.LegendTitle = "Windows XP";
            BarSeries windows7Series = new BarSeries("Usage", "Month");

            windows7Series.DataMember  = "Windows7";
            windows7Series.LegendTitle = "Windows 7";
            windowsXPSeries.ShowLabels = true;
            windows7Series.ShowLabels  = true;
            this.radChartView1.Series.AddRange(windowsXPSeries, windows7Series);
        }
        private void select_pd(string inpdid)
        {
            dgv_02.Rows.Clear();
            dgv_03.Rows.Clear();
            #region 获取流程允许扫描码
            DataRow[] arrayDRsecpd = dtall.Select("pd_code=" + inpdid);
            tb_pdscan.Text = arrayDRsecpd[0]["pd_scan"].ToString();
            #endregion
            PD_codeData = inpdid;

            #region 获取已经配置好流程数据
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();
            sttemp01.Add(1, inpdid);
            dtselect = reCnasRemotCall.RemotInterface.SelectData("HCS-procedure_relation-sec001", sttemp01);
            if (dtall != null)
            {
                if (dtselect == null)
                {
                    for (int i = 0; i < dtall.Rows.Count; i++)
                    {
                        string str_id = "", str_name = "";
                        if (dtall.Rows[i]["pd_code"] != null)
                        {
                            str_id = dtall.Rows[i]["pd_code"].ToString();
                        }
                        if (dtall.Rows[i]["pd_name"] != null)
                        {
                            str_name = dtall.Rows[i]["pd_name"].ToString();
                        }
                        DataGridViewRow drtemp01 = new DataGridViewRow();
                        drtemp01.Cells.Add(new DataGridViewCheckBoxCell()); //选择
                        drtemp01.Cells.Add(new DataGridViewTextBoxCell());  //id
                        drtemp01.Cells.Add(new DataGridViewTextBoxCell());  //名称
                        drtemp01.SetValues(false, str_id, str_name);
                        dgv_02.Rows.Add(drtemp01);
                    }
                }
                else
                {
                    for (int i = 0; i < dtall.Rows.Count; i++)
                    {
                        string str_id = "", str_name = "", str_priority = "0", str_condition = "";
                        if (dtall.Rows[i]["pd_code"] != null)
                        {
                            str_id = dtall.Rows[i]["pd_code"].ToString();
                        }
                        if (dtall.Rows[i]["pd_name"] != null)
                        {
                            str_name = dtall.Rows[i]["pd_name"].ToString();
                        }
                        DataRow[] arrayDRsec = dtselect.Select("next_pdcode=" + str_id);

                        DataGridViewRow drtemp01 = new DataGridViewRow();
                        drtemp01.Cells.Add(new DataGridViewCheckBoxCell()); //选择
                        drtemp01.Cells.Add(new DataGridViewTextBoxCell());  //id
                        drtemp01.Cells.Add(new DataGridViewTextBoxCell());  //名称
                        if (arrayDRsec.Length == 0)
                        {
                            drtemp01.SetValues(false, str_id, str_name);
                        }
                        else
                        {
                            drtemp01.SetValues(true, str_id, str_name);
                            if (arrayDRsec[0]["pr_priority"] != null)
                            {
                                str_priority = arrayDRsec[0]["pr_priority"].ToString();
                            }
                            if (arrayDRsec[0]["pr_condition"] != null)
                            {
                                str_condition = arrayDRsec[0]["pr_condition"].ToString();
                            }
                            DataGridViewRow drtemp02 = new DataGridViewRow();
                            drtemp02.Cells.Add(new DataGridViewTextBoxCell());
                            drtemp02.Cells.Add(new DataGridViewTextBoxCell());
                            drtemp02.Cells.Add(new DataGridViewTextBoxCell());
                            drtemp02.Cells.Add(new DataGridViewTextBoxCell());
                            drtemp02.SetValues(str_id, str_name, str_priority, str_condition);
                            dgv_03.Rows.Add(drtemp02);
                        }
                        dgv_02.Rows.Add(drtemp01);
                    }
                    dgv_03.Sort(dgv_03.Columns["pr_priority"], ListSortDirection.Ascending);
                }
            }
            SortedList sttemp02 = new SortedList();
            sttemp02.Add(1, inpdid);
            //string testConfigSql = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-pdparametervalue-sec04", sttemp01);
            dtpartvalueconfig = reCnasRemotCall.RemotInterface.SelectData("HCS-pdparametervalue-sec04", sttemp02);
            #endregion


            #region 获取允许配置的参数

            cb_par.Items.Clear();
            cb_value.Items.Clear();
            SortedList sttemp05 = new SortedList();
            sttemp05.Add(1, inpdid);
            sttemp05.Add(2, 9);
            DataTable dt01 = reCnasRemotCall.RemotInterface.SelectData("HCS-pdparameter-sec03", sttemp05);
            if (dt01 != null)
            {
                for (int i = 0; i < dt01.Rows.Count; i++)
                {
                    string strpar_code   = dt01.Rows[i]["par_code"].ToString();
                    string strkey_code   = dt01.Rows[i]["par_name"].ToString();
                    string strvalue_code = dt01.Rows[i]["par_description"].ToString();
                    cb_par.Items.Add(strvalue_code + ":" + strkey_code + ":" + strpar_code);
                }
            }

            #endregion
        }
        public HCSSM_user_group_app(string str_groupid, string str_gpname, string str_gptype)
        {
            InitializeComponent();
            this.but_addall.Image = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "allRight", EnumImageType.PNG);
            this.but_addone.Image = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "rightShift", EnumImageType.PNG);
            this.but_reall.Image  = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "allLeft", EnumImageType.PNG);
            this.but_reaone.Image = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "leftShift", EnumImageType.PNG);
            this.but_save.Image   = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "savePicture", EnumImageType.PNG);

            //this.Font = new Font(this.Font.FontFamily, 11);
            this.Text  = ConfigurationManager.AppSettings["SystemName"].ToString() + "--配置群组";
            Icon       = new Icon(ResourcesImageHelper.Instance.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO));
            Strgroupid = str_groupid;
            this.Text  = this.Text + "  " + str_gptype + "->" + str_gpname;
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            sttemp01.Add(1, CnasBaseData.SystemID);


            string a = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-app-sec001", sttemp01);

            dtappall = reCnasRemotCall.RemotInterface.SelectData("HCS-app-sec001", sttemp01);

            SortedList sttemp02 = new SortedList();

            sttemp02.Add(1, str_groupid);



            string b = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-usergroup_app-sec001", sttemp01);

            dtgpappall = reCnasRemotCall.RemotInterface.SelectData("HCS-usergroup_app-sec001", sttemp02);

            if (dtappall != null)
            {
                DataRow[] arrayDR = dtappall.Select("app_type=1");
                if (dtgpappall == null)//无配置文件,全部放到dvg_01
                {
                    foreach (DataRow dr in arrayDR)
                    {
                        string str_id = "", str_app_name = "", str_app_briefcode = "";
                        if (dtappall.Columns.Contains("id") && dr["id"] != null)
                        {
                            str_id = dr["id"].ToString();
                        }
                        if (dtappall.Columns.Contains("app_name") && dr["app_name"] != null)
                        {
                            str_app_name = dr["app_name"].ToString();
                        }
                        if (dtappall.Columns.Contains("app_briefcode") && dr["app_briefcode"] != null)
                        {
                            str_app_briefcode = dr["app_briefcode"].ToString();
                        }
                        GridViewRowInfo drtemp01 = null;
                        //drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
                        //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
                        //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//简码
                        //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
                        //drtemp01.SetValues(false, str_id, str_app_briefcode, str_app_name);
                        //dgv_01.Rows.Add(drtemp01);
                        drtemp01 = dgv_01.Rows.AddNew();
                        sl_allapp.Add(str_id, str_app_name);
                        if (drtemp01 != null)
                        {
                            drtemp01.Cells[0].Value = false;
                            drtemp01.Cells[1].Value = str_id;
                            drtemp01.Cells[2].Value = str_app_briefcode;
                            drtemp01.Cells[3].Value = str_app_name;
                        }

                        drtemp01.Tag = dr;
                    }
                }
                else
                {
                    foreach (DataRow dr in arrayDR)
                    {
                        string str_id = "", str_app_name = "", str_app_briefcode = "";
                        if (dtappall.Columns.Contains("id") && dr["id"] != null)
                        {
                            str_id = dr["id"].ToString();
                        }
                        if (dtappall.Columns.Contains("app_name") && dr["app_name"] != null)
                        {
                            str_app_name = dr["app_name"].ToString();
                        }
                        if (dtappall.Columns.Contains("app_briefcode") && dr["app_briefcode"] != null)
                        {
                            str_app_briefcode = dr["app_briefcode"].ToString();
                        }
                        GridViewRowInfo drtemp01 = null;
                        //drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
                        //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
                        //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//简码
                        //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
                        //drtemp01.SetValues(false, str_id, str_app_briefcode, str_app_name);
                        DataRow[] arrayDRsec = dtgpappall.Select("app_id=" + str_id);
                        if (arrayDRsec.Length > 0)
                        {
                            //dgv_02.Rows.Add(drtemp01);
                            drtemp01 = dgv_02.Rows.AddNew();
                            sl_gpapp.Add(str_id, str_app_name);
                        }
                        else
                        {
                            drtemp01 = dgv_01.Rows.AddNew();
                            sl_allapp.Add(str_id, str_app_name);
                        }
                        if (drtemp01 != null)
                        {
                            drtemp01.Cells[0].Value = false;
                            drtemp01.Cells[1].Value = str_id;
                            drtemp01.Cells[2].Value = str_app_briefcode;
                            drtemp01.Cells[3].Value = str_app_name;
                        }

                        drtemp01.Tag = dr;
                    }
                }
            }
        }
        private void but_sel_Click(object sender, EventArgs e)
        {
            DataRow[] arrayDR = null;
            dgv_01.Rows.Clear();
            string strsecdata = tb_sname.Text.Trim();

            string        str_usertp      = Sl_type_02.GetKey(Sl_type_02.IndexOfValue(this.cb_customer.Text)).ToString();
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            sttemp01.Add(1, CnasBaseData.SystemID);
            // string sql = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-set-sec004", sttemp01);
            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-set-sec004", sttemp01);

            if (str_usertp == "0")//查询所有客户的基本包
            {
                arrayDR = getdt.Select(" ca_name like '%" + strsecdata + "%' ");
            }
            else
            {
                arrayDR = getdt.Select("customer_code=" + "'" + str_usertp + "'" + " and ( ca_name like '%" + strsecdata + "%' )");//根据客户查询包
            }

            int ii = arrayDR.Length;

            if (ii <= 0)
            {
                return;
            }
            dgv_01.RowCount = ii;
            int i = 0;

            foreach (DataRow dr in arrayDR)
            {
                if (getdt.Rows[i]["id"] != null)
                {
                    dgv_01.Rows[i].Cells["id"].Value = dr["id"].ToString();
                }
                if (getdt.Rows[i]["ca_name"] != null)
                {
                    dgv_01.Rows[i].Cells["ca_name"].Value = dr["ca_name"].ToString();
                }
                if (getdt.Rows[i]["cost_center"] != null)
                {
                    dgv_01.Rows[i].Cells["cost_center"].Value = Sl_type_01[dr["cost_center"].ToString()].ToString();
                }
                if (getdt.Rows[i]["bar_code"] != null)
                {
                    dgv_01.Rows[i].Cells["bar_code"].Value = dr["bar_code"].ToString();
                }
                if (getdt.Rows[i]["ca_position"] != null)
                {
                    dgv_01.Rows[i].Cells["ca_position"].Value = dr["ca_position"].ToString();
                }
                if (getdt.Rows[i]["cre_date"] != null)
                {
                    dgv_01.Rows[i].Cells["cre_date"].Value = dr["cre_date"].ToString();
                }
                if (getdt.Rows[i]["mod_date"] != null)
                {
                    dgv_01.Rows[i].Cells["mod_date"].Value = dr["mod_date"].ToString();
                }
                i++;
            }

            dgv_01.Rows[0].Selected = true;
        }
Exemplo n.º 10
0
        private void but_ok_Click_1(object sender, EventArgs e)
        {
            dgv_01.Rows.Clear();
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            sttemp01.Add(1, user_id);
            sttemp01.Add(2, dt_start.Value);
            sttemp01.Add(3, dt_end.Value);
            try
            {
                // string text = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-user-set-sec001", sttemp01);
                DataTable dtUsers = reCnasRemotCall.RemotInterface.SelectData("HCS-user-set-sec001", sttemp01);

                if (dtUsers != null && dtUsers.Rows.Count > 0)
                {
                    int ii = dtUsers.Rows.Count;
                    if (ii <= 0)
                    {
                        return;
                    }
                    dgv_01.RowCount = ii;
                    for (int i = 0; i < ii; i++)
                    {
                        if (dtUsers.Columns.Contains("set_code") && dtUsers.Rows[i]["set_code"] != null)
                        {
                            dgv_01.Rows[i].Cells["bar_code"].Value = dtUsers.Rows[i]["set_code"].ToString();
                        }
                        if (dtUsers.Columns.Contains("set_name") && dtUsers.Rows[i]["set_name"] != null)
                        {
                            dgv_01.Rows[i].Cells["ca_name"].Value = dtUsers.Rows[i]["set_name"].ToString();
                        }
                        if (dtUsers.Columns.Contains("pd_name") && dtUsers.Rows[i]["pd_name"] != null)
                        {
                            dgv_01.Rows[i].Cells["wf_code"].Value = dtUsers.Rows[i]["pd_name"].ToString();
                        }
                        if (dtUsers.Columns.Contains("cre_date") && dtUsers.Rows[i]["cre_date"] != null)
                        {
                            dgv_01.Rows[i].Cells["cre_date"].Value = dtUsers.Rows[i]["cre_date"].ToString();
                        }
                        if (dtUsers.Columns.Contains("mod_date") && dtUsers.Rows[i]["mod_date"] != null)
                        {
                            dgv_01.Rows[i].Cells["end_date"].Value = dtUsers.Rows[i]["mod_date"].ToString();
                        }
                    }
                    tb_inum.Text      = dtUsers.Rows.Count.ToString();
                    dgv_01.CurrentRow = dgv_01.Rows[0];
                }
                SortedList SLkey_value = new SortedList();
                SLkey_value.Add("first_time", dt_start.Value);
                SLkey_value.Add("end_time", dt_end.Value);
                SLkey_value.Add("userid", user_id);
                DataSet DSnorm = new DataSet();
                DSnorm = reCnasRemotCall.RemotInterface.ExecuteProcedure("performance_appraisal", SLkey_value);
                if (DSnorm == null)
                {
                    return;
                }
                if (DSnorm.Tables[0] != null && DSnorm.Tables[0].Rows.Count > 0)
                {
                    DataRow[] arrayDR = null;
                    dgv_02.Rows.Clear();

                    arrayDR = DSnorm.Tables[0].Select();
                    int ii = arrayDR.Length;
                    if (ii <= 0)
                    {
                        return;
                    }
                    dgv_02.RowCount = ii;
                    int i = 0;
                    foreach (DataRow dr in arrayDR)
                    {
                        if (DSnorm.Tables[0].Columns.Contains("num") && DSnorm.Tables[0].Rows[i]["num"] != null)
                        {
                            dgv_02.Rows[i].Cells["num"].Value = dr["num"].ToString();
                        }
                        if (DSnorm.Tables[0].Columns.Contains("user_id") && DSnorm.Tables[0].Rows[i]["user_id"] != null)
                        {
                            dgv_02.Rows[i].Cells["user"].Value = dr["user_id"].ToString();
                        }
                        if (DSnorm.Tables[0].Columns.Contains("wf_code") && DSnorm.Tables[0].Rows[i]["wf_code"] != null)
                        {
                            dgv_02.Rows[i].Cells["wf_code"].Value = dr["wf_code"].ToString();
                        }
                        if (DSnorm.Tables[0].Columns.Contains("isconfirm") && DSnorm.Tables[0].Rows[i]["isconfirm"] != null)
                        {
                            dgv_02.Rows[i].Cells["isconfirm"].Value = dr["isconfirm"].ToString();
                        }
                        if (DSnorm.Tables[0].Columns.Contains("pd_name") && DSnorm.Tables[0].Rows[i]["pd_name"] != null)
                        {
                            dgv_02.Rows[i].Cells["pd_name"].Value = dr["pd_name"].ToString();
                        }
                        i++;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 11
0
        private void Getdata()
        {
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            sttemp01.Add(1, user_id);
            sttemp01.Add(2, dt_start.Value);
            sttemp01.Add(3, dt_end.Value);
            DataTable dtUsers = reCnasRemotCall.RemotInterface.SelectData("HCS-user-set-sec001", sttemp01);

            if (dtUsers != null && dtUsers.Rows.Count > 0)
            {
                DataRow[] arrayDR = null;
                dgv_01.Rows.Clear();
                // string strsecdata = tb_sname.Text.Trim().ToUpper();
                arrayDR = dtUsers.Select();
                int ii = arrayDR.Length;
                if (ii <= 0)
                {
                    return;
                }
                dgv_01.RowCount = ii;
                int i = 0;
                foreach (DataRow dr in arrayDR)
                {
                    if (dtUsers.Columns.Contains("set_code") && dtUsers.Rows[i]["set_code"] != null)
                    {
                        dgv_01.Rows[i].Cells["bar_code"].Value = dr["set_code"].ToString();
                    }
                    if (dtUsers.Columns.Contains("set_name") && dtUsers.Rows[i]["set_name"] != null)
                    {
                        dgv_01.Rows[i].Cells["ca_name"].Value = dr["set_name"].ToString();
                    }
                    if (dtUsers.Columns.Contains("pd_name") && dtUsers.Rows[i]["pd_name"] != null)
                    {
                        dgv_01.Rows[i].Cells["wf_code"].Value = dr["pd_name"].ToString();
                    }
                    if (dtUsers.Columns.Contains("cre_date") && dtUsers.Rows[i]["cre_date"] != null)
                    {
                        dgv_01.Rows[i].Cells["cre_date"].Value = dr["cre_date"].ToString();
                    }
                    if (dtUsers.Columns.Contains("mod_date") && dtUsers.Rows[i]["mod_date"] != null)
                    {
                        dgv_01.Rows[i].Cells["end_date"].Value = dr["mod_date"].ToString();
                    }
                    i++;
                }
                dgv_01.CurrentRow = dgv_01.Rows[0];
            }

            SortedList SLkey_value = new SortedList();

            SLkey_value.Add("first_time", dt_start.Value);
            SLkey_value.Add("end_time", dt_end.Value);
            SLkey_value.Add("userid", user_id);
            DataSet DSnorm = new DataSet();

            DSnorm = reCnasRemotCall.RemotInterface.ExecuteProcedure("performance_appraisal", SLkey_value);
            if (DSnorm.Tables[0] != null && DSnorm.Tables[0].Rows.Count > 0)
            {
                DataRow[] arrayDR = null;
                dgv_02.Rows.Clear();

                arrayDR = DSnorm.Tables[0].Select();
                int ii = arrayDR.Length;
                if (ii <= 0)
                {
                    return;
                }
                dgv_02.RowCount = ii;
                int i = 0;
                foreach (DataRow dr in arrayDR)
                {
                    if (DSnorm.Tables[0].Columns.Contains("num") && DSnorm.Tables[0].Rows[i]["num"] != null)
                    {
                        dgv_02.Rows[i].Cells["num"].Value = dr["num"].ToString();
                    }
                    if (DSnorm.Tables[0].Columns.Contains("user_id") && DSnorm.Tables[0].Rows[i]["user_id"] != null)
                    {
                        dgv_02.Rows[i].Cells["user"].Value = dr["user_id"].ToString();
                    }
                    if (DSnorm.Tables[0].Columns.Contains("wf_code") && DSnorm.Tables[0].Rows[i]["wf_code"] != null)
                    {
                        dgv_02.Rows[i].Cells["wf_code"].Value = dr["wf_code"].ToString();
                    }
                    if (DSnorm.Tables[0].Columns.Contains("isconfirm") && DSnorm.Tables[0].Rows[i]["isconfirm"] != null)
                    {
                        dgv_02.Rows[i].Cells["isconfirm"].Value = dr["isconfirm"].ToString();
                    }
                    if (DSnorm.Tables[0].Columns.Contains("pd_name") && DSnorm.Tables[0].Rows[i]["pd_name"] != null)
                    {
                        dgv_02.Rows[i].Cells["pd_name"].Value = dr["pd_name"].ToString();
                    }
                    i++;
                }
            }
        }
        private void but_select_Click_1(object sender, EventArgs e)
        {
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    slttmp          = new SortedList();
            string        SqlWhere        = string.Format("(s_room like '%{0}%' and s_basket like '%{1}%' and s_cabinet like '%{2}%')", tb_room.Text, tb_lan.Text, tb_gui.Text);

            //slttmp.Add(1, tb_room.Text);
            //slttmp.Add(2, tb_gui.Text);
            //slttmp.Add(3, tb_lan.Text);
            slttmp.Add(1, SqlWhere);
            // string gg = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-storage-sec0010", slttmp);
            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-storage-sec0010", slttmp);

            dgv_02.Rows.Clear();
            if (getdt != null)
            {
                for (int i = 0; i < getdt.Rows.Count; i++)
                {
                    if (getdt.Rows[i]["bar_code"].ToString() != "")
                    {
                        int dgvIndex = dgv_02.Rows.AddNew().Index;
                        if (getdt.Columns.Contains("ca_name") && !string.IsNullOrEmpty(getdt.Rows[i]["ca_name"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_set"].Value = getdt.Rows[i]["ca_name"];
                        }
                        if (getdt.Columns.Contains("bar_code") && !string.IsNullOrEmpty(getdt.Rows[i]["bar_code"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_barcode"].Value = getdt.Rows[i]["bar_code"];
                        }
                        if (getdt.Columns.Contains("s_name") && !string.IsNullOrEmpty(getdt.Rows[i]["s_name"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_stor"].Value = getdt.Rows[i]["s_name"];
                        }
                        if (getdt.Columns.Contains("s_room") && !string.IsNullOrEmpty(getdt.Rows[i]["s_room"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_room"].Value = getdt.Rows[i]["s_room"];
                        }
                        if (getdt.Columns.Contains("s_basket") && !string.IsNullOrEmpty(getdt.Rows[i]["s_basket"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_lan"].Value = getdt.Rows[i]["s_basket"];
                        }
                        if (getdt.Columns.Contains("mod_date") && !string.IsNullOrEmpty(getdt.Rows[i]["mod_date"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["time"].Value = getdt.Rows[i]["mod_date"];
                        }
                        if (getdt.Columns.Contains("ca_expiration") && !string.IsNullOrEmpty(getdt.Rows[i]["ca_expiration"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["baozhi"].Value = getdt.Rows[i]["ca_expiration"];
                        }
                        if (getdt.Columns.Contains("mod_date") && !string.IsNullOrEmpty(getdt.Rows[i]["mod_date"].ToString()))
                        {
                            string   a       = getdt.Rows[i]["mod_date"].ToString();
                            DateTime time1   = DateTime.Parse(a);
                            TimeSpan time2   = DateTime.Now.Subtract(time1);
                            int      tianshu = time2.Days;
                            if (tianshu < int.Parse(getdt.Rows[i]["ca_expiration"].ToString()))
                            {
                                dgv_02.Rows[dgvIndex].Cells["out"].Value = int.Parse(getdt.Rows[i]["ca_expiration"].ToString()) - tianshu;
                            }
                            else
                            {
                                dgv_02.Rows[dgvIndex].Cells["out"].Value = "已过期";
                            }
                        }
                        if (getdt.Columns.Contains("s_cabinet") && !string.IsNullOrEmpty(getdt.Rows[i]["s_cabinet"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_gui"].Value = getdt.Rows[i]["s_cabinet"];
                        }
                        if (getdt.Columns.Contains("location_id") && !string.IsNullOrEmpty(getdt.Rows[i]["location_id"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_location"].Value = sl_location[getdt.Rows[i]["location_id"].ToString()].ToString();
                        }
                    }
                }
                if (dgv_02.RowCount > 0)
                {
                    dgv_02.CurrentRow = dgv_02.Rows[0];
                }
            }
            tb_num.Text = dgv_02.Rows.Count.ToString();
        }
        private void NameGetData()
        {
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    slttmp          = new SortedList();

            slttmp.Add(1, tb_name.Text);

            //string gg = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-storage-sec012", slttmp);
            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-storage-sec012", slttmp);

            dgv_02.Rows.Clear();
            tb_num.Clear();
            if (getdt != null)
            {
                for (int i = 0; i < getdt.Rows.Count; i++)
                {
                    if (getdt.Rows[i]["bar_code"].ToString() != "")
                    {
                        int dgvIndex = dgv_02.Rows.AddNew().Index;
                        if (getdt.Columns.Contains("ca_name") && !string.IsNullOrEmpty(getdt.Rows[i]["ca_name"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_set"].Value = getdt.Rows[i]["ca_name"];
                        }
                        if (getdt.Columns.Contains("bar_code") && !string.IsNullOrEmpty(getdt.Rows[i]["bar_code"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_barcode"].Value = getdt.Rows[i]["bar_code"];
                        }
                        if (getdt.Columns.Contains("s_name") && !string.IsNullOrEmpty(getdt.Rows[i]["s_name"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_stor"].Value = getdt.Rows[i]["s_name"];
                        }
                        if (getdt.Columns.Contains("s_room") && !string.IsNullOrEmpty(getdt.Rows[i]["s_room"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_room"].Value = getdt.Rows[i]["s_room"];
                        }
                        if (getdt.Columns.Contains("s_basket") && !string.IsNullOrEmpty(getdt.Rows[i]["s_basket"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_lan"].Value = getdt.Rows[i]["s_basket"];
                        }
                        if (getdt.Columns.Contains("s_cabinet") && !string.IsNullOrEmpty(getdt.Rows[i]["s_cabinet"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_gui"].Value = getdt.Rows[i]["s_cabinet"];
                        }
                        if (getdt.Columns.Contains("mod_date") && !string.IsNullOrEmpty(getdt.Rows[i]["mod_date"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["time"].Value = getdt.Rows[i]["mod_date"];
                        }
                        if (getdt.Columns.Contains("ca_expiration") && !string.IsNullOrEmpty(getdt.Rows[i]["ca_expiration"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["baozhi"].Value = getdt.Rows[i]["ca_expiration"];
                        }
                        if (getdt.Columns.Contains("mod_date") && !string.IsNullOrEmpty(getdt.Rows[i]["mod_date"].ToString()))
                        {
                            string   a        = getdt.Rows[i]["mod_date"].ToString();
                            DateTime time1    = DateTime.Parse(a);
                            TimeSpan time2    = DateTime.Now.Subtract(time1);
                            int      lastDays = time2.Days;
                            if (lastDays < int.Parse(getdt.Rows[i]["ca_expiration"].ToString()))
                            {
                                dgv_02.Rows[dgvIndex].Cells["out"].Value = int.Parse(getdt.Rows[i]["ca_expiration"].ToString()) - lastDays;
                            }
                            else
                            {
                                dgv_02.Rows[dgvIndex].Cells["out"].Value = "已过期";
                            }
                        }
                        if (getdt.Columns.Contains("location_id") && !string.IsNullOrEmpty(getdt.Rows[i]["location_id"].ToString()))
                        {
                            dgv_02.Rows[dgvIndex].Cells["s_location"].Value = sl_location[getdt.Rows[i]["location_id"].ToString()].ToString();
                        }
                    }
                }
                if (dgv_02.RowCount > 0)
                {
                    dgv_02.CurrentRow = dgv_02.Rows[0];
                }
            }
            tb_num.Text = dgv_02.Rows.Count.ToString();
        }
Exemplo n.º 14
0
        private void but_ok_Click_1(object sender, EventArgs e)
        {
            if (cb_type.Text.Trim() == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("filltype", EnumPromptMessage.warning, new string[] { "成本" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            DataTable     DTtype          = null;
            SortedList    sltemp          = new SortedList();

            sltemp.Add(1, DateTime.Parse(cb_time.Text.ToString()));
            if (stratr == "")
            {
                string gs = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-operating-cost-sec005", sltemp);
                DTtype = reCnasRemotCall.RemotInterface.SelectData("HCS-operating-cost-sec005", sltemp);
            }
            else
            {
                sltemp.Add(2, stratr);
                string gs = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-operating-cost-sec006", sltemp);

                DTtype = reCnasRemotCall.RemotInterface.SelectData("HCS-operating-cost-sec006", sltemp);
            }
            if (DTtype != null && DTtype.Rows.Count > 0)
            {
                for (int i = 0; i < DTtype.Rows.Count; i++)
                {
                    if (cb_type.Text.Substring(0, 1) == DTtype.Rows[i]["operation_type"].ToString())
                    {
                        MessageBox.Show("该月的费用类型已有数据,请重新选择", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                }
            }

            if (tb_money.Text.Trim() == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillmoney", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (stratr == "")
            {
                // CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                SortedList slttmp   = new SortedList();
                SortedList slttmp01 = new SortedList();
                slttmp.Add(1, cb_type.Text.Trim().Substring(0, 1));
                slttmp.Add(2, tb_money.Text.Trim());
                slttmp.Add(3, DateTime.Parse(cb_time.Text.ToString()));
                slttmp.Add(4, sl_user.GetKey(sl_user.IndexOfValue(CnasBaseData.UserName)));
                slttmp.Add(5, tb_remark.Text.Trim());
                slttmp01.Add(1, slttmp);
                string gg     = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-operatingcost-add001", slttmp01, null);
                int    recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-operatingcost-add001", slttmp01, null);
                if (recint > -1)
                {
                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("addsuccessful", EnumPromptMessage.warning, new string[] { "运营成本" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
            }
            else//修改
            {
                SortedList sttemp   = new SortedList();
                SortedList sttemp01 = new SortedList();
                sttemp.Add(1, cb_type.Text.Trim().Substring(0, 1));
                sttemp.Add(2, tb_money.Text.Trim());
                sttemp.Add(3, DateTime.Parse(cb_time.Text.ToString()));
                sttemp.Add(4, sl_user.GetKey(sl_user.IndexOfValue(CnasBaseData.UserName)));
                sttemp.Add(5, stratr);
                sttemp01.Add(1, sttemp);
                // CnasRemotCall reCnasRemotCall=new CnasRemotCall();
                string gg     = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-operatingcost-up001", sttemp01, null);
                int    recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-operatingcost-up001", sttemp01, null);
                if (recint > -1)
                {
                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("updatesuccessful", EnumPromptMessage.warning, new string[] { "运营成本" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
            }
        }
        /// <summary>
        /// 加载数据
        /// </summary>
        private void LoadDataForm()
        {
            setDataGrid.Rows.Clear();

            pdCodeType = GetReleaseMachineType();
            if (pdCodeType == 0)
            {
                MessageBox.Show("内部流程码错误!");
                return;
            }
            if (!string.IsNullOrEmpty(PdCode) && !string.IsNullOrEmpty(_UserCode) && !string.IsNullOrEmpty(_MachineCode))
            {
                CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                SortedList    condition       = new SortedList();
                string        tempDescription = string.Empty;
                DataTable     machineInfo     = null;        //这里查询机器码相关信息
                condition.Add(1, _MachineCode);
                condition.Add(2, CnasBaseData.SystemID);
                int deviceProgramLastTimes = 10;
                //清洗
                if (pdCodeType == 2)
                {
                    string sql = reCnasRemotCall.RemotInterface.CheckSelectData("HCS_work_set_freeinfo_show_sec002", condition);
                    machineInfo = reCnasRemotCall.RemotInterface.SelectData("HCS_work_set_freeinfo_show_sec002", condition);
                }
                //灭菌
                else if (pdCodeType == 1)
                {
                    string sql = reCnasRemotCall.RemotInterface.CheckSelectData("HCS_work_set_freeinfo_show_sec003", condition);
                    machineInfo = reCnasRemotCall.RemotInterface.SelectData("HCS_work_set_freeinfo_show_sec003", condition);
                }
                if (machineInfo != null)
                {
                    //getdt不知道会不会出现多个Row
                    if (machineInfo.Rows != null && machineInfo.Rows.Count > 0)
                    {
                        txtBatch.Text   = GetValueStr(machineInfo.Rows[0]["dev_runtimes"]);
                        machineTxt.Text = GetValueStr(machineInfo.Rows[0]["dev_name"]);
                        txtProgram.Text = GetValueStr(machineInfo.Rows[0]["pr_name"]);
                        int.TryParse(GetValueStr(machineInfo.Rows[0]["pro_runtimes"]), out deviceProgramLastTimes);
                        if (machineInfo.Rows[0]["start_time"] != null)
                        {
                            txtBatchStartDate.Value = DateTime.Parse(machineInfo.Rows[0]["start_time"].ToString());
                            txtBatchEndDate.Value   = txtBatchStartDate.Value.AddMinutes(deviceProgramLastTimes);
                            txtCreateDate.Value     = txtBatchStartDate.Value;
                        }
                        if (machineInfo.Columns.Contains("dev_id") && !(machineInfo.Rows[0]["dev_id"] is DBNull))
                        {
                            _machineId     = machineInfo.Rows[0]["dev_id"].ToString();
                            machineTxt.Tag = _machineId;
                        }
                    }
                }

                //查询datagrid的数据
                condition = new SortedList();
                DataTable data = null;
                condition.Add(1, PdCode);
                condition.Add(2, "0");
                condition.Add(3, _MachineCode);
                setNumTxt.Text = "0";
                data           = reCnasRemotCall.RemotInterface.SelectData("HCS-work-set-sec005", condition);
                if (data != null)
                {
                    DateTime createDate = DateTime.Now;
                    foreach (DataRow item in data.Rows)
                    {
                        DataConverter.ConvertSetData(setDataGrid, item);
                    }

                    setDataGrid.Rows[0].Selected = true;
                }
                AppendTempBCCSet();
                setNumTxt.Text = setDataGrid.RowCount.ToString();
            }
        }
        private void Loaddata(string cu_barcode)
        {
            dgv_01.Rows.Clear();
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            sttemp01.Add(1, CnasBaseData.SystemID);
            DataTable getdt = null;

            if (cu_barcode == null)
            {
                // string sql = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-set-sec004", sttemp01);
                getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-set-sec004", sttemp01);
            }
            else
            {
                sttemp01.Add(2, cu_barcode);
                string sql = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-set-sec003", sttemp01);
                getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-set-sec003", sttemp01);
            }


            if (getdt != null)
            {
                int ii = getdt.Rows.Count;
                if (ii <= 0)
                {
                    return;
                }
                dgv_01.RowCount = ii;
                for (int i = 0; i < ii; i++)
                {
                    if (getdt.Rows[i]["id"] != null)
                    {
                        dgv_01.Rows[i].Cells["id"].Value = getdt.Rows[i]["id"].ToString();
                    }
                    if (getdt.Rows[i]["ca_name"] != null)
                    {
                        dgv_01.Rows[i].Cells["ca_name"].Value = getdt.Rows[i]["ca_name"].ToString();
                    }
                    if (getdt.Rows[i]["cost_center"] != null)
                    {
                        dgv_01.Rows[i].Cells["cost_center"].Value = Sl_type_01[getdt.Rows[i]["cost_center"].ToString()].ToString();
                    }
                    if (getdt.Rows[i]["bar_code"] != null)
                    {
                        dgv_01.Rows[i].Cells["bar_code"].Value = getdt.Rows[i]["bar_code"].ToString();
                    }
                    if (getdt.Rows[i]["ca_position"] != null)
                    {
                        dgv_01.Rows[i].Cells["ca_position"].Value = getdt.Rows[i]["ca_position"].ToString();
                    }
                    if (getdt.Rows[i]["cre_date"] != null)
                    {
                        dgv_01.Rows[i].Cells["cre_date"].Value = getdt.Rows[i]["cre_date"].ToString();
                    }
                    if (getdt.Rows[i]["mod_date"] != null)
                    {
                        dgv_01.Rows[i].Cells["mod_date"].Value = getdt.Rows[i]["mod_date"].ToString();
                    }
                    //    if (getdt.Rows[i]["customer_code"] != null) dgv_01.Rows[i].Cells["customer_code"].Value = getdt.Rows[i]["customer_code"].ToString();
                    if (getdt.Rows[i]["customer_code"] != null)
                    {
                        dgv_01.Rows[i].Cells["customer_code"].Value = Sl_type_02[getdt.Rows[i]["customer_code"].ToString()].ToString();
                    }
                }
            }
            dgv_01.Rows[0].Selected = true;
        }
Exemplo n.º 17
0
        public HCSCM_plasticenvelop_device_procedure(SortedList slselect)
        {
            InitializeComponent();
            //设置窗体图标
            this.Icon             = new Icon(ResourcesImageHelper.Instance.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO));
            this.but_addall.Image = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "allRight", EnumImageType.PNG);
            this.but_addone.Image = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "rightShift", EnumImageType.PNG);
            this.but_reall.Image  = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "allLeft", EnumImageType.PNG);
            this.but_reone.Image  = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "leftShift", EnumImageType.PNG);
            this.but_save.Image   = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "savePicture", EnumImageType.PNG);
            //this.Font = new Font(this.Font.FontFamily, 11);
            this.Text               = styStemName + "--塑封流程";
            this.tb_cssd.Text       = CnasBaseData.SystemInfoData.Rows[0]["customer"].ToString() + "-->" + CnasBaseData.SystemInfoData.Rows[0]["site_name"].ToString();
            this.tb_department.Text = slselect["ca_name"].ToString();
            select_id               = slselect["id"].ToString();


            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            dtall = reCnasRemotCall.RemotInterface.SelectData("HCS-plasticenvelop-program-sec001", null);
            SortedList sttemp02 = new SortedList();

            sttemp02.Add(1, slselect["id"].ToString());
            //  string a = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-plasticenvelop-deviceprogram-sec001", sttemp02);
            dtselect = reCnasRemotCall.RemotInterface.SelectData("HCS-plasticenvelop-deviceprogram-sec001", sttemp02);


            if (dtall != null)
            {
                for (int i = 0; i < dtall.Rows.Count; i++)
                {
                    string str_id = "", str_app_name = "";
                    if (dtall.Columns.Contains("id") && dtall.Rows[i]["id"] != null)
                    {
                        str_id = dtall.Rows[i]["id"].ToString();
                    }
                    if (dtall.Columns.Contains("pr_name") && dtall.Rows[i]["pr_name"] != null)
                    {
                        str_app_name = dtall.Rows[i]["pr_name"].ToString();
                    }

                    GridViewRowInfo drtemp01 = null;
                    //drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
                    //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//id
                    //drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
                    //drtemp01.SetValues(false, str_id, str_app_name);
                    if (dtselect == null)
                    {
                        drtemp01 = dgv_01.Rows.AddNew();
                        sl_allapp.Add(str_id, str_app_name);
                    }
                    else
                    {
                        DataRow[] arrayDRsec = dtselect.Select("p_id=" + str_id);
                        if (arrayDRsec.Length > 0)
                        {
                            drtemp01 = dgv_02.Rows.AddNew();
                            sl_gpapp.Add(str_id, str_app_name);
                        }
                        else
                        {
                            drtemp01 = dgv_01.Rows.AddNew();
                            sl_allapp.Add(str_id, str_app_name);
                        }
                    }
                    if (drtemp01 != null)
                    {
                        drtemp01.Cells[0].Value = str_id;
                        drtemp01.Cells[1].Value = str_app_name;
                    }

                    drtemp01.Tag = dtall.Rows[i];
                }
            }
        }
Exemplo n.º 18
0
        private void GetData()
        {
            dgv_01.Rows.Clear();
            dgv_01.ClearSelection();
            string customerValue = cb_customer.SelectedItem != null && cb_customer.SelectedItem.Value != null?cb_customer.SelectedItem.Value.ToString() : string.Empty;

            string locationValue = cb_location.SelectedItem != null && cb_location.SelectedItem.Value != null?cb_location.SelectedItem.Value.ToString() : string.Empty;


            if (!string.IsNullOrEmpty(customerValue) && !string.IsNullOrEmpty(locationValue))
            {
                string[] ids = customerValue.Split(':');
                if (ids.Length >= 2)
                {
                    CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                    SortedList    slttmp          = new SortedList();
                    slttmp.Add(2, locationValue);
                    slttmp.Add(1, ids[1]);

                    string    qq      = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-work-set-sec010", slttmp);
                    DataTable getdt01 = reCnasRemotCall.RemotInterface.SelectData("HCS-work-set-sec010", slttmp);
                    if (getdt01 != null)
                    {
                        int ii = getdt01.Rows.Count;
                        if (ii <= 0)
                        {
                            return;
                        }
                        dgv_01.RowCount = ii;

                        for (int i = 0; i < ii; i++)
                        {
                            if (getdt01.Columns.Contains("set_code") && !string.IsNullOrEmpty(getdt01.Rows[i]["set_code"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["bar_code"].Value = getdt01.Rows[i]["set_code"].ToString();
                            }
                            if (getdt01.Columns.Contains("ca_name") && !string.IsNullOrEmpty(getdt01.Rows[i]["ca_name"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["name"].Value = getdt01.Rows[i]["ca_name"].ToString();
                            }
                            if (getdt01.Columns.Contains("cu_name") && !string.IsNullOrEmpty(getdt01.Rows[i]["cu_name"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["customer"].Value = getdt01.Rows[i]["cu_name"].ToString();
                            }
                            ;
                            if (getdt01.Columns.Contains("ca_name1") && !string.IsNullOrEmpty(getdt01.Rows[i]["ca_name1"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["costcenter"].Value = getdt01.Rows[i]["ca_name1"].ToString();
                            }
                            if (getdt01.Columns.Contains("u_uname") && !string.IsNullOrEmpty(getdt01.Rows[i]["u_uname"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["location"].Value = getdt01.Rows[i]["u_uname"].ToString();
                            }
                            if (getdt01.Columns.Contains("mod_date1") && !string.IsNullOrEmpty(getdt01.Rows[i]["mod_date1"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["sterilizerdate"].Value = getdt01.Rows[i]["mod_date1"].ToString();
                            }
                            if (getdt01.Columns.Contains("user_name") && !string.IsNullOrEmpty(getdt01.Rows[i]["user_name"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["sterilizeruser"].Value = getdt01.Rows[i]["user_name"].ToString();
                            }
                            if (getdt01.Columns.Contains("user_name1") && !string.IsNullOrEmpty(getdt01.Rows[i]["user_name1"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["washinguser"].Value = getdt01.Rows[i]["user_name1"].ToString();
                            }
                            if (getdt01.Columns.Contains("mod_date2") && !string.IsNullOrEmpty(getdt01.Rows[i]["mod_date2"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["washingdate"].Value = getdt01.Rows[i]["mod_date2"].ToString();
                            }
                            if (getdt01.Columns.Contains("batch") && !string.IsNullOrEmpty(getdt01.Rows[i]["batch"].ToString()))
                            {
                                dgv_01.Rows[i].Cells["batch"].Value = getdt01.Rows[i]["batch"].ToString();
                            }
                        }
                        if (ii > 0)
                        {
                            dgv_01.CurrentRow = dgv_01.Rows[0];
                        }
                    }
                }
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RadForm1_Load(object sender, EventArgs e)
        {
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();

            SortedList sttemp01 = new SortedList();


            //设定一个年份
            int yearValue = 2016;

            DateTime dataNow = DateTime.Now;

            //如果年份等于当前年份则需要处理
            if (yearValue == dataNow.Year)
            {
                //如果年份相等,则判断月份
                if (dataNow.Year == yearValue)
                {
                    //获取当月的最后一天
                    int LastDay = dataNow.AddMonths(1).AddDays(-dataNow.AddMonths(1).Day).Day;
                    //如果日已经达到最后一天,则传入当前月份,否则传入当前月份减一
                    if (dataNow.Day == LastDay)
                    {
                        sttemp01.Add(1, dataNow.Month);
                    }
                    else
                    {
                        sttemp01.Add(1, dataNow.Month - 1);
                    }
                }
            }
            else
            {
                sttemp01.Add(1, 12);
            }
            sttemp01.Add(2, yearValue);

            //处理器械总件数(除以月数的平均数)
            //string text = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-instrument-report-sec001", sttemp01);
            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-instrument-report-sec001", sttemp01);

            c1RadialGauge2.Value = Convert.ToDouble(getdt.Rows[0][0]);


            //处理敷料的总件数(除以月数的平均数)
            DataTable getdt1 = reCnasRemotCall.RemotInterface.SelectData("HCS-instrument-report-sec002", sttemp01);

            c1RadialGauge1.Value = Convert.ToDouble(getdt1.Rows[0][0]);


            //处理外来器械的总件数(除以月数的平均数)
            DataTable getdt2 = reCnasRemotCall.RemotInterface.SelectData("HCS-instrument-report-sec003", sttemp01);

            c1RadialGauge3.Value = Convert.ToDouble(getdt2.Rows[0][0]);


            SortedList sttemp02 = new SortedList();

            sttemp02.Add(1, sttemp01[1]);
            sttemp02.Add(2, sttemp01[1]);


            string text = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-sterilizer-report-sec001", sttemp01);

            //手术器械包次日下送发生率(按月统计)
            DataTable getdt3 = reCnasRemotCall.RemotInterface.SelectData("HCS-instrument-report-sec004", sttemp02);

            //乘以100,表示计算百分比
            c1RadialGauge4.Value = Convert.ToDouble(getdt3.Rows[0][0].ToString() == "" ? 0 : getdt3.Rows[0][0]) * 100;



            //处理外来器械的总件数(除以月数的平均数)
            DataTable getdt4 = reCnasRemotCall.RemotInterface.SelectData("HCS-sterilizer-report-sec001", sttemp01);

            c1RadialGauge5.Value = Convert.ToDouble(getdt4.Rows[0][0]);
        }
Exemplo n.º 20
0
        private void but_ok_Click(object sender, EventArgs e)
        {
            if (tb_name.Text.Trim() == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillname", EnumPromptMessage.warning, new string[] { "清洗程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }


            if (this.cb_type.Text == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("filltype", EnumPromptMessage.warning, new string[] { "清洗" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (this.tb_run_time.Text.Trim() == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillruntime", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            try
            {
                if (Strselectid == "")//增加
                {
                    #region 判断名字是否存在
                    CnasRemotCall reCnasRemotCall = new CnasRemotCall();

                    DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-washing-program-sec001", null);//49
                    if (getdt != null)
                    {
                        DataRow[] getdt_01 = getdt.Select();
                        foreach (DataRow dr in getdt_01)
                        {
                            if (tb_name.Text.Trim().ToString() == dr["pr_name"].ToString().Trim())
                            {
                                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("namerepetition", EnumPromptMessage.warning, new string[] { "清洗程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                return;
                            }
                        }
                    }
                    #endregion

                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp.Add(1, tb_name.Text.Trim());
                    sltmp.Add(2, tb_remarks.Text.Trim());
                    sltmp.Add(3, tb_run_time.Text.Trim());
                    sltmp.Add(4, cb_type.Text.Trim().Substring(0, 1));

                    sltmp01.Add(1, sltmp);

                    string strtmp = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-washing-program-add001", sltmp01, null);
                    int    recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-washing-program-add001", sltmp01, null);


                    if (recint > -1)
                    {
                        MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("addsuccessful", EnumPromptMessage.warning, new string[] { "清洗程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
                else
                {
                    #region 判断名字是否存在
                    CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                    if (this.tb_name.Text.Trim() != Strselectname)
                    {
                        DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-washing-program-sec001", null);//49
                        if (getdt != null)
                        {
                            DataRow[] getdt_01 = getdt.Select();
                            foreach (DataRow dr in getdt_01)
                            {
                                if (tb_name.Text.Trim().ToString() == dr["pr_name"].ToString().Trim())
                                {
                                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("namerepetition", EnumPromptMessage.warning, new string[] { "清洗程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }
                    #endregion
                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp01.Add(1, tb_name.Text.Trim());

                    sltmp01.Add(2, tb_remarks.Text.Trim());
                    sltmp01.Add(3, cb_type.Text.Trim().Substring(0, 1));
                    sltmp01.Add(4, tb_run_time.Text.Trim());


                    sltmp01.Add(5, Strselectid);
                    sltmp.Add(1, sltmp01);


                    //      string sql = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-washing-program-up001", sltmp, null);
                    int recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-washing-program-up001", sltmp, null);

                    if (recint > -1)
                    {
                        MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("updatesuccessful", EnumPromptMessage.warning, new string[] { "清洗程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("unknowerror", EnumPromptMessage.error, new string[] { ex.Message }), "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
        private void Loaddata(string cu_barcode)
        {
            dgv_01.Rows.Clear();
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            sttemp01.Add(1, CnasBaseData.SystemID);
            DataTable getdt = null;

            if (cu_barcode == null)
            {
                // string sql = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-orderid-manager-sec001", sttemp01);
                dtsel = getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-orderid-manager-sec001", sttemp01);
            }
            else
            {
                sttemp01.Add(2, cu_barcode);
                //string sql = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-orderid-manager-sec003", sttemp01);
                dtsel = getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-orderid-manager-sec003", sttemp01);
            }


            if (getdt != null)
            {
                int ii = getdt.Rows.Count;
                if (ii <= 0)
                {
                    return;
                }
                dgv_01.RowCount = ii;
                for (int i = 0; i < ii; i++)
                {
                    if (getdt.Columns.Contains("id") && getdt.Rows[i]["id"] != null)
                    {
                        dgv_01.Rows[i].Cells["id"].Value = getdt.Rows[i]["id"].ToString();
                    }
                    if (getdt.Columns.Contains("ca_name") && getdt.Rows[i]["ca_name"] != null)
                    {
                        dgv_01.Rows[i].Cells["ca_name"].Value = getdt.Rows[i]["ca_name"].ToString();
                    }
                    if (getdt.Columns.Contains("bar_code") && getdt.Rows[i]["bar_code"] != null)
                    {
                        dgv_01.Rows[i].Cells["bar_code"].Value = getdt.Rows[i]["bar_code"].ToString();                                                                         //值是bar_code
                    }
                    if (getdt.Columns.Contains("ca_name1") && getdt.Rows[i]["ca_name1"] != null)
                    {
                        dgv_01.Rows[i].Cells["costbar_codename"].Value = getdt.Rows[i]["ca_name1"].ToString();
                        dgv_01.Rows[i].Cells["costbar_code"].Value     = getdt.Rows[i]["costbar_code"].ToString();
                    }
                    if (getdt.Columns.Contains("u_uname") && getdt.Rows[i]["u_uname"] != null)
                    {
                        dgv_01.Rows[i].Cells["location_name"].Value = getdt.Rows[i]["u_uname"].ToString();
                        dgv_01.Rows[i].Cells["location_id"].Value   = getdt.Rows[i]["location_id"].ToString();
                    }
                    if (getdt.Columns.Contains("cu_name") && getdt.Rows[i]["cu_name"] != null)
                    {
                        dgv_01.Rows[i].Cells["customer_barcode"].Value     = getdt.Rows[i]["customer_barcode"].ToString();
                        dgv_01.Rows[i].Cells["customer_barcodename"].Value = getdt.Rows[i]["cu_name"].ToString();
                    }

                    if (getdt.Columns.Contains("cre_date") && getdt.Rows[i]["cre_date"] != null)
                    {
                        dgv_01.Rows[i].Cells["cre_date"].Value = getdt.Rows[i]["cre_date"].ToString();
                    }
                    if (getdt.Columns.Contains("remark") && getdt.Rows[i]["remark"] != null)
                    {
                        dgv_01.Rows[i].Cells["remark"].Value = getdt.Rows[i]["remark"].ToString();
                    }
                }
                if (dgv_01.Rows.Count > 0)
                {
                    dgv_01.CurrentRow = dgv_01.Rows[0];
                }
            }
        }
Exemplo n.º 22
0
        private void LoadFromEvent()
        {
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();

            //器械类型
            DataRow[] typeDR = CnasBaseData.SystemBaseData.Select("type_code='HCS_instrument_type'");
            this.cb_type.Items.Add("----所有----");

            foreach (DataRow dr in typeDR)
            {
                cb_type.Items.Add(dr["value_code"].ToString().Trim());
            }
            cb_type.Text = "----所有----";

            //成本中心
            DataTable getdt03 = reCnasRemotCall.RemotInterface.SelectData("HCS-costcenter-sec003", null);

            if (getdt03 != null)
            {
                this.cb_cost_center.Items.Add(new RadListDataItem()
                {
                    Text = "----所有----", Value = "0"
                });
                int ii = getdt03.Rows.Count;
                if (ii <= 0)
                {
                    return;
                }
                for (int i = 0; i < ii; i++)
                {
                    if (getdt03.Rows[i]["id"].ToString() != null && getdt03.Rows[i]["ca_name"].ToString().Trim() != null)
                    {
                        cb_cost_center.Items.Add(new RadListDataItem()
                        {
                            Text = getdt03.Rows[i]["ca_name"].ToString().Trim(), Value = getdt03.Rows[i]["id"].ToString()
                        });
                    }
                }
                cb_cost_center.Text = "----所有----";
            }

            //顾客
            DataTable getdt04 = reCnasRemotCall.RemotInterface.SelectData("HCS-customer-sec002", null);

            if (getdt04 != null)
            {
                this.cb_customer.Items.Add(new RadListDataItem()
                {
                    Text = "----所有----", Value = "0"
                });

                int ii = getdt04.Rows.Count;
                if (ii <= 0)
                {
                    return;
                }
                for (int i = 0; i < ii; i++)
                {
                    if (getdt04.Rows[i]["id"].ToString() != null && getdt04.Rows[i]["cu_name"].ToString().Trim() != null)
                    {
                        cb_customer.Items.Add(new RadListDataItem()
                        {
                            Text = getdt04.Rows[i]["cu_name"].ToString().Trim(), Value = getdt04.Rows[i]["id"].ToString()
                        });
                    }
                }
                cb_customer.SelectedIndex = 0;
            }
            // LoadData();
        }
        public HCSSM_procedure_relation(string str_inid, string str_inname, string str_incode, DataTable indtall)
        {
            InitializeComponent();
            //this.Font = new Font(this.Font.FontFamily, 11);
            this.Text = ConfigurationManager.AppSettings["SystemName"].ToString() + "--流程关系管理";
            str_prid  = str_inid;
            dtall     = indtall;
            this.Text = this.Text + "  ->" + str_incode + "--" + str_inname;

            DataRow[] arrayDRsec01 = dtall.Select("id=" + str_inid);
            if (arrayDRsec01[0]["pd_scan"] != null)
            {
                tb_02.Text = arrayDRsec01[0]["pd_scan"].ToString();
            }

            #region 获取已经配置好流程数据
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();
            sttemp01.Add(1, str_inid);
            dtselect = reCnasRemotCall.RemotInterface.SelectData("HCS-procedure_relation-sec001", sttemp01);
            if (dtall != null)
            {
                for (int i = 0; i < dtall.Rows.Count; i++)
                {
                    string str_id = "", str_code = "", str_name = "", str_priority = "0", str_condition = "";
                    if (dtall.Rows[i]["id"] != null)
                    {
                        str_id = dtall.Rows[i]["id"].ToString();
                    }
                    if (dtall.Rows[i]["pd_code"] != null)
                    {
                        str_code = dtall.Rows[i]["pd_code"].ToString();
                    }
                    if (dtall.Rows[i]["pd_name"] != null)
                    {
                        str_name = dtall.Rows[i]["pd_name"].ToString();
                    }
                    DataGridViewRow drtemp01 = new DataGridViewRow();
                    drtemp01.Cells.Add(new DataGridViewCheckBoxCell()); //选择
                    drtemp01.Cells.Add(new DataGridViewTextBoxCell());  //id
                    drtemp01.Cells.Add(new DataGridViewTextBoxCell());  //编码
                    drtemp01.Cells.Add(new DataGridViewTextBoxCell());  //名称

                    if (dtselect == null)
                    {
                        drtemp01.SetValues(false, str_id, str_code, str_name);
                        dgv_01.Rows.Add(drtemp01);
                        sl_01data.Add(str_id, str_name);
                    }
                    else
                    {
                        DataRow[] arrayDRsec = dtselect.Select("next_pid=" + str_id);
                        if (arrayDRsec.Length > 0)
                        {
                            if (arrayDRsec[0]["pr_priority"] != null)
                            {
                                str_priority = arrayDRsec[0]["pr_priority"].ToString();
                            }
                            if (arrayDRsec[0]["pr_condition"] != null)
                            {
                                str_condition = arrayDRsec[0]["pr_condition"].ToString();
                            }
                            drtemp01.Cells.Add(new DataGridViewTextBoxCell());
                            drtemp01.Cells.Add(new DataGridViewTextBoxCell());
                            drtemp01.SetValues(false, str_id, str_code, str_name, str_priority, str_condition);

                            //drtemp01.SetValues(false, str_id, str_code, str_name);
                            dgv_02.Rows.Add(drtemp01);
                            sl_02data.Add(str_id, str_name);
                        }
                        else
                        {
                            drtemp01.SetValues(false, str_id, str_code, str_name);
                            dgv_01.Rows.Add(drtemp01);
                            sl_01data.Add(str_id, str_name);
                        }
                    }
                }
            }
            #endregion
            load_pdpar();
        }
Exemplo n.º 24
0
        /// <summary>
        /// 加载DGV数据
        /// </summary>
        private void LoadData()
        {
            dgv_01.Rows.Clear();
            string strsecdata = tb_sname.Text.Trim();
            string str_usertp = this.cb_customer.Text;
            string str_cc_id  = this.cb_cost_center.Text;
            string str_type   = this.cb_type.Text;

            string selectSql = string.Format("( in_name like '%{0}%')", strsecdata);

            if (str_usertp != "----所有----")
            {
                selectSql += string.Format(" and cu_name='{0}'", str_usertp);
            }
            if (str_cc_id != "----所有----")
            {
                selectSql += string.Format(" and ca_name='{0}'", str_cc_id);
            }
            if (str_type != "----所有----")
            {
                selectSql += string.Format(" and value_code='{0}'", str_type);
            }
            if (rb_storage.Checked == true)
            {
                selectSql += string.Format(" and act_type='{0}'", 1);
            }
            else
            {
                selectSql += string.Format(" and act_type='{0}'", 2);
            }
            if (startTimePicker.Text != "" && endTimePicker.Text != "")
            {
                selectSql += string.Format(" and cre_date>='{0}' and cre_date<='{1}'", startTimePicker.Value, endTimePicker.Value);
            }
            SortedList sttemp01 = new SortedList();

            sttemp01.Add(1, selectSql);
            //selectSql += " order by id";
            //DataRow[] arrayDR = getdt.Select(selectSql).OrderBy(item => item["id"]).ToArray();
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            // string ggg = reCnasRemotCall.RemotInterface.CheckSelectData("HCS_instrument-in-out-log-sel001", sttemp01);
            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS_instrument-in-out-log-sel001", sttemp01);

            if (getdt == null)
            {
                return;
            }
            int ii = getdt.Rows.Count;

            if (ii <= 0)
            {
                return;
            }
            dgv_01.RowCount = ii;

            for (int i = 0; i < ii; i++)
            {
                if (!string.IsNullOrEmpty(getdt.Rows[i]["id"].ToString()))
                {
                    dgv_01.Rows[i].Cells["id"].Value = getdt.Rows[i]["id"].ToString();
                }
                if (!string.IsNullOrEmpty(getdt.Rows[i]["in_name"].ToString()))
                {
                    dgv_01.Rows[i].Cells["ca_name"].Value = getdt.Rows[i]["in_name"].ToString();
                }
                if (!string.IsNullOrEmpty(getdt.Rows[i]["cu_name"].ToString()))
                {
                    dgv_01.Rows[i].Cells["cu_name"].Value = getdt.Rows[i]["cu_name"].ToString();
                }
                if (!string.IsNullOrEmpty(getdt.Rows[i]["ca_name"].ToString()))
                {
                    dgv_01.Rows[i].Cells["cc_name"].Value = getdt.Rows[i]["ca_name"].ToString();
                }
                if (!string.IsNullOrEmpty(getdt.Rows[i]["value_code"].ToString()))
                {
                    dgv_01.Rows[i].Cells["value_code"].Value = getdt.Rows[i]["value_code"].ToString();
                }
                if (!string.IsNullOrEmpty(getdt.Rows[i]["act_type"].ToString()))
                {
                    dgv_01.Rows[i].Cells["act_type"].Value = (getdt.Rows[i]["act_type"].ToString() == "1") ? "入库" : "出库";
                }
                if (!string.IsNullOrEmpty(getdt.Rows[i]["act_count"].ToString()))
                {
                    dgv_01.Rows[i].Cells["act_count"].Value = getdt.Rows[i]["act_count"].ToString();
                }
                if (!string.IsNullOrEmpty(getdt.Rows[i]["cre_date"].ToString()))
                {
                    dgv_01.Rows[i].Cells["cre_date"].Value = getdt.Rows[i]["cre_date"].ToString();
                }
            }

            //foreach (DataRow dr in arrayDR)
            //{
            //    if (!string.IsNullOrEmpty(dr["id"].ToString())) dgv_01.Rows[i].Cells["id"].Value = dr["id"].ToString();
            //    if (!string.IsNullOrEmpty(dr["ca_name"].ToString())) dgv_01.Rows[i].Cells["ca_name"].Value = dr["ca_name"].ToString();
            //    if (!string.IsNullOrEmpty(dr["cu_name"].ToString())) dgv_01.Rows[i].Cells["cu_name"].Value = dr["cu_name"].ToString();
            //    if (!string.IsNullOrEmpty(dr["cc_name"].ToString())) dgv_01.Rows[i].Cells["cc_name"].Value = dr["cc_name"].ToString();
            //    if (!string.IsNullOrEmpty(dr["value_code"].ToString())) dgv_01.Rows[i].Cells["value_code"].Value = dr["value_code"].ToString();
            //    if (!string.IsNullOrEmpty(dr["act_type"].ToString())) dgv_01.Rows[i].Cells["act_type"].Value = (dr["act_type"].ToString() == "1") ? "入库" : "出库";
            //    if (!string.IsNullOrEmpty(dr["act_count"].ToString())) dgv_01.Rows[i].Cells["act_count"].Value = dr["act_count"].ToString();
            //    if (!string.IsNullOrEmpty(dr["cre_date"].ToString())) dgv_01.Rows[i].Cells["cre_date"].Value = dr["cre_date"].ToString();
            //    i++;
            //}
            if (dgv_01.Rows.Count > 0)
            {
                dgv_01.CurrentRow = dgv_01.Rows[0];
            }
        }
Exemplo n.º 25
0
        private void rBut_ok_Click(object sender, EventArgs e)
        {
            DataSet   set            = new DataSet();
            DataTable windowsXPTable = new DataTable("WindowsXP");
            DataTable windows7Table  = new DataTable("Windows7");

            set.Tables.Clear();
            windowsXPTable.Rows.Clear();
            windows7Table.Rows.Clear();
            radChartView1.Series.Clear();
            set.Tables.Add(windowsXPTable);
            set.Tables.Add(windows7Table);
            foreach (DataTable table in set.Tables)
            {
                table.Columns.Add("Month");
                table.Columns.Add("Usage", typeof(double));
            }

            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            int           yearInt         = int.Parse(cb_year.Text);

            SortedList bb = new SortedList();

            bb.Add("fisrtTime", new DateTime(yearInt - 1, 1, 1));
            DataSet result = reCnasRemotCall.RemotInterface.ExecuteProcedure("dispose_instrument", bb);

            if (result != null && result.Tables != null && result.Tables.Count > 0)
            {
                int       selectYearTotal = 0;
                int       beforeYearTotal = 0;
                double    Total           = 0;
                DataTable table           = result.Tables[0];
                for (int i = 0; i < 2; i++)
                {
                    int calYear = i == 0 ? yearInt : yearInt - 1;
                    for (int j = 1; j < 13; j++)
                    {
                        string  calMonth = calYear.ToString() + j.ToString().PadLeft(2, '0');
                        DataRow rowData  = null;
                        if (table.Rows != null)
                        {
                            foreach (DataRow row in table.Rows)
                            {
                                if (row["calmon"] != null && row["calmon"].ToString() == calMonth)
                                {
                                    rowData = row;
                                    break;
                                }
                            }
                        }


                        if (rowData == null)
                        {
                            if (i == 0)
                            {
                                windowsXPTable.Rows.Add(GetMonthLbl(j.ToString()), 0);
                            }
                            else
                            {
                                windows7Table.Rows.Add(GetMonthLbl(j.ToString()), 0);
                            }
                        }
                        if (rowData != null)
                        {
                            double calResult = rowData["total"] is DBNull ? 0 : Convert.ToDouble(rowData["total"]);
                            if (calYear.ToString() == cb_year.Text)
                            {
                                Total += calResult;
                            }
                            c1RG.Value = double.Parse(String.Format("{0:F}", Total / 12));
                            if (i == 0)
                            {
                                windowsXPTable.Rows.Add(GetMonthLbl(j.ToString()), calResult);
                                selectYearTotal += rowData["total"] is DBNull ? 0 : int.Parse(rowData["total"].ToString());
                            }
                            else
                            {
                                beforeYearTotal += rowData["total"] is DBNull ? 0 : int.Parse(rowData["total"].ToString());
                                windows7Table.Rows.Add(GetMonthLbl(j.ToString()), calResult);
                            }
                        }
                    }
                    RefreshDataGrid(table);
                }
                currentYearTxt.Text = selectYearTotal.ToString();
                lastyeartet.Text    = beforeYearTotal.ToString();
                radLabel3.Text      = beforeYearTotal == selectYearTotal ? "平稳" : (beforeYearTotal > selectYearTotal) ? "下降" : "上升";
            }
            this.radChartView1.DataSource = set;
            BarSeries windowsXPSeries = new BarSeries("Usage", "Month");

            windowsXPSeries.DataMember  = "WindowsXP";
            windowsXPSeries.LegendTitle = "Windows XP";
            BarSeries windows7Series = new BarSeries("Usage", "Month");

            windows7Series.DataMember  = "Windows7";
            windows7Series.LegendTitle = "Windows 7";
            windowsXPSeries.ShowLabels = true;
            windows7Series.ShowLabels  = true;
            this.radChartView1.Series.AddRange(windowsXPSeries, windows7Series);
        }
Exemplo n.º 26
0
        //删除
        private void but_remove_Click(object sender, EventArgs e)
        {
            if (this.dgv_01.SelectedRows.Count <= 0)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("choicechange", EnumPromptMessage.warning, new string[] { "删除", "灭菌器" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            try
            {
                CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                #region 判断灭菌器是否被灭菌流程占用
                DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-sterilizer-deviceprogram-sec003", null);//99
                if (getdt != null)
                {
                    int ii = getdt.Rows.Count;
                    if (ii <= 0)
                    {
                        return;
                    }
                    for (int i = 0; i < ii; i++)
                    {
                        if (getdt.Rows[i]["dev_id"].ToString() != null)
                        {
                            if (dgv_01.SelectedRows[0].Cells["id"].Value.ToString() == getdt.Rows[i]["dev_id"].ToString().Trim())
                            {
                                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("relation", EnumPromptMessage.warning, new string[] { "灭菌器", "灭菌流程", "灭菌流程" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                return;
                            }
                        }
                    }
                }
                #endregion
                if (MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("choicedelete", EnumPromptMessage.warning, new string[] { dgv_01.SelectedRows[0].Cells["ca_name"].Value.ToString(), "灭菌器" }), ConfigurationManager.AppSettings["SystemName"] + "--删除灭菌器", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
                int        selectedIndex = dgv_01.Rows.IndexOf(dgv_01.SelectedRows[0]);
                SortedList sltmp         = new SortedList();
                SortedList sltmp01       = new SortedList();
                sltmp01.Add(1, dgv_01.SelectedRows[0].Cells["id"].Value);
                sltmp.Add(1, sltmp01);

                // string sql = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-washing-device-del001", sltmp, null);
                int recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-sterilizer-device-del001", sltmp, null);


                if (recint > -1)
                {
                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("deletesuccessful", EnumPromptMessage.warning, new string[] { "灭菌器" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    dgv_01.Rows.RemoveAt(selectedIndex);//移除选择的dgv的数据
                    if (dgv_01.Rows.Count > 0)
                    {
                        if (selectedIndex == 0)//删除后判断是否为0
                        {
                            dgv_01.CurrentRow = dgv_01.Rows[0];
                        }
                        else
                        {
                            dgv_01.CurrentRow = dgv_01.Rows[selectedIndex - 1];
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("unknowerror", EnumPromptMessage.warning, new string[] { ex.Message }), "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }