/// <summary> /// 그리드의 컬럼에 enmu값으로 콤보박스로 바인딩한다. /// </summary> /// <param name="gv"></param> /// <param name="col"></param> /// <param name="em">열거형을 new로 생성 하여 입력</param> public static void GridView_Column_SetEnumAsComboBox(GridView gv, GridColumn col, Enum em) { RepositoryItemComboBox item = new RepositoryItemComboBox(); string[] items = Fnc.EnumItems2Strings(em); GridView_Column_SetStringsAsComboBox(gv, col, items); }
private void popTorqueImage_Load(object sender, EventArgs e) { pnlImage.BackgroundImageLayout = ImageLayout.Zoom; inpPicSizeMode.ComboBoxItems.AddRange(Fnc.EnumItems2Strings(new ImageLayout())); inpPicSizeMode.Value = pnlImage.BackgroundImageLayout.ToString(); Image_Load(); }
/// <summary> /// 항목삭제.. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdDelete_Click(object sender, EventArgs e) { DataRow dr = gvSettingList.GetFocusedDataRow(); if (dr == null) { return; } if (Function.clsFunction.ShowMsg(this, "항목 삭제", "선택된 항목을 삭제 하시겠습니까?", frmMessage.enMessageType.YesNo) != DialogResult.Yes) { return; } string strUpdateType = Fnc.obj2String(dr["UpdateType"]); DataTable dt; //세부 설정 테이블 update foreach (string i in Fnc.EnumItems2Strings(new enSeverType())) { dt = dsSetting.Tables[i]; foreach (DataRow r in dt.Select(string.Format("UPDATETYPE = '{0}'", strUpdateType))) { dt.Rows.Remove(r); } dt.AcceptChanges(); } foreach (DataRow r in dsSetting.Tables["Setting"].Select(string.Format("UPDATETYPE = '{0}'", strUpdateType))) { dsSetting.Tables["Setting"].Rows.Remove(r); } dsSetting.AcceptChanges(); DataSet_Save(); }
private void QLight_Test_Load(object sender, EventArgs e) { //알람 환결 설정 프로그래 if (System.IO.File.Exists(setting_pgm)) { //있음 btnSettingPgm.Enabled = true; btnSettingPgm.Image = Function.resIcon16.status_on; } else { //없음 btnSettingPgm.Enabled = false; btnSettingPgm.Image = Function.resIcon16.status_off; } lblCStatus = new Label[] { label5, label6, label7, label8, label9, label10 }; thBlink = new System.Threading.Timer(new TimerCallback(lblBlink), null, 1000, 800); inpAlarm.ComboBoxItems.AddRange(Fnc.EnumItems2Strings(new enSoundKind())); inpAlarm.ComboBoxSelectIndex = 0; if (_ql == null) { _ql = new QL("210.100.103.85", 20000); } inpIpAddress.Value = _ql.IpAddress; inpPort.Value = _ql.Port.ToString(); _ql.OnQL_StatusChanged += _ql_OnQL_StatusChanged; _ql_OnQL_StatusChanged(_ql, _ql.QL_Status); _ql.OnQL_DataChanged += _ql_OnQL_DataChanged; _ql_OnQL_DataChanged(_ql, _ql.Data_lastStatus); }
private void frmSetting_Load(object sender, EventArgs e) { try { Function.Component.DevExp.fnc.GridView_ViewInit(gvSettingList, false, true); //Function.Component.DevExp.fnc.GridView_EditInit(gvSettingList); //type 콤보 박스 foreach (string i in Fnc.EnumItems2Strings(new enSeverType())) { cmbType.ComboBoxItems.Add(i); } dsSetting = frmUploader.dsSetting; //Group 콤보 박스 cmbGroup.ComboBoxValueMember = "GroupCode"; cmbGroup.ComboBoxDisplayMember = "GroupName"; cmbGroup.ComboBoxDataSource = dsSetting.Tables[fnc.GroupTable_Name].DefaultView; dsSetting.Tables[fnc.GroupTable_Name].DefaultView.Sort = "GroupCode"; DataTable dt = dsSetting.Tables["Setting"]; //201512 추가 컬럼 확인 string[] Add_Cols = new string[] { "UseZip", "GroupCode", "GroupName", "Priority" }; Type[] Add_Types = new Type[] { typeof(System.Boolean), typeof(System.Int32), typeof(System.String), typeof(System.Int32) }; object[] dValue = new object[] { false, string.Empty, string.Empty, 0 }; if (Fnc.DataTable_ColumnsAdd(dt, Add_Cols, Add_Types, dValue)) { dt.AcceptChanges(); DataSet_Save(); } int cnt = 0; //그룹을 강제 입력 foreach (DataRow r in dt.Rows) { cnt += row_chk(r) ? 1: 0; } if (cnt > 0) { dt.AcceptChanges(); DataSet_Save(); } dt.Columns["GroupCode"].AllowDBNull = false; gcSettingList.DataSource = dt.DefaultView; dt.DefaultView.Sort = "GroupCode, Priority"; DataView dv = dt.DefaultView; //input box binding cmbType.DataBindings.Add(new Binding("SelectedItem", dv, "Type")); txtUpdateType.DataBindings.Add(new Binding("Text", dv, "UPDATETYPE")); txtBigo.DataBindings.Add(new Binding("Text", dv, "BIGO")); chkUseZip.DataBindings.Add(new Binding("Checked", dv, "UseZip")); //Group, Priority 추가 cmbGroup.DataBindings.Add(new Binding("SelectedValue", dv, "GroupCode")); txtPriority.DataBindings.Add(new Binding("Text", dv, "Priority")); dt = dsSetting.Tables["ORACLE"]; dv = dt.DefaultView; txtOraTNS.DataBindings.Add(new Binding("Text", dv, "TNS")); txtOraID.DataBindings.Add(new Binding("Text", dv, "ID")); txtOraPass.DataBindings.Add(new Binding("Text", dv, "PASS")); dv = dsSetting.Tables["SQL"].DefaultView; txtSqlIP.DataBindings.Add(new Binding("Text", dv, "IP")); txtSqlDB.DataBindings.Add(new Binding("Text", dv, "DataBase")); txtSqlID.DataBindings.Add(new Binding("Text", dv, "ID")); txtSqlPass.DataBindings.Add(new Binding("Text", dv, "PASS")); dv = dsSetting.Tables["WEB"].DefaultView; txtWEBUrl.DataBindings.Add(new Binding("Text", dv, "URL")); txtWEBPass.DataBindings.Add(new Binding("Text", dv, "PASS")); cmdAdd.Image = (Image)Function.resIcon16.add; cmdDelete.Image = (Image)Function.resIcon16.delete; InputBox_Collapes(); } catch (Exception ex) { ProcException(ex, "frmSetting_Load"); } }
private void btnSave_Click(object sender, EventArgs e) { //신규의 경우 UPDATETYPE 중복 체크 if (isNewRow && dsSetting.Tables["Setting"].Select(string.Format("UPDATETYPE = '{0}'", txtUpdateType.Text)).Length > 0) { Function.clsFunction.ShowMsg(this, "중복 UpdateType", "UpdateType이 중복 되었습니다.", frmMessage.enMessageType.OK); return; } DataRow dr = gvSettingList.GetFocusedDataRow(); string groupCode = Fnc.obj2String(cmbGroup.ComboBoxSelectedValue); DataRow[] rows = dsSetting.Tables[fnc.GroupTable_Name].Select(string.Format("GroupCode = {0}", groupCode)); if (rows.Length < 1) { Function.clsFunction.ShowMsg(this, "Group선택", "Group을 선택하여 주십시요.", frmMessage.enMessageType.OK); return; } string groupName = Fnc.obj2String(rows[0]["GroupName"]); if (txtPriority.Text.Equals(string.Empty)) { txtPriority.Text = "9999"; } dr["GroupName"] = groupName; dr["Type"] = cmbType.Text; dr["생성일"] = DateTime.Now; dsSetting.Tables["Setting"].AcceptChanges(); if (isNewRow) { isNewRow = false; } else { DataTable dt; string oldUType = Fnc.obj2String(_currDr["UpdateType"]); string newUtype = Fnc.obj2String(dr["UpdateType"]); bool isUpdateTypeCh = !oldUType.Equals(string.Empty) & !oldUType.Equals(newUtype); //세부 설정 테이블 update foreach (string i in Fnc.EnumItems2Strings(new enSeverType())) { dt = dsSetting.Tables[i]; //updatetype이 변경 되면 세부 테이브로 변경 하여 준다. if (isUpdateTypeCh) { foreach (DataRow r in dt.Select(string.Format("UPDATETYPE = '{0}'", oldUType))) { r["UpdateType"] = newUtype; } } dt.AcceptChanges(); } } DataSet_Save(); //gvSettingList_FocusedRowChanged(null, null); Application.DoEvents(); string sType = Fnc.obj2String(dr["UpdateType"]); Function.Component.DevExp.fnc.GridView_SelectRowBySearch(gvSettingList, "UpdateType", sType, 0); }
public frmMain() { InitializeComponent(); vari.Init(); SavePosition_Setting = vari.Pgm_Setting; btnSetting.Image = Function.resIcon16.save; btnSearch.Image = Function.resIcon16.search_file; btnCondition_reset.Image = Function.resIcon16.redo; btnPicPopUp.Image = Function.resIcon16.module; btnExcelSave.Image = Function.resIcon16.Excel; vari.ImgList.Images.Add(Function.resIcon16.server); vari.ImgList.Images.Add(Function.resIcon16.search_web); vari.ImgList.Images.Add(Function.resIcon16.module); tabControl1.ImageList = vari.ImgList; tabMonitoring.ImageIndex = 0; tabSearching.ImageIndex = 1; tabImage.ImageIndex = 2; clsLog = new Function.Util.Log(vari.Pgm_Path + "\\log", "log", 365 * 3, true); ifLog = new Function.Util.Log(vari.Pgm_Path + "\\log_if", "log_if", 90, true); //plc auth AppAuth.Auth.Add("cQjVhgrEPBEfab5nTuCa5mcmhvAK5kp1bzUkY5jfYJ0="); #if (!Test) btnTest.Visible = false; btnIF_Test.Visible = false; #endif //테스트용 데이터 strTest = (@"W0LJC7E8XHB2432045777F06970G30OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432055778F06971G31OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432065779F06972G32OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432075780F06973G33OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432085781F06974G34OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432095782F06975G35OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432105783F06976G36OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432115784F06977G37OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432125785F06978G38OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432135786F06979G39OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432145787F06980G40OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432155788F06981G41OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432165789F06982G42OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432175790F06983G43OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432185791F06984G44OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432195792F06985G45OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432205793F06986G46OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432215794F06987G47OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432225795F06988G48OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432235796F06989G49OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432245797F06990G50OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK" ).Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); pnlImage.BackgroundImageLayout = ImageLayout.Zoom; inpPicSizeMode.ComboBoxItems.AddRange(Fnc.EnumItems2Strings(new ImageLayout())); inpPicSizeMode.Value = pnlImage.BackgroundImageLayout.ToString(); }