Ejemplo n.º 1
0
 private void btnSQLServer_Click(object sender, EventArgs e)
 {
     if (this.GetSQLVer(this.constr) == "9")
     {
         Common.Write(this.m_Pdm, this.constr.Replace("master", this.comboBoxDatabase.Text.Trim()) + (object)"," + (string)(object)DataType.MSSQLSRV2005);
         this.m_FrmStart.MyDataType   = DataType.MSSQLSRV2005;
         this.m_FrmStart.DialogResult = DialogResult.OK;
         int num = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("baocunchenggong"), MessageBoxIcon.Asterisk, MessageBoxButtons.OK);
         this.Close();
     }
     else
     {
         Common.Write(this.m_Pdm, this.constr.Replace("master", this.comboBoxDatabase.Text.Trim()) + (object)"," + (string)(object)DataType.MSSQLSRV2008);
         this.m_FrmStart.MyDataType   = DataType.MSSQLSRV2008;
         this.m_FrmStart.DialogResult = DialogResult.OK;
         int num = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("baocunchenggong"), MessageBoxIcon.Asterisk, MessageBoxButtons.OK);
         this.Close();
     }
 }
Ejemplo n.º 2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         string text1 = this.txtUname.Text;
         if (string.IsNullOrWhiteSpace(text1))
         {
             int num1 = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("youxiangbunengweikong"), MessageBoxIcon.Exclamation, MessageBoxButtons.OK);
         }
         else
         {
             string text2 = this.txtUpwd.Text;
             if (string.IsNullOrWhiteSpace(text2))
             {
                 int num2 = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("yanzhengmabunengweikong"), MessageBoxIcon.Exclamation, MessageBoxButtons.OK);
             }
             else
             {
                 string id = Common.GetID();
                 using (VersionClient versionClient = new VersionClient())
                 {
                     string version = versionClient.GetVersion(text1, text2, id);
                     versionClient.Close();
                     if (string.IsNullOrWhiteSpace(version))
                     {
                         int num3 = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("qinghedui"), MessageBoxIcon.Exclamation, MessageBoxButtons.OK);
                     }
                     else
                     {
                         int num4 = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("jihuochenggong"), MessageBoxIcon.Asterisk, MessageBoxButtons.OK);
                         this.btnClose_Click(sender, e);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         int num = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("CheckNetwork") + "\r\n" + ex.Message, MessageBoxIcon.Exclamation, MessageBoxButtons.OK);
     }
 }
Ejemplo n.º 3
0
        private void LoadServer()
        {
            this.treeView1.Nodes.Clear();
            TreeNode node1 = new TreeNode(BaseBusiness.GetResourceValue("shujuku"));

            node1.Tag                = (object)"serverlist";
            node1.ImageIndex         = 2;
            node1.SelectedImageIndex = 2;
            node1.Checked            = true;
            this.treeView1.Nodes.Add(node1);
            TreeNode node2 = new TreeNode(BaseBusiness.GetResourceValue("biao"));

            node2.Tag                = (object)"serverlist";
            node2.ImageIndex         = 3;
            node2.SelectedImageIndex = 4;
            node2.Checked            = true;
            node1.Nodes.Add(node2);
            TreeNode node3 = new TreeNode(BaseBusiness.GetResourceValue("shitu"));

            node3.Tag                = (object)"serverlist";
            node3.ImageIndex         = 3;
            node3.SelectedImageIndex = 4;
            node3.Checked            = true;
            node1.Nodes.Add(node3);
            node1.ExpandAll();
            try
            {
                IData dataSource = new DataFactory().CreateDataSource(this.m_FrmStart.MyDataType);
                if (dataSource == null)
                {
                    return;
                }
                DataSourse data = dataSource.GetData(this.m_FrmStart.GetPdmConn());
                if (!string.IsNullOrWhiteSpace(data.m_ErrorMessage))
                {
                    int num = (int)this.m_FrmStart.MessageBoxShow(data.m_ErrorMessage, MessageBoxIcon.Asterisk, MessageBoxButtons.OK);
                }
                else
                {
                    List <Table> list1 = Common.ConvertT(data.ListTable);
                    List <View>  list2 = Common.ConvertT(data.ListView);
                    if (list1 != null)
                    {
                        foreach (Table table1 in list1)
                        {
                            Table table = table1;
                            if (!Enumerable.Any <string>((IEnumerable <string>) this.WorkflowTableAndSys, (Func <string, bool>)(a => a.ToLower() == table.Code.ToLower())))
                            {
                                node2.Nodes.Add(new TreeNode(table.Name)
                                {
                                    ImageIndex         = 5,
                                    SelectedImageIndex = 5,
                                    Tag     = (object)table.Id,
                                    Checked = true
                                });
                            }
                        }
                    }
                    if (list2 != null)
                    {
                        foreach (View view1 in list2)
                        {
                            View view = view1;
                            if (!Enumerable.Any <string>((IEnumerable <string>) this.WorkflowView, (Func <string, bool>)(a => a.ToLower() == view.Code.ToLower())))
                            {
                                node3.Nodes.Add(new TreeNode(view.Name)
                                {
                                    ImageIndex         = 6,
                                    SelectedImageIndex = 6,
                                    Tag     = (object)view.Id,
                                    Checked = true
                                });
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                try
                {
                    using (VersionClient versionClient = new VersionClient())
                    {
                        versionClient.WriteExceptions(new SysException()
                        {
                            ComputerInfo = Common.GetID(),
                            Message      = ex.Message,
                            StackTrace   = ex.StackTrace
                        });
                        versionClient.Close();
                        int num = (int)this.m_FrmStart.MessageBoxShow(ex.Message, MessageBoxIcon.Hand, MessageBoxButtons.OK);
                    }
                }
                catch
                {
                }
            }
        }