Ejemplo n.º 1
0
        /// <summary>
        /// 得到所有别名的List项
        /// </summary>
        /// <param name="A"></param>
        /// <returns></returns>
        public List <String> GetAlias(String A)
        {
            List <String> list0 = new List <string>();

            if (String.IsNullOrEmpty(A) == false)
            {
                JTable             tab1      = new JTable("TRAINALIAS");
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("TRAINNAME", A));
                DataRow dr1 = tab1.GetFirstDataRow(condition, " TRAINALIAS ");
                if (dr1 != null)
                {
                    String t1 = dr1[0].ToString();
                    if (String.IsNullOrEmpty(t1) == false)
                    {
                        String[] s1 = t1.Replace(",", ",").Split(',');
                        foreach (String m in s1)
                        {
                            if (list0.Contains(m) == false)
                            {
                                list0.Add(m);
                            }
                        }
                    }
                }
                tab1.Close();

                //把自己加入
                if (list0.Contains(A) == false)
                {
                    list0.Add(A);
                }
            }
            return(list0);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 得到下一个编号
        /// </summary>
        /// <returns></returns>
        public static int  GetNextNum(String TableName, String ColumnName)
        {
            int    result = 1;
            JTable tab1   = null;

            try
            {
                tab1 = new JTable(TableName);
                DataRow dr1 = tab1.GetFirstDataRow(null, "max(" + ColumnName + ") as max1");
                if (dr1 != null && dr1[0].ToString() != String.Empty)
                {
                    int.TryParse(dr1[0].ToString(), out result);
                    result++;
                }
            }
            catch (Exception err)
            {
                result = 1;
            }
            finally
            {
                if (tab1 != null)
                {
                    tab1.Close();
                }
            }

            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// اطلاعات
        /// </summary>
        /// <param name="pCode">کد object</param>
        /// <returns>Boolean</returns>
        public void GetData(int pCode)
        {
            JDataBase db = new JDataBase();

            try
            {
                if (pCode == 0)
                {
                    db.setQuery(@"SELECT * FROM " + JTableNamesAutomation.Emprise);
                }
                else
                {
                    db.setQuery(@"SELECT * FROM " + JTableNamesAutomation.Emprise + " WHERE " + Emprise.Code + "=" + pCode.ToString());
                }

                db.Query_DataReader();
                Items = new JAEmprise[db.RecordCount];
                int count = 0;
                if (db.DataReader.Read())
                {
                    Items[count] = new JAEmprise();
                    JTable.SetToClassProperty(Items[count], db.DataReader);
                    count++;
                }
            }
            finally
            {
                db.Dispose();
            }
        }
Ejemplo n.º 4
0
        public IQueryable <JobOrderInspectionHeaderViewModel> GetJobOrderInspectionHeaderList(int DocTypeId, string Uname)
        {
            var DivisionId = (int)System.Web.HttpContext.Current.Session["DivisionId"];
            var SiteId     = (int)System.Web.HttpContext.Current.Session["SiteId"];

            return(from p in db.JobOrderInspectionHeader
                   join J in db.Persons on p.JobWorkerId equals J.PersonID into JTable
                   from JTab in JTable.DefaultIfEmpty()
                   join E in db.Persons on p.InspectionById equals E.PersonID into ETable
                   from ETab in ETable.DefaultIfEmpty()
                   orderby p.DocDate descending, p.DocNo descending
                   where p.SiteId == SiteId && p.DivisionId == DivisionId && p.DocTypeId == DocTypeId
                   select new JobOrderInspectionHeaderViewModel
            {
                JobOrderInspectionHeaderId = p.JobOrderInspectionHeaderId,
                DocDate = p.DocDate,
                DocNo = p.DocNo,
                JobWorkerName = JTab.Name,
                InspectionByName = ETab.Name,
                DocTypeName = p.DocType.DocumentTypeName,
                Remark = p.Remark,
                Status = p.Status,
                ModifiedBy = p.ModifiedBy,
                ReviewCount = p.ReviewCount,
                ReviewBy = p.ReviewBy,
                Reviewed = (SqlFunctions.CharIndex(Uname, p.ReviewBy) > 0),
            }
                   );
        }
Ejemplo n.º 5
0
        public LogPanel(JamochaGui gui)
            : base(gui)
        {
            InitBlock();
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());
            logChannel = gui.Engine.MessageRouter.openChannel("gui_log", InterestType.ALL);
            detailView = new JTextArea();
            detailView.setEditable(false);
            //UPGRADE_NOTE: If the given Font Name does not exist, a default Font instance is created. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1075"'
            //UPGRADE_TODO: Method 'java.awt.Font.Plain' was converted to 'System.Drawing.FontStyle.Regular' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtFontPLAIN_f"'
            detailView.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));
            cellRenderer = new LogTableCellRenderer(this);
            logTable = new AnonymousClassJTable(this, dataModel);
            logTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            logTable.SelectionModel.addListSelectionListener(this);
            pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(logTable), new JScrollPane(detailView));
            pane.setDividerLocation(gui.Preferences.getInt("log.dividerlocation", 300));
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(pane, BorderLayout.CENTER);

            SupportClass.ThreadClass logThread = new AnonymousClassThread(this);
            logThread.Start();
            clearButton = new JButton("Clear Log", IconLoader.getImageIcon("monitor"));
            clearButton.addActionListener(this);
            JPanel buttonPanel = new JPanel();
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.RIGHT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 1));
            buttonPanel.add(clearButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000"'
            add(buttonPanel, BorderLayout.PAGE_END);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 根据条件,修改一个实体数据
        /// </summary>
        /// <param name="condition">修改数据的条件</param>
        /// <param name="data1">新的数据</param>
        public void EditData(List <SearchField> condition, JAuthorityDetailDD data1)
        {
            JTable tab1 = new JTable(daConnect, TableName);

            tab1.EditData(data1, condition);
            tab1.Close();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// تنظیم مقادیر کلاس
        /// </summary>
        /// <param name="pCode">کد object</param>
        /// <returns>Boolean</returns>
        public Boolean GetData(int pCode)
        {
            JDataBase Db = new JDataBase();

            try
            {
                string Query = "Select * AutoSuccessor from  where Code=" + pCode + "";
                Db.setQuery(Query);
                Db.Query_DataReader();
                if (Db.DataReader.Read())
                {
                    JTable.SetToClassProperty(this, Db.DataReader);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                JSystem.Except.AddException(ex);
                return(false);
            }
            finally
            {
                Db.Dispose();
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 得到长交路表示列表
        /// </summary>
        /// <returns></returns>
        public DataTable GetPayPrjList()
        {
            JTable tab = new JTable("PAYPROJ");

            tab.CommandText = "select * from PAYPROJ";
            return(tab.SearchData(-1).Tables[0]);
        }
Ejemplo n.º 9
0
        public bool GetData(JDataBase pDB, int pCode)
        {
            JDataBase DB;

            if (pDB != null)
            {
                DB = pDB;
            }
            else
            {
                DB = new JDataBase();
            }
            try
            {
                DB.setQuery("select * from AUTDocumentDetail where code=" + pCode.ToString());
                DB.Query_DataReader();
                if (DB.DataReader.Read())
                {
                    JTable.SetToClassProperty(this, DB.DataReader);
                    return(true);
                }
                return(false);
            }
            finally
            {
                if (pDB == null)
                {
                    DB.Dispose();
                }
            }
        }
        /// <summary>
        /// 得到工单的人员测试比例,A为3B为2C为1
        /// </summary>
        /// <param name="TaskID"></param>
        /// <returns></returns>
        public Dictionary <String, double> GetTaskDebugRate(String TaskID)
        {
            Dictionary <String, double> dic1 = new Dictionary <string, double>();

            String sql  = "select AddUserID,sum(BugA*3+BugB*2+BugC) from Tb_Task_Bug where parentGuid='" + TaskID + "' group by AddUserID";
            JTable tab1 = new JTable(daConnect, TableName);

            tab1.CommandText = sql;
            DataTable dt1 = tab1.SearchData(-1).Tables[0];
            double    t1  = 0;

            foreach (DataRow dr1 in dt1.Rows)
            {
                dic1.Add(dr1[0].ToString(), double.Parse(dr1[1].ToString()));
                t1 = t1 + double.Parse(dr1[1].ToString());
            }
            tab1.Close();

            //t1>0
            if (t1 > 0)
            {
                String[] keys = dic1.Keys.ToArray();
                for (int i = 0; i < keys.Length; i++)
                {
                    String m1 = keys[i];
                    dic1[m1] = Math.Round(dic1[m1] / t1, 2);
                }
            }
            else
            {
                dic1.Clear();
            }
            return(dic1);
        }
Ejemplo n.º 11
0
        public static JTable ReadTableSettingByFile(string tableSettingFileName)
        {
            string settingContent = File.ReadAllText(tableSettingFileName, Encoding.UTF8);
            JTable table          = SerializeHelper.XmlDeserialize <JTable>(settingContent);

            return(table);
        }
Ejemplo n.º 12
0
        public static JWorkFlow[] GetAllNodes(string pClassName, int pDynamicClassCode)
        {
            JDataBase DB = new JDataBase();

            try
            {
                DB.setQuery("SELECT * FROM WorkFlowNode WHERE ClassName='" + pClassName + "' AND DynamicClassCode=" + pDynamicClassCode.ToString());
                DataTable _DT = DB.Query_DataTable();

                List <JWorkFlow> WF = new List <JWorkFlow>();

                foreach (DataRow _DR in _DT.Rows)
                {
                    JWorkFlow tempWF = new JWorkFlow();
                    JTable.SetToClassProperty(tempWF, _DR);
                    WF.Add(tempWF);
                }
                return(WF.ToArray());
            }
            catch
            {
                return(null);
            }
            finally
            {
                DB.Dispose();
            }
        }
Ejemplo n.º 13
0
        public JWorkFlow[] GetNextNodes(bool pCheckCon)
        {
            JDataBase DB = new JDataBase();

            try
            {
                DB.setQuery("SELECT * FROM WorkFlowNode WHERE ClassName='" + ClassName + "' AND DynamicClassCode='" + DynamicClassCode.ToString() + "' AND Ordered in(" + NextNodes + ")");
                DataTable _DT = DB.Query_DataTable();

                JWorkFlow[] WF = new JWorkFlow[0];

                foreach (DataRow _DR in _DT.Rows)
                {
                    JWorkFlow tempWF = new JWorkFlow(_PublicDataRow, ReferCode);
                    JTable.SetToClassProperty(tempWF, _DR);
                    tempWF.SetWorkFlowCondition();
                    if (!pCheckCon || tempWF.CheckCondition())
                    {
                        Array.Resize(ref WF, WF.Length + 1);
                        WF[WF.Length - 1] = tempWF;
                    }
                }
                return(WF);
            }
            catch
            {
                return(null);
            }
            finally
            {
                DB.Dispose();
            }
        }
Ejemplo n.º 14
0
        public bool GetData(long pCode)
        {
            JDataBase Db = new JDataBase();

            try
            {
                string Query = "select * from BascolWeights where Code=" + pCode + "";
                Db.setQuery(Query);
                Db.Query_DataReader();
                if (Db.DataReader.Read())
                {
                    JTable.SetToClassProperty(this, Db.DataReader);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                JSystem.Except.AddException(ex);
                return(false);
            }
            finally
            {
                Db.Dispose();
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 新增一个实体数据
        /// </summary>
        /// <param name="data1">实体数据</param>
        public void NewData(JModelDD data1)
        {
            JTable tab1 = new JTable(daConnect, TableName);

            tab1.InsertData(data1);
            tab1.Close();
        }
Ejemplo n.º 16
0
        public static String GetBigList(String num)
        {
            String result = String.Empty;

            if (String.IsNullOrEmpty(num) == false)
            {
                JTable             tab1      = new JTable("BIGSTATIONLIST");
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("parentnum", num, SearchFieldType.NumericType));
                DataSet ds1 = tab1.SearchData(condition, -1, "name1");
                foreach (DataRow dr1 in ds1.Tables[0].Rows)
                {
                    if (result == String.Empty)
                    {
                        result = dr1["name1"].ToString();
                    }
                    else
                    {
                        result = result + "," + dr1["name1"].ToString();
                    }
                }
                ds1.Dispose();
                tab1.Close();
            }
            return(result);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 功能:更新数据
        /// </summary>
        /// <param name="condition">更新数据的条件</param>
        /// <param name="newData">新数据的值</param>
        public void UpdateData(List <SearchField> condition, Dictionary <string, object> newData)
        {
            JTable tab1 = new JTable(TableName);

            tab1.EditData(newData, condition);
            tab1.Close();
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 新增一条数据
        /// </summary>
        /// <param name="data1">Dictionary数据</param>
        public void NewData(Dictionary <String, object> data1)
        {
            JTable tab1 = new JTable(daConnect, TableName);

            tab1.InsertData(data1);
            tab1.Close();
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 新增一个实体数据
        /// </summary>
        /// <param name="data1">实体数据</param>
        public void NewData(JAuthorityDetailDD data1)
        {
            JTable tab1 = new JTable(daConnect, TableName);

            tab1.InsertData(data1);
            tab1.Close();
        }
Ejemplo n.º 20
0
        public JAFolder[] GetMainFolders(int pFolderType)
        {
            JDataBase DB = new JDataBase();

            try
            {
                DB.setQuery("SELECT * FROM " + ClassLibrary.JTableNamesAutomation.Folders + " WHERE user_post_code=" + JMainFrame.CurrentPostCode.ToString()
                            + " AND foldertype = " + pFolderType.ToString() + " AND (" + Folder.parent_code + "<1 OR " + Folder.parent_code + " IS NULL)");
                DB.Query_DataReader();
                JAFolder[] Folders = new JAFolder[0];
                Array.Resize(ref Folders, DB.RecordCount);
                int count = 0;
                while (DB.DataReader.Read())
                {
                    JAFolder folder = new JAFolder();
                    JTable.SetToClassProperty(folder, DB.DataReader);
                    Folders[count++] = folder;
                }
                return(Folders);
            }
            finally
            {
                DB.Dispose();
            }
        }
        /// <summary>
        /// 根据条件,修改一个实体数据
        /// </summary>
        /// <param name="condition">修改数据的条件</param>
        /// <param name="data1">新的数据</param>
        public void EditData(List <SearchField> condition, JUserActionLogDD data1)
        {
            JTable tab1 = new JTable(daConnect, TableName);

            tab1.EditData(data1, condition);
            tab1.Close();
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 根据条件,修改一个数据
        /// </summary>
        /// <param name="condition">修改数据的条件</param>
        /// <param name="data1">新的数据</param>
        public void EditData(List <SearchField> condition, Dictionary <String, object> data1)
        {
            JTable tab1 = new JTable(daConnect, TableName);

            tab1.EditData(data1, condition);
            tab1.Close();
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 将视图状态中的数据进行提交
        /// 1、判断是否有删除的数据,如果有,则删除
        /// 2、判断是否有新增的数据,如果有,则新增
        /// 3、剔除PARENTGUID为-1的数据
        /// </summary>
        public void Submit()
        {
            DataTable                   dt1       = this.AttachmentList;
            JTable                      tab1      = new JTable(this.TableName);
            List <SearchField>          condition = new List <SearchField>();
            Dictionary <String, object> dic1      = new Dictionary <string, object>();

            foreach (DataRow dr1 in dt1.Rows)
            {
                if (dr1["PARENTGUID"].ToString() != "-1")
                {
                    if (dr1["DataStatus"].ToString() == "deletedata")  //需要删除数据
                    {
                        //删除文件
                        if (String.IsNullOrEmpty(dr1["FILEDIR"].ToString()) == false &&
                            String.IsNullOrEmpty(dr1["ENCRYPTFILENAME"].ToString()) == false)
                        {
                            String fileName = dr1["FILEDIR"].ToString() + dr1["ENCRYPTFILENAME"].ToString();
                            fileName = Server.MapPath(fileName);
                            if (File.Exists(fileName))
                            {
                                File.Delete(fileName);
                            }
                        }

                        //删除数据库中的相关数据
                        condition.Clear();
                        condition.Add(new SearchField("GUIDID", dr1["GUIDID"].ToString()));
                        dic1.Clear();
                        dic1["DEL"] = "1";  //逻辑删除数据
                        tab1.EditData(dic1, condition);
                        //tab1.DeleteData(condition);
                    }

                    if (dr1["DataStatus"].ToString() == "newdata")  //表示新增数据
                    {
                        //将文件名改名,去掉$$符号
                        if (String.IsNullOrEmpty(dr1["FILEDIR"].ToString()) == false &&
                            String.IsNullOrEmpty(dr1["ENCRYPTFILENAME"].ToString()) == false)
                        {
                            String fileName  = dr1["FILEDIR"].ToString() + dr1["ENCRYPTFILENAME"].ToString();
                            String fileName1 = dr1["FILEDIR"].ToString() + dr1["ENCRYPTFILENAME"].ToString().Replace("$$", "");
                            fileName  = Server.MapPath(fileName);
                            fileName1 = Server.MapPath(fileName1);

                            File.Copy(fileName, fileName1);
                            File.Delete(fileName);
                        }

                        //更新数据中的数据
                        dic1.Clear();
                        dic1 = FrameLib.GetDictionaryByDataRow(dr1);
                        dic1["ENCRYPTFILENAME"] = dic1["ENCRYPTFILENAME"].ToString().Replace("$$", "");
                        dic1.Remove("DataStatus");
                        tab1.InsertData(dic1);
                    }
                }
            }
            tab1.Close();
        }
        /// <summary>
        /// 新增一个实体数据
        /// </summary>
        /// <param name="data1">实体数据</param>
        public void NewData(JUserActionLogDD data1)
        {
            JTable tab1 = new JTable(daConnect, TableName);

            tab1.InsertData(data1);
            tab1.Close();
        }
Ejemplo n.º 25
0
        public void DeleteData(String num)
        {
            JTable tab1 = new JTable();

            tab1.MyConnect.BeginTrans();
            try
            {
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("parentnum", num, SearchFieldType.NumericType));
                tab1.TableName = "BIGSTATIONLIST";
                tab1.DeleteData(condition);

                tab1.TableName = "BIGSTATION";
                condition.Clear();
                condition.Add(new SearchField("num", num, SearchFieldType.NumericType));
                tab1.DeleteData(condition);
                tab1.MyConnect.CommitTrans();
            }
            catch
            {
                tab1.MyConnect.RollBackTrans();
            }
            finally
            {
                if (tab1 != null)
                {
                    tab1.Close();
                }
            }
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 从数据库中绑定数据
        /// </summary>
        public void BindDataFromDB()
        {
            DataTable dt1  = null;
            JTable    tab1 = new JTable(this.TableName);

            if (String.IsNullOrEmpty(this.ParentID) == false)
            {
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField(this.ParentField, this.ParentID));
                condition.Add(new SearchField("DEL", "0", SearchFieldType.NumericType));

                tab1.OrderBy = this.OrderBy;
                dt1          = tab1.SearchData(condition, -1, "*").Tables[0];
            }
            tab1.Close();

            //增加数据的标识状态
            dt1.Columns.Add("DataStatus");
            dt1.PrimaryKey = new DataColumn[] { dt1.Columns["GUIDID"] };

            //将数据保存到视图状态
            this.AttachmentList = dt1;

            //绑定List显示的数据
            this.BindList();
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 功能:插入一条数据
        /// <param name="data1">要插入的数据</param>
        /// </summary>
        public void InsertData(Dictionary <string, object> data1)
        {
            JTable tab1 = new JTable(TableName);

            tab1.InsertData(data1);
            tab1.Close();
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 根据条件删除数据
        /// </summary>
        /// <param name="condition">删除数据条件</param>
        public void DeleteData(List <SearchField> condition)
        {
            JTable tab1 = new JTable(daConnect, TableName);

            tab1.DeleteData(condition);
            tab1.Close();
        }
Ejemplo n.º 29
0
        }         //GEN-LAST:event_copyItemActionPerformed

        private void saveAsItemActionPerformed(ActionEvent evt)
        {         //GEN-FIRST:event_saveAsItemActionPerformed
            java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("pspsharp/languages/pspsharp");
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'sealed override':
//ORIGINAL LINE: sealed override javax.swing.JFileChooser fc = new javax.swing.JFileChooser();
            JFileChooser fc = new JFileChooser();

            fc.DialogTitle      = bundle.getString("FileLoggerFrame.strSaveTable.text");
            fc.SelectedFile     = new File(State.discId + "_fileio.txt");
            fc.CurrentDirectory = new File(".");
            fc.addChoosableFileFilter(Constants.fltTextFiles);
            fc.FileFilter = Constants.fltTextFiles;

            if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION)
            {
                File f = fc.SelectedFile;
                if (f.exists())
                {
                    int rc = MessageBox.Show(this, bundle.getString("ConsoleWindow.strFileExists.text"), bundle.getString("ConsoleWindow.strFileExistsTitle.text"), MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);

                    if (rc != DialogResult.Yes)
                    {
                        return;
                    }
                }

                try
                {
                    JTable source = (JTable)((JPopupMenu)((JMenuItem)evt.Source).Parent).Invoker;
                    string data   = "";

                    // list column headers
                    for (int j = 0; j < source.ColumnCount; j++)
                    {
                        data += source.getColumnName(j) + ";";
                    }
                    // strip last semicolon and put a newline there instead
                    data = data.Substring(0, data.Length - 1) + System.getProperty("line.separator");

                    // list table content
                    for (int i = 0; i < source.RowCount; i++)
                    {
                        for (int j = 0; j < source.ColumnCount; j++)
                        {
                            data += source.Model.getValueAt(i, j) + ";";
                        }
                        // strip last semicolon and put a newline there instead
                        data = data.Substring(0, data.Length - 1) + System.getProperty("line.separator");
                    }

                    System.IO.StreamWriter os = new System.IO.StreamWriter(f);
                    os.Write(data);
                    os.Close();
                }
                catch (IOException ioe)
                {
                    MessageBox.Show(this, bundle.getString("FileLoggerFrame.strSaveFailed.text") + ioe.LocalizedMessage);
                }
            }
        }         //GEN-LAST:event_saveAsItemActionPerformed
Ejemplo n.º 30
0
        /// </summary>
        /// <param name="newPassWord"></param>
        /// <returns></returns>
        public bool UpdatePassWord(String UserName, String oldPassWord, String newPassWord)
        {
            bool succ = false;

            if (String.IsNullOrEmpty(UserName) == false)
            {
                JTable             tab1      = new JTable(TableName);
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("UserName", UserName));
                DataSet ds1 = tab1.SearchData(condition, 1, "*");
                if (ds1 != null && ds1.Tables[0].Rows.Count > 0)
                {
                    DataRow dr1 = ds1.Tables[0].Rows[0];
                    if (JString.MD5(oldPassWord) == dr1["password"].ToString())
                    {
                        succ            = true;
                        dr1["password"] = JString.MD5(newPassWord);
                        tab1.Update(ds1.Tables[0]);
                    }
                }
                ds1.Dispose();
                tab1.Close();
            }
            return(succ);
        }
Ejemplo n.º 31
0
        void button1_Click(object sender, EventArgs e)
        {
            JTable                      tab1      = new JTable("LINEPROFILE");
            List <SearchField>          condition = new List <SearchField>();
            Dictionary <String, object> data1     = new Dictionary <string, object>();
            int i = 1;

            String[] arr1 = "Fee1,Fee2,Fee3,Fee4,Fee5,Fee6".Split(',');
            foreach (RepeaterItem item in this.Repeater1.Items)
            {
                condition.Clear();
                condition.Add(new WebFrame.Data.SearchField("ID", i + "", WebFrame.SearchFieldType.NumericType));
                data1.Clear();
                foreach (String m in arr1)
                {
                    TextBox t1 = item.FindControl(m) as TextBox;
                    if (t1 != null)
                    {
                        data1[m] = t1.Text;
                    }
                }
                tab1.EditData(data1, condition);
                i++;
            }
            tab1.Close();
            BusinessRule.LineProfile.SetData();
            WebFrame.Util.JAjax.Alert("提示:更新数据操作成功!");
        }
Ejemplo n.º 32
0
			public virtual Component GetTableCellEditorComponent(JTable table, object value, bool isSelected, int r, int c)
			{
				return this._enclosing.tree;
			}
Ejemplo n.º 33
0
			/// <summary>TreeCellRenderer method.</summary>
			/// <remarks>TreeCellRenderer method. Overridden to update the visible row.</remarks>
			public virtual Component GetTableCellRendererComponent(JTable table, object value, bool isSelected, bool hasFocus, int row, int column)
			{
				if (isSelected)
				{
					this.SetBackground(table.GetSelectionBackground());
				}
				else
				{
					this.SetBackground(table.GetBackground());
				}
				this.visibleRow = row;
				return this;
			}
Ejemplo n.º 34
0
        public FactsPanel(JamochaGui gui)
            : base(gui)
        {
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());

            dataModel = new FactsTableModel(this);
            TableSorter sorter = new TableSorter(new TableMap());
            ((TableMap) sorter.Model).setModel(dataModel);
            factsTable = new JTable(sorter);
            sorter.addMouseListenerToHeaderInTable(factsTable);

            factsTable.setShowHorizontalLines(true);
            factsTable.setRowSelectionAllowed(true);
            factsTable.TableHeader.setReorderingAllowed(false);
            factsTable.TableHeader.setToolTipText("Click to sort ascending. Click while pressing the shift-key down to sort descending");
            factsTable.SelectionModel.addListSelectionListener(this);
            dumpArea = new JTextArea();
            dumpArea.setLineWrap(true);
            dumpArea.setWrapStyleWord(true);
            dumpArea.setEditable(false);
            //UPGRADE_NOTE: If the given Font Name does not exist, a default Font instance is created. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1075"'
            //UPGRADE_TODO: Method 'java.awt.Font.Plain' was converted to 'System.Drawing.FontStyle.Regular' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtFontPLAIN_f"'
            dumpArea.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));

            pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(factsTable), new JScrollPane(dumpArea));
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(pane, BorderLayout.CENTER);
            pane.setDividerLocation(gui.Preferences.getInt("facts.dividerlocation", 300));
            reloadButton = new JButton("Reload Facts", IconLoader.getImageIcon("database_refresh"));
            reloadButton.addActionListener(this);
            assertButton = new JButton("Assert Fact", IconLoader.getImageIcon("database_add"));
            assertButton.addActionListener(this);
            JPanel buttonPanel = new JPanel();
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.RIGHT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 1));
            buttonPanel.add(reloadButton);
            buttonPanel.add(assertButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000"'
            add(buttonPanel, BorderLayout.PAGE_END);

            initPopupMenu();
        }
Ejemplo n.º 35
0
            public System.Windows.Forms.Control getTableCellRendererComponent(JTable table, System.Object value_Renamed, bool isSelected, bool hasFocus, int row, int column)
            {
                JComponent returnComponent = (JComponent) base.getTableCellRendererComponent(table, value_Renamed, isSelected, hasFocus, row, column);
                switch (((LogTableModel) table.Model).getRow(row).SuperType)
                {

                    case Enclosing_Instance.LogMessageEvent.TYPE_ERROR:
                        setForeground(colorError);
                        break;

                    case Enclosing_Instance.LogMessageEvent.TYPE_WARNING:
                        setForeground(colorWarning);
                        break;

                    default:
                        setForeground(colorEvent);
                        break;

                }
                return returnComponent;
            }