예제 #1
0
        private void BindProLevel()
        {
            string[]  l_s      = new string[] { "Column_Name", "Column_Index", "Column_type", "Column_code" };
            string    category = "Basic_TestRule_PowerSet";
            DataTable dtCommon = BaseData.Get(l_s, category);

            DataTable dtLevel = dtCommon.Clone();

            dtLevel.TableName = "Level";
            DataRow[] drs = dtCommon.Select(string.Format("Column_type='{0}'", BASE_POWERSET.PRODUCTGRADE));
            foreach (DataRow dr in drs)
            {
                dtLevel.ImportRow(dr);
            }
            DataView dview = dtLevel.DefaultView;

            dview.Sort = "Column_Index asc";

            repositoryItemLookUpEdit1_PRODUCT_GRADE.DisplayMember = "Column_Name";
            repositoryItemLookUpEdit1_PRODUCT_GRADE.ValueMember   = "Column_code";
            repositoryItemLookUpEdit1_PRODUCT_GRADE.DataSource    = dview.Table;

            repositoryItemLookUpEdit_TESTRULE_NAME.DisplayMember = BASE_TESTRULE.FIELDS_TESTRULE_NAME;
            repositoryItemLookUpEdit_TESTRULE_NAME.ValueMember   = BASE_TESTRULE.FIELDS_TESTRULE_CODE;
            repositoryItemLookUpEdit_TESTRULE_NAME.DataSource    = new BaseTestRuleEntity().GetTestRuleMainData(new Hashtable()).Tables[BASE_TESTRULE.DATABASE_TABLE_NAME];
        }
예제 #2
0
        /// <summary>
        /// 绑定批次类型。
        /// </summary>
        private void BindLotType()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", BASEDATA_CATEGORY_NAME.Lot_Type);

            _dtLotType = BaseData.Get(columns, category);
        }
예제 #3
0
        //给下拉框赋值,数据可在主数据维护表Basic_UploadPicture中修改
        public void AssignmentForLookUpEdit()
        {
            string[] l_s      = new string[] { "DisplayValue", "Value", "Categoryflag" };
            string   category = "Basic_UploadPicture";

            System.Data.DataTable dt_PVLine         = BaseData.Get(l_s, category);
            DataRow[]             drDestRootPath    = dt_PVLine.Select(string.Format("Categoryflag='{0}'", "DestRootPath"));
            DataRow[]             drFileExistention = dt_PVLine.Select(string.Format("Categoryflag='{0}'", "FileExistention"));
            if (drDestRootPath.Length > 0 && drDestRootPath != null)
            {
                DataTable dt = drDestRootPath[0].Table.Clone();
                foreach (DataRow dr in drDestRootPath)
                {
                    dt.ImportRow(dr);
                }
                luDestRootPath.Properties.DataSource    = dt;
                luDestRootPath.Properties.DisplayMember = "DisplayValue";
                luDestRootPath.Properties.ValueMember   = "Value";
                luDestRootPath.Properties.NullText      = "";
            }
            if (drFileExistention.Length > 0 && drFileExistention != null)
            {
                DataTable dt = drFileExistention[0].Table.Clone();
                foreach (DataRow dr in drFileExistention)
                {
                    dt.ImportRow(dr);
                }

                luFileExistention.Properties.DataSource    = dt;
                luFileExistention.Properties.DisplayMember = "DisplayValue";
                luFileExistention.Properties.ValueMember   = "Value";
                luFileExistention.Properties.NullText      = "";
            }
        }
예제 #4
0
        //画面加载的时候需要初始化的
        private void WorkOrderMaterialReturnCtrl_Load(object sender, EventArgs e)
        {
            OnAfterStateChanged(ControlState.Empty);

            //1、获取系统中设置的班次值,绑定班别数据到控件。
            //1-1、从CRM_ATTRIBUTE a,BASE_ATTRIBUTE b,BASE_ATTRIBUTE_CATEGORY c数据表中查询c.CATEGORY_NAME=Basic_Shift的数据。显示a.NAME=CODE对应的属性值。
            string[] columns = new string[] { "CODE" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Basic_Shift");

            this.lueShiftName.Properties.DataSource    = BaseData.Get(columns, category);
            this.lueShiftName.Properties.DisplayMember = "CODE";
            lueShiftName.Properties.ValueMember        = "CODE";

            //1-2、根据当前时间从cal_schedule_day获取当前班次值设为其默认值,不能修改。
            BindingCurrentShift();

            //2、根据登录用户自动填充员工号,不能修改。
            this.txtOperator.Text    = PropertyService.Get(PROPERTY_FIELDS.USER_NAME);
            this.txtOperator.Enabled = false;

            //3、退料日期默认值设置为当前日期。
            deReturnMatDate.DateTime = DateTime.Now;

            txtMaterialLot.Enabled     = false; //没有点新增,不能刷Lot
            txtReturnMatReason.Enabled = false;
        }
예제 #5
0
        private DataTable GetRules()
        {
            string[] columns = new string[] { "MINPOWER", "GRADES", "ITEMNO", "STORAGE", "MAXPOWER", "MODULE" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Basic_ProductInbound_Rules");
            DataTable dtPro = BaseData.Get(columns, category);

            return(dtPro);
        }
예제 #6
0
        /// <summary>
        /// 绑定出货类型。
        /// </summary>
        private void BindShipmentType()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", BASEDATA_CATEGORY_NAME.Basic_ShipmentType);

            this.lueShipmentType.Properties.DataSource    = BaseData.Get(columns, category);
            this.lueShipmentType.Properties.DisplayMember = "NAME";
            this.lueShipmentType.Properties.ValueMember   = "CODE";
        }
예제 #7
0
        /// <summary>
        /// 窗体载入事件。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EDCPointCtl_Load(object sender, EventArgs e)
        {
            DataTable dt = BaseData.Get(new string[] { "CODE", "NAME", "DESCRIPTION" },
                                        new KeyValuePair <string, string>("CATEGORY_NAME", "EDC_PARAM_TYPE"));

            lueParamType.DataSource    = dt;
            lueParamType.TextEditStyle = TextEditStyles.DisableTextEditor;
            lueParamType.ValueMember   = "CODE";
            lueParamType.DisplayMember = "NAME";
        }
예제 #8
0
        /// <summary>
        /// 绑定批次创建类别。
        /// </summary>
        private void BindLotCreateType()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Lot_CreateType");

            this.lueCreateType.Properties.DataSource    = BaseData.Get(columns, category);
            this.lueCreateType.Properties.DisplayMember = "NAME";
            this.lueCreateType.Properties.ValueMember   = "CODE";
            this.lueCreateType.ItemIndex = 0;
        }
예제 #9
0
        /// <summary>
        /// 对下拉列表“关联设备”进行数据绑定
        /// </summary>
        public void BindDeviceType()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Device_Type");

            lueDevice.Properties.DataSource    = BaseData.Get(columns, category);
            lueDevice.Properties.DisplayMember = "NAME";
            lueDevice.Properties.ValueMember   = "CODE";
            lueDevice.ItemIndex = 0;
        }
예제 #10
0
        /// <summary>
        /// 绑定组件类型
        /// </summary>
        public void BindSupplierCode()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", BASEDATA_CATEGORY_NAME.PART_TYPE);

            this.txtMoudleType.Properties.DataSource    = BaseData.Get(columns, category);
            this.txtMoudleType.Properties.DisplayMember = "NAME";
            this.txtMoudleType.Properties.ValueMember   = "CODE";
            this.txtMoudleType.ItemIndex = 0;
        }
예제 #11
0
        /// <summary>
        /// 对下拉列表“计算类型”进行数据绑定
        /// </summary>
        public void BindCalculateType()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Calculate_Rule");

            this.lpCalcType.Properties.DataSource    = BaseData.Get(columns, category);
            this.lpCalcType.Properties.DisplayMember = "NAME";
            this.lpCalcType.Properties.ValueMember   = "CODE";
            this.lpCalcType.ItemIndex = 0;
        }
예제 #12
0
        //窗体载入(Load)事件方法
        private void WorkOrderMatRetListQueryDialogCtrl_Load(object sender, EventArgs e)
        {
            //1、根据登录用户将登录用户拥有权限的工序名称绑定到窗体控件中,设置空为控件默认值。
            string StrOperation = PropertyService.Get(PROPERTY_FIELDS.OPERATIONS);

            cmbBEOperation.Properties.Items.Add("");
            if (StrOperation.Length > 0)
            {
                string[] StrArrOperation = StrOperation.Split(',');
                for (int i = 0; i < StrArrOperation.Length; i++)
                {
                    cmbBEOperation.Properties.Items.Add(StrArrOperation[i]);
                }
            }

            //"2、根据登录用户将登录用户拥有权限的线边仓名称绑定到窗体控件中,设置空为控件默认值。
            string strStore = PropertyService.Get(PROPERTY_FIELDS.STORES);

            cmbBEStore.Properties.Items.Add("");
            if (strStore.Length > 0)
            {
                string[] strArrStore = strStore.Split(',');
                for (int i = 0; i < strArrStore.Length; i++)
                {
                    cmbBEStore.Properties.Items.Add(strArrStore[i]);
                }
            }
            //3、根据PropertyService获取PROPERTY_FIELDS.STORES的值。从WST_STORES,FMM_LOCATION,FMM_LOCATION_RET根据线边仓名称获取用户拥有权限的工厂车间名称集合绑定到窗体控件中,设置空为控件默认值。
            DataTable dtStore = FactoryUtils.GetFactoryRoomByStores(PropertyService.Get(PROPERTY_FIELDS.STORES));

            cmbBERoom.Properties.Items.Add("");
            for (int i = 0; i < dtStore.Rows.Count; i++)
            {
                cmbBERoom.Properties.Items.Add(dtStore.Rows[i]["LOCATION_NAME"]);
            }

            //没有不需要了
            //"4、根据工序名称和工厂车间获取设备名称数据绑定到窗体控件中,设置空为控件默认值。
            //从FMM_LOCATION c , EMS_EQUIPMENTS d ,EMS_OPERATION_EQUIPMENT e , POR_ROUTE_OPERATION_VER f表中获取。"

            //5、绑定班别数据到控件,设置空为控件默认值。从CRM_ATTRIBUTE a,BASE_ATTRIBUTE b,BASE_ATTRIBUTE_CATEGORY c数据表中查询c.CATEGORY_NAME=Basic_Shift的数据。显示a.NAME=CODE对应的属性值。
            string[] columns = new string[] { "CODE" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Basic_Shift");
            DataTable dtShift = BaseData.Get(columns, category);

            cmbBEShift.Properties.Items.Add("");
            for (int i = 0; i < dtShift.Rows.Count; i++)
            {
                cmbBEShift.Properties.Items.Add(dtShift.Rows[i]["CODE"]);
            }

            //6、退料日期默认为当月月初到当前日期
            dateEStart.DateTime = DateTime.Now.AddDays(-DateTime.Now.Day + 1);
            dateEEnd.DateTime   = DateTime.Now;
        }
예제 #13
0
        /// <summary>
        /// 绑定优先级。
        /// </summary>
        private void BindPriority()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Lot_Priority");
            DataTable dtReturn = BaseData.Get(columns, category);

            dtReturn.Rows.InsertAt(dtReturn.NewRow(), 0);
            this.luePriority.Properties.DataSource    = dtReturn;
            this.luePriority.Properties.DisplayMember = "NAME";
            this.luePriority.Properties.ValueMember   = "CODE";
        }
예제 #14
0
        /// <summary>
        /// 绑定班次
        /// </summary>
        public void BindShiftName()
        {
            string[] columns = new string[] { "CODE" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Basic_Shift");

            this.lpShift.Properties.DataSource    = BaseData.Get(columns, category);
            this.lpShift.Properties.DisplayMember = "CODE";
            this.lpShift.Properties.ValueMember   = "CODE";
            Shift shift = new Shift();

            this.lpShift.EditValue = shift.GetCurrShiftName();
        }
예제 #15
0
        /// <summary>
        /// 绑定批次不良和报废信息。
        /// </summary>
        private void BindScrapAndDefectInfo()
        {
            string [] columns = new string[] { "CODE", "NAME" };
            this._dtReasonCodeClass = BaseData.Get(columns, BASEDATA_CATEGORY_NAME.Basic_ClassOfRCode);

            string  lotKey = Convert.ToString(this.teLotNumber.Tag);
            DataSet dsScrapAndDefectQtyTable = this._queryEntity.GetScrapAndDefectQty(lotKey);

            gcScrapAndDefectQty.MainView   = gvScrapAndDefectQty;
            gcScrapAndDefectQty.DataSource = dsScrapAndDefectQtyTable.Tables[0];
            gvScrapAndDefectQty.BestFitColumns();
        }
예제 #16
0
        /// <summary>
        /// 绑定成品类型数据。
        /// </summary>
        private void BindPartType()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "PART_TYPE");
            DataTable lotTypeTable = BaseData.Get(columns, category);

            lotTypeTable.Rows.InsertAt(lotTypeTable.NewRow(), 0);
            this.luePartType.Properties.DataSource    = lotTypeTable;
            this.luePartType.Properties.DisplayMember = "NAME";
            this.luePartType.Properties.ValueMember   = "CODE";
            this.luePartType.ItemIndex = 0;
        }
예제 #17
0
        /// <summary>
        /// 绑定批次类型。
        /// </summary>
        private void BindLotType()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Lot_Type");
            DataTable dtLotType = BaseData.Get(columns, category);
            DataRow   dr        = dtLotType.NewRow();

            dr["CODE"] = string.Empty;
            dr["NAME"] = "全部";
            dtLotType.Rows.InsertAt(dr, 0);
            this.lueLotType.Properties.DataSource    = dtLotType;
            this.lueLotType.Properties.DisplayMember = "NAME";
            this.lueLotType.Properties.ValueMember   = "CODE";
        }
예제 #18
0
        /// <summary>
        /// 绑定原因代码分类数据到下拉列表数据
        /// </summary>
        public void BindReasonCodeClass()
        {
            string[]  columns  = new string[] { "CODE", "NAME" };
            DataTable dtReturn = BaseData.Get(columns, BASEDATA_CATEGORY_NAME.Basic_ClassOfRCode);

            if (dtReturn != null)
            {
                dtReturn.DefaultView.Sort = "CODE ASC";
                dtReturn.Rows.InsertAt(dtReturn.NewRow(), 0);
                this.lueReasonCodeClass.Properties.DataSource    = dtReturn;
                this.lueReasonCodeClass.Properties.ValueMember   = "CODE";
                this.lueReasonCodeClass.Properties.DisplayMember = "NAME";
            }
        }
예제 #19
0
        private void WorkOrderPSettingFormPower_Load(object sender, EventArgs e)
        {
            string[]  l_s              = new string[] { "RULE_CODE", "BEFORE_POWER", "AFTER_POWER" };
            string    category         = "Basic_WorkOrderProductSetting";
            DataTable dtWorkOrderPower = BaseData.Get(l_s, category);

            dtWorkOrderPower.TableName = "PowerShow";
            _dtPowerShowData           = dtWorkOrderPower;
            DataView dview = dtWorkOrderPower.DefaultView;

            dview.Sort = "BEFORE_POWER asc";

            gcPowerShow.DataSource = dtWorkOrderPower;
        }
예제 #20
0
        /// <summary>
        /// 绑定出货类型。
        /// </summary>
        private void BindShipmentType()
        {
            string[] columns = new string[] { "CODE", "NAME" };//定义一个数组
            //结构体,定义可设置或检索的键/值对
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", BASEDATA_CATEGORY_NAME.Basic_ShipmentType);
            DataTable dt = BaseData.Get(columns, category);
            DataRow   dr = dt.NewRow();

            dr["NAME"] = "";
            dr["CODE"] = "4";
            dt.Rows.InsertAt(dr, 0);
            this.lueShipmentType.Properties.DataSource    = dt;
            this.lueShipmentType.Properties.DisplayMember = "NAME";
            this.lueShipmentType.Properties.ValueMember   = "CODE";
        }
예제 #21
0
        /// <summary>
        /// 绑定组件类型
        /// </summary>
        public void BindSupplierCode()
        {
            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", BASEDATA_CATEGORY_NAME.PART_TYPE);

            DataTable dt = BaseData.Get(columns, category);
            DataRow   dr = dt.NewRow();

            dr["NAME"] = string.Empty;
            dt.Rows.Add(dr);

            this.txttype.Properties.DataSource    = dt;
            this.txttype.Properties.DisplayMember = "NAME";
            this.txttype.Properties.ValueMember   = "CODE";
            this.txttype.ItemIndex = 0;
        }
예제 #22
0
        /// <summary>
        /// 绑定原因代码分类信息。
        /// </summary>
        private void BindReasonCodeClass()
        {
            string[]  columns  = new string[] { "CODE", "NAME" };
            DataTable dtReturn = BaseData.Get(columns, BASEDATA_CATEGORY_NAME.Basic_ClassOfRCode);

            if (dtReturn != null)
            {
                dtReturn.DefaultView.RowFilter = string.Format("CODE IN ({0})", BASEDATA_CATEGORY_NAME.Basic_ClassOfRCodeValue_Cell);
                dtReturn.DefaultView.Sort      = "CODE ASC";
                this.rilueReasonCodeClass.Columns.Clear();
                this.rilueReasonCodeClass.Columns.Add(new LookUpColumnInfo("NAME", string.Empty));
                this.rilueReasonCodeClass.DataSource    = dtReturn;
                this.rilueReasonCodeClass.ValueMember   = "CODE";
                this.rilueReasonCodeClass.DisplayMember = "NAME";
            }
        }
예제 #23
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            SpcEntity spcEntity = new SpcEntity();

            spcEntity.ParamName = this.txtParamName.Text.Trim();
            DataSet dsParams = spcEntity.SearchParams();

            if (spcEntity.ErrorMsg.Length > 0)
            {
                MessageService.ShowError("查询参数出错!错误信息:" + spcEntity.ErrorMsg);
            }
            else
            {
                if (dsParams != null && dsParams.Tables.Count > 0 && dsParams.Tables.Contains(BASE_PARAMETER_FIELDS.DATABASE_TABLE_NAME))
                {
                    try
                    {
                        DataTable paramTable = dsParams.Tables[BASE_PARAMETER_FIELDS.DATABASE_TABLE_NAME];
                        //paramTable.Rows.Add("EFF","EFF","");
                        //paramTable.Rows.Add("UOC", "UOC","");
                        //paramTable.Rows.Add("ISC", "ISC","");
                        //paramTable.Rows.Add("FF", "FF","");
                        //paramTable.Rows.Add("IREV1", "IREV1","");
                        //paramTable.Rows.Add("IREV2", "IREV2","");
                        //paramTable.Rows.Add("RSH", "RSH","");
                        //paramTable.Rows.Add("RSER", "RSER","");
                        string[] columns = new string[] { "PARAMETER_NAME" };
                        KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "SPC_PARAMETER");
                        DataTable baseParamTable = BaseData.Get(columns, category);
                        if (baseParamTable != null)
                        {
                            foreach (DataRow row in baseParamTable.Rows)
                            {
                                paramTable.Rows.Add(row["PARAMETER_NAME"].ToString(), row["PARAMETER_NAME"].ToString(), "");
                            }
                        }
                        grdCtrlParam.MainView   = gridViewParam;
                        grdCtrlParam.DataSource = paramTable;
                    }
                    catch (Exception ex)
                    {
                        MessageService.ShowError(ex.Message);
                    }
                }
            }
        }
예제 #24
0
        /// <summary>
        /// 更新语言信息。
        /// </summary>
        private void UpdateLanguageInfo()
        {
            string[] columns = new string[] { "LANGUAGE_NAME", "LANGUAGE_SIGN" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Language");
            DataTable languageTable = BaseData.Get(columns, category);

            if (languageTable.Rows.Count > 0)
            {
                Dictionary <string, string> dicLanguage = new Dictionary <string, string>();
                //把语言信息更新到XML文件
                for (int i = 0; i < languageTable.Rows.Count; i++)
                {
                    dicLanguage.Add(languageTable.Rows[i]["language_name"].ToString(), languageTable.Rows[i]["language_sign"].ToString());
                }
                CallRemotingService.UpdateConfigureLanguageXml(dicLanguage);
            }
        }
예제 #25
0
        public void bindData()
        {
            string[]  l_s      = new string[] { "TEMPLATE", "TEMPLATE_DESC" };
            string    category = "Name_Templates";
            DataTable dt       = BaseData.Get(l_s, category);


            luNamePlateTemplate.Properties.DataSource    = dt;
            luNamePlateTemplate.Properties.ValueMember   = "TEMPLATE_DESC";
            luNamePlateTemplate.Properties.DisplayMember = "TEMPLATE";



            dsInfo = entity.GetInfoForTemplate();

            gcNamePlateTemplate.DataSource = dsInfo.Tables[0];
        }
예제 #26
0
        /// <summary>
        /// 窗口登录 获取工厂数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WarehouseWarrantCtrl_Load(object sender, EventArgs e)
        {
            try
            {
                string[] columns = new string[] { "Werks", "Desc" };
                KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Basic_Werks");
                this.cbeWerks.Properties.DataSource    = BaseData.Get(columns, category);
                this.cbeWerks.Properties.DisplayMember = "Desc";
                this.cbeWerks.Properties.ValueMember   = "Werks";

                gcItems.DataSource = dtEntryItems;
                cbeOrderType_SelectedIndexChanged(sender, e);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误");
            }
        }
예제 #27
0
        /// <summary>
        /// 绑定类型数据到下拉列表数据
        /// </summary>
        public void BindReasonCodeType()
        {
            string[]  columns = new string[] { "CODE", "NAME" };
            DataTable dtType  = BaseData.Get(columns, BASEDATA_CATEGORY_NAME.Basic_TypeOfRCode);

            if (dtType != null)
            {
                this.lueType.Properties.DataSource    = dtType;
                this.lueType.Properties.DisplayMember = "NAME";
                this.lueType.Properties.ValueMember   = "CODE";

                DataTable dt = dtType.Copy();
                dt.Rows.InsertAt(dt.NewRow(), 0);
                this.lueQueryType.Properties.DataSource    = dt;
                this.lueQueryType.Properties.DisplayMember = "NAME";
                this.lueQueryType.Properties.ValueMember   = "CODE";
            }
        }
예제 #28
0
        private void BindUnit()
        {
            ///获取单位

            string[] columns = new string[] { "GROUP", "UNIT" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Basic_Unit");
            DataTable dtUnit = BaseData.Get(columns, category);

            txtUseUnit.Properties.DataSource         = dtUnit;
            this.txtUseUnit.Properties.DisplayMember = "UNIT";
            this.txtUseUnit.Properties.ValueMember   = "UNIT";
            this.txtUseUnit.ItemIndex = 0;

            txtUseConrtastUnit.Properties.DataSource         = dtUnit;
            this.txtUseConrtastUnit.Properties.DisplayMember = "UNIT";
            this.txtUseConrtastUnit.Properties.ValueMember   = "UNIT";
            this.txtUseConrtastUnit.ItemIndex = 0;
        }
예제 #29
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            teLGORT.Text = teLGORT.Text.Trim();
            teDESC.Text  = teDESC.Text.Trim();
            string LGORT = teLGORT.Text;
            string DESC  = teDESC.Text;

            string[] columns = new string[] { "LGORT", "DESC", "WERKS" };

            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Basic_LGORT");
            DataTable dt = BaseData.Get(columns, category);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr = dt.Rows[i];
                if (!String.IsNullOrEmpty(werks))
                {
                    string cWERKS = dr["WERKS"].ToString();
                    if (cWERKS.IndexOf(werks) == -1)
                    {
                        dt.Rows.RemoveAt(i--);
                        continue;
                    }
                }
                if (!String.IsNullOrEmpty(LGORT))
                {
                    string cLGORT = dr["LGORT"].ToString();
                    if (cLGORT.IndexOf(LGORT) == -1)
                    {
                        dt.Rows.RemoveAt(i--);
                        continue;
                    }
                }
                if (!String.IsNullOrEmpty(DESC))
                {
                    string cDesc = dr["DESC"].ToString();
                    if (cDesc.IndexOf(DESC) == -1)
                    {
                        dt.Rows.RemoveAt(i--);
                    }
                }
            }
            this.gridControl1.DataSource = dt;
        }
예제 #30
0
        /// <summary>
        /// 更新服务器列表。
        /// </summary>
        private void UpdateServerSitList()
        {
            //连接服务器列表进行更新
            string[] columns = new string[] { "SITE_NAME", "SITE_VALUE", "TIME_CONTROL", "FACTORY_CODE", "CHECK_OPERATOR" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Site");
            DataTable siteTable = BaseData.Get(columns, category);

            if (siteTable.Rows.Count > 0)
            {
                DataRow[] dataRow = siteTable.Select("SITE_NAME='" + site + "'");//查询自定义表siteTable的数据“select * from siteTable where site_name="+site+"”
                if (dataRow.Length > 0)
                {
                    string bIsTimeControl = "0";
                    if (!string.IsNullOrEmpty(dataRow[0]["TIME_CONTROL"].ToString()))
                    {
                        bIsTimeControl = dataRow[0]["TIME_CONTROL"].ToString();
                    }
                    PropertyService.Set(PROPERTY_FIELDS.TimeControl, bIsTimeControl);

                    string factoryCode = string.Empty;
                    if (!string.IsNullOrEmpty(dataRow[0]["FACTORY_CODE"].ToString()))
                    {
                        factoryCode = dataRow[0]["FACTORY_CODE"].ToString();
                    }
                    PropertyService.Set(PROPERTY_FIELDS.FACTORY_CODE, factoryCode.Trim());
                }

                Dictionary <string, string[]> dicSite = new Dictionary <string, string[]>();
                for (int i = 0; i < siteTable.Rows.Count; i++)
                {
                    string   siteName    = siteTable.Rows[i]["site_name"].ToString();
                    string   siteValue   = siteTable.Rows[i]["site_value"].ToString();
                    string   factoryCode = siteTable.Rows[i]["FACTORY_CODE"].ToString();
                    string[] value       = { siteValue, factoryCode };
                    dicSite.Add(siteName, value);
                }
//#if DEBUG
//                dicSite.Add("LocalHost", new string[] { "LocalHost", string.Empty });
//#endif
                CallRemotingService.UpdateConfigureSiteXml(dicSite);
            }
        }