protected void TestConnect(string strcn, string Code) { var sys_configconnection = new SYS_ConfigConnection(); var isys_configconnection = new SYS_ConfigConnectionServer(); sys_configconnection.connection = strcn; var sysModunService = new SYS_ModunService(); List <SYS_Modun> sysModun = sysModunService.SelectAllSYS_Modun(); for (int i = 0; i < sysModun.Count; i++) { if (Code.Trim() == sysModun[i].Code.Trim()) { throw new Exception(GetLocalResourceObject("strErrMesageCode").ToString()); } } try { if (isys_configconnection.TestConnectSYS_ConfigConnection(sys_configconnection, "KoMH")) { Session["ConnectString"] = sys_configconnection.connection; } else { throw new Exception(GetLocalResourceObject("strErrMesage").ToString()); } } catch (Exception) { throw new Exception(GetLocalResourceObject("strErrMesage").ToString()); } }
protected void grvSys_Right_DataBinding(object sender, EventArgs e) { GridViewDataComboBoxColumn columnModule = ((GridViewDataComboBoxColumn)(sender as ASPxGridView).Columns["Module"]); var _sys_module = new SYS_ModunService(); List <Entity.SYS_Modun> _lstModun = new List <Entity.SYS_Modun>(); try { _lstModun = _sys_module.SelectAllSYS_Modun(); columnModule.PropertiesComboBox.DataSource = _lstModun; columnModule.PropertiesComboBox.TextField = "Name"; columnModule.PropertiesComboBox.ValueField = "ID"; } catch (Exception ex) { throw new Exception(string.Format("grvSys_Right_DataBinding Error")); } }
private void _DataBind() { List <SYS_Modun> lstModun = new List <SYS_Modun>(); List <SYS_Modun> lst = new List <SYS_Modun>(); var sysModunService = new SYS_ModunService(); SYS_ConfigConnectionServer configConnectionServer = new SYS_ConfigConnectionServer(); lstModun = sysModunService.SelectAllSYS_Modun(); foreach (SYS_Modun sysModun in lstModun) { string temp = ""; temp = configConnectionServer.DecryptSYS_ConfigConnection(sysModun.ConnectString); sysModun.ConnectString = temp; lst.Add(sysModun); } grvModunManager.DataSource = lst; grvModunManager.DataBind(); }