友情链接1:21点 足球投注 投注网 明升体育 hg0088 葡京赌场 网上赌球 诈金花 澳门金沙网址 澳门银河网址 澳门银河 澳门银河官网 银河官网 威尼斯人 澳门威尼斯人 澳门威尼斯人官网 威尼斯人官网 金沙 澳门金沙 澳门金沙官网 金沙官网 现金网 赌球网 全讯网 明升国际 足球开户 ******官网 ******网址 现金赌博 澳门现金网 ******官方网站

Carey's Blog http://www.liaoyong.name 鍙堜竴涓澂鍏风殑绋嬪簭鐚 Tue, 13 Jan 2015 02:25:32 +0000 en hourly 1 http://wordpress.org/?v=3.3.1 SQL Server 2008娓呯┖鍒犻櫎鏃ュ織鏂囦欢 http://www.liaoyong.name/?p=238 http://www.liaoyong.name/?p=238#comments Tue, 13 Jan 2015 02:24:35 +0000 Carey http://www.liaoyong.name/?p=238 --鏌ヨlog鍦╯ys.database_files涓槸浠涔堝悕瀛 USE DBname GO SELECT file_id, name FROM sys.database_files --end --寮濮嬫墽琛屾棩蹇楁竻绌 USE[master] GO ALTER DATABASE DBname SET RECOVERY SIMPLE WITH NO_WAIT GO ALTER DATABASE DBname SET RECOVERY SIMPLE --绠鍗曟ā寮 GO USE DBname GO DBCC SHRINKFILE (N'DBname_log' , 11, TRUNCATEONLY) GO USE[master] GO ALTER DATABASE DBname SET RECOVERY FULL WITH NO_WAIT GO ALTER DATABASE DBname SET RECOVERY FULL --杩樺師涓哄畬鍏ㄦā寮 GO ----end  ]]> 鎶奃BName鏀规垚鏁版嵁搴撳悕绉板氨鍙,闅忔椂鍙墽琛,鍖呮嫭鐢ㄦ埛浣跨敤绯荤粺鏃!!

--鏌ヨlog鍦╯ys.database_files涓槸浠涔堝悕瀛
USE DBname

GO

SELECT file_id, name FROM sys.database_files
--end

--寮濮嬫墽琛屾棩蹇楁竻绌
USE[master]
    GO
    ALTER DATABASE DBname SET RECOVERY SIMPLE WITH NO_WAIT
    GO
    ALTER DATABASE DBname SET RECOVERY SIMPLE   --绠鍗曟ā寮
    GO
    USE DBname
    GO
    DBCC SHRINKFILE (N'DBname_log' , 11, TRUNCATEONLY)
    GO
    USE[master]
    GO

    ALTER DATABASE DBname SET RECOVERY FULL WITH NO_WAIT

    GO

    ALTER DATABASE DBname SET RECOVERY FULL  --杩樺師涓哄畬鍏ㄦā寮

    GO
----end

 

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷SQL Server 2008娓呯┖鍒犻櫎鏃ュ織鏂囦欢

]]>
http://www.liaoyong.name/?feed=rss2&p=238 0
SQL05/08鏌ヨ褰撳墠搴撴暟鎹噺淇℃伅 http://www.liaoyong.name/?p=236 http://www.liaoyong.name/?p=236#comments Wed, 03 Sep 2014 00:18:41 +0000 Carey http://www.liaoyong.name/?p=236 set nocount on --涓嶈褰曟斁鍥炲灏戣鍙楀奖鍝嶏紝杩欐牱閫熷害蹇緢澶氾紝鏄竴绉嶄紭鍖 if object_id(N'tempdb.db.#temp') is not null drop table #temp create table #temp (name sysname,count numeric(18)) insert into #temp select o.name,i.rows from sysobjects o,sysindexes i where o.id=i.id and o.Xtype='U' and i.indid<2 select count(count) 褰撳墠搴撴昏〃鏁,sum(count) 鎬昏褰曟暟 from #temp select * from #temp set nocount off --鎵撳紑杩斿洖璁℃暟  ]]> [杞琞渚夸簬鏌ヨsql褰撳墠搴撴湁澶氬皯寮犺〃,鍚勮〃鏈夊灏戞潯鏁版嵁!

set nocount on --涓嶈褰曟斁鍥炲灏戣鍙楀奖鍝嶏紝杩欐牱閫熷害蹇緢澶氾紝鏄竴绉嶄紭鍖

if object_id(N'tempdb.db.#temp') is not null 

  drop table #temp 

create table #temp (name sysname,count numeric(18))

insert into #temp 

select o.name,i.rows 

from sysobjects o,sysindexes i 

where o.id=i.id and o.Xtype='U' and i.indid<2

select count(count) 褰撳墠搴撴昏〃鏁,sum(count) 鎬昏褰曟暟 from #temp 

select * from #temp 

set nocount off --鎵撳紑杩斿洖璁℃暟

 

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷SQL05/08鏌ヨ褰撳墠搴撴暟鎹噺淇℃伅

]]>
http://www.liaoyong.name/?feed=rss2&p=236 0
ABAP绗叚澶-娑堟伅鐨勫畾涔夊拰浣跨敤 http://www.liaoyong.name/?p=213 http://www.liaoyong.name/?p=213#comments Thu, 23 May 2013 14:17:06 +0000 Carey http://www.liaoyong.name/?p=213 NO.6 娑堟伅鐨勫畾涔夊拰浣跨敤 瀹氫箟娑堟伅 TCODE:SE91 瀹氫箟濂芥秷鎭竻鍗,鍙互瀹氫箟杈撳叆鍙傛暟(绗﹀彿&),濡傗&&&鈥濊〃绀烘湁3涓弬鏁.ABAP涓彲浠ユ湁4涓弬鏁. 渚:鍒涘缓鍚嶄负鈥漐LZY001鈥濈殑娑堟伅娓呭崟 闀挎枃鏈 鏄剧ず鏇磋缁嗙殑娑堟伅鍐呭,鍏夋爣瀹氫簬001琛,鐐瑰嚮鈥滾ong Text鈥,杈撳叆璇︾粏鏂囨湰鍐呭: 浣跨敤娑堟伅 娑堟伅鐨勭被鍨嬪寘鍚: E鈥斺旈敊璇 W鈥斺旇鍛 I鈥斺斾俊鎭 A鈥斺斿紓甯哥粓姝 S鈥斺旀垚鍔 浣跨敤娑堟伅瀹炰緥1: TCODE:se38鍒涘缓娴嬭瘯绋嬪簭,缂栬緫浠g爜濡備笅 MESSAGE聽ID聽'ZLZY001'聽TYPE聽'I'聽NUMBER聽'001'. "鎻愮ず娑堟伅娓呭崟"ZLZY001""001"娑堟伅鍐呭,娑堟伅鎻愮ず绫诲埆"淇℃伅".聽 鎴栬呯畝鍐欎负: MESSAGE聽I001(ZLZY001). OK,F8鎵ц鏁堟灉濡備笅: 瀹氫箟鐨凩ong Text鍙互閫氳繃鐐瑰嚮 鏌ョ湅: 浣跨敤娑堟伅瀹炰緥2-甯﹀弬鏁: DATA:MSG1(20)聽TYPE聽C聽VALUE聽'鍙傛暟'. DATA:MSG2(20)聽TYPE聽C聽VALUE聽'娑堟伅'. DATA:MSG3(20)聽TYPE聽C聽VALUE聽'鎻愮ず'. DATA:MSG4(20)聽TYPE聽C聽VALUE聽'娴嬭瘯'. MESSAGE 聽I000(ZLZY001)聽 WITH 聽MSG1聽 MSG2 聽MSG3聽 MSG4. F8鎵ц鏁堟灉: ]]> NO.6 娑堟伅鐨勫畾涔夊拰浣跨敤

瀹氫箟娑堟伅

TCODE:SE91

瀹氫箟濂芥秷鎭竻鍗,鍙互瀹氫箟杈撳叆鍙傛暟(绗﹀彿&),濡傗&&&鈥濊〃绀烘湁3涓弬鏁.ABAP涓彲浠ユ湁4涓弬鏁.

渚:鍒涘缓鍚嶄负鈥漐LZY001鈥濈殑娑堟伅娓呭崟

闀挎枃鏈

鏄剧ず鏇磋缁嗙殑娑堟伅鍐呭,鍏夋爣瀹氫簬001琛,鐐瑰嚮鈥滾ong Text鈥,杈撳叆璇︾粏鏂囨湰鍐呭:

浣跨敤娑堟伅

娑堟伅鐨勭被鍨嬪寘鍚:

E鈥斺旈敊璇

W鈥斺旇鍛

I鈥斺斾俊鎭

A鈥斺斿紓甯哥粓姝

S鈥斺旀垚鍔

浣跨敤娑堟伅瀹炰緥1:

TCODE:se38鍒涘缓娴嬭瘯绋嬪簭,缂栬緫浠g爜濡備笅

MESSAGE聽ID聽’ZLZY001′聽TYPE聽’I'聽NUMBER聽’001′.

鎻愮ず娑堟伅娓呭崟鈥淶LZY001″鈥001″娑堟伅鍐呭,娑堟伅鎻愮ず绫诲埆淇℃伅鈥.聽

鎴栬呯畝鍐欎负:

MESSAGE聽I001(ZLZY001).

OK,F8鎵ц鏁堟灉濡備笅:

瀹氫箟鐨凩ong Text鍙互閫氳繃鐐瑰嚮 鏌ョ湅:

浣跨敤娑堟伅瀹炰緥2-甯﹀弬鏁:

DATA:MSG1(20)聽TYPE聽C聽VALUE聽’鍙傛暟’.

DATA:MSG2(20)聽TYPE聽C聽VALUE聽’娑堟伅’.

DATA:MSG3(20)聽TYPE聽C聽VALUE聽’鎻愮ず’.

DATA:MSG4(20)聽TYPE聽C聽VALUE聽’娴嬭瘯’.

MESSAGE 聽I000(ZLZY001)聽 WITH 聽MSG1聽 MSG2 聽MSG3聽 MSG4.

F8鎵ц鏁堟灉:

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷ABAP绗叚澶-娑堟伅鐨勫畾涔夊拰浣跨敤

]]>
http://www.liaoyong.name/?feed=rss2&p=213 1
.NET涓洓绉嶅叧浜庢樉绀烘槦鏈熷嚑 http://www.liaoyong.name/?p=209 http://www.liaoyong.name/?p=209#comments Wed, 15 May 2013 14:41:10 +0000 Carey http://www.liaoyong.name/?p=209 绗竴绉嶆柟娉: DateTime.Now.GetDateTimeFormats('D')[2].ToString().Substring(0,3) 绗簩绉嶆柟娉: public string Week() { string[] weekdays ={ "鏄熸湡鏃" ,"鏄熸湡涓" ,"鏄熸湡浜" ,"鏄熸湡涓" ,"鏄熸湡鍥" ,"鏄熸湡浜" ,"鏄熸湡鍏" }; string week=weekdays[Convert.ToInt32(DateTime.Now.DayOfWeek)]; return week; } //Response.Write(Week()); 绗笁绉嶆柟娉: public string Week(string weekName) { string week; switch(weekName) { case "Sunday": week = "鏄熸湡鏃"; break; case "Monday": week = "鏄熸湡涓"; break; case "Tuesday": week = "鏄熸湡浜"; break; case "Wednesday": week = "鏄熸湡涓"; break; case "Thursday": week = "鏄熸湡鍥"; break; case "Friday": week = "鏄熸湡浜"; break; case "Saturday": week = "鏄熸湡浜"; break; return week; } } //Response.Write(Week(DateTime.Now.DayOfWeek)); 绗洓绉嶆柟娉: string CaculateWeekDay(int y,int m, int d) { if(m==1) {m=13;y--;} if(m==2) {m=14;y--;} int week=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1; string weekstr=""; switch(week) { case 1: weekstr="鏄熸湡涓"; break; case 2: weekstr="鏄熸湡浜"; break; case 3: weekstr="鏄熸湡涓"; break; case 4: weekstr="鏄熸湡鍥"; break; case 5: weekstr="鏄熸湡浜"; break; case 6: weekstr="鏄熸湡鍏"; break; case 7: weekstr="鏄熸湡鏃"; break; } return weekstr; }  ]]> 绗竴绉嶆柟娉: DateTime.Now.GetDateTimeFormats('D')[2].ToString().Substring(0,3) 绗簩绉嶆柟娉: public string Week() { string[] weekdays ={ "鏄熸湡鏃" ,"鏄熸湡涓" ,"鏄熸湡浜" ,"鏄熸湡涓" ,"鏄熸湡鍥" ,"鏄熸湡浜" ,"鏄熸湡鍏" }; string week=weekdays[Convert.ToInt32(DateTime.Now.DayOfWeek)]; return week; } //Response.Write(Week()); 绗笁绉嶆柟娉: public string Week(string weekName) { string week; switch(weekName) { case "Sunday": week = "鏄熸湡鏃"; break; case "Monday": week = "鏄熸湡涓"; break; case "Tuesday": week = "鏄熸湡浜"; break; case "Wednesday": week = "鏄熸湡涓"; break; case "Thursday": week = "鏄熸湡鍥"; break; case "Friday": week = "鏄熸湡浜"; break; case "Saturday": week = "鏄熸湡浜"; break; return week; } } //Response.Write(Week(DateTime.Now.DayOfWeek)); 绗洓绉嶆柟娉: string CaculateWeekDay(int y,int m, int d) { if(m==1) {m=13;y--;} if(m==2) {m=14;y--;} int week=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1; string weekstr=""; switch(week) { case 1: weekstr="鏄熸湡涓"; break; case 2: weekstr="鏄熸湡浜"; break; case 3: weekstr="鏄熸湡涓"; break; case 4: weekstr="鏄熸湡鍥"; break; case 5: weekstr="鏄熸湡浜"; break; case 6: weekstr="鏄熸湡鍏"; break; case 7: weekstr="鏄熸湡鏃"; break; } return weekstr; }

 

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷.NET涓洓绉嶅叧浜庢樉绀烘槦鏈熷嚑

]]>
http://www.liaoyong.name/?feed=rss2&p=209 0
DevExpress-GridControl鏁版嵁瀵煎嚭鍒癊XCEL http://www.liaoyong.name/?p=202 http://www.liaoyong.name/?p=202#comments Sun, 28 Apr 2013 07:53:27 +0000 Carey http://www.liaoyong.name/?p=202 SaveFileDialog fileDialog = new SaveFileDialog(); fileDialog.Filter = "Excel鏂囦欢娄*.xls;"; fileDialog.FileName = this.Text + DateTime.Now.ToString("yyMMddHHmm"); if (fileDialog.ShowDialog() == DialogResult.OK) { gridControl1.ExportToXls(fileDialog.FileName); XtraMessageBox.Show("鎿嶄綔鎴愬姛!", "鎿嶄綔鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } No.2:鐢ㄦ祦灏嗘暟鎹鍏XCEL.
#region 鐢ㄦ祦灏嗘暟鎹鍏ュ埌Excel涓
        public static void DataGridToExcel(DataTable dt, GridView dgv, string orderDateTime, string title)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.Filter = "Execl (*.xls)娄*.xls娄 Execl (*.xlsx)娄*.xlsx";
            saveFileDialog.FilterIndex = 0;
            saveFileDialog.RestoreDirectory = true;
            saveFileDialog.CreatePrompt = true;
            saveFileDialog.Title = "瀵煎嚭Excel鏂囦欢鍒";

            DateTime now = SystemManage.GetTimeNow();
            saveFileDialog.FileName = title + orderDateTime;

            DialogResult dr = saveFileDialog.ShowDialog();
            if (dr == DialogResult.Cancel)
                return;
            Stream myStream;

            myStream = saveFileDialog.OpenFile();
            string fileName = saveFileDialog.FileName;
            if (fileName == "")
            {

                XtraMessageBox.Show("璇疯緭鍏ユ枃浠跺悕!", "鎿嶄綔鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            StreamWriter sw = new StreamWriter(myStream, System.Text.Encoding.GetEncoding("gb2312"));
            string str = "";
            try
            {
                //鍐欐爣棰    
                string stc = title + orderDateTime;

                sw.WriteLine(stc);
                for (int i = 0; i <= dgv.Columns.Count; i++)
                {
                    if (i == 0)
                    {
                        str += "搴忓彿";
                    }
                    else
                    {
                        if (dgv.Columns[i - 1].Visible == true)
                        {
                            str += "\t";
                            str += dgv.Columns[i - 1].Caption;
                        }

                    }
                }

                sw.WriteLine(str);
                int count = 0;
                //鍐欏唴瀹  
                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    count++;
                    string tempStr = "";
                    for (int k = 0; k < dt.Columns.Count + 1; k++)
                    {
                        if (k == 0)
                        {
                            tempStr = count.ToString();
                        }
                        else
                        {
                            if (dgv.Columns[k - 1].Visible == true)
                            {
                                tempStr += "\t";
                                tempStr += dt.Rows[j][k - 1].ToString().Trim();

                            }
                        }

                    }
                    sw.WriteLine(tempStr);

                }
                sw.Close();
                sw.Dispose();
                myStream.Close();
                myStream.Dispose();

                XtraMessageBox.Show("鎿嶄綔鎴愬姛!", "鎿嶄綔鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            catch (Exception e)
            {

                XtraMessageBox.Show("鎿嶄綔澶辫触!", "鎿嶄綔鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            finally
            {
                sw.Close();
                myStream.Close();

            }
        }
        #endregion
OK,璋冪敤灏辩畝鍗曚簡: ClassName.DataGridToExcel(dt, gridView1, SystemManage.GetTimeNow().ToString("yyMMddHHmmss"), this.Text + "鎶ヨ〃");]]>
灏咲evExpress-GridControl鏁版嵁瀵煎嚭鍒癊XCEL,鐩墠鐢ㄨ繃涓ょ,涓涓哄埄鐢℅ridControl鍑芥暟鎿嶄綔,涓涓虹敤娴(IO)鎿嶄綔.鍖哄埆鍦ㄤ簬鍓嶈呭彲浠ュ皢浣犲湪GridControl鎵瑙佹牸寮忓叏閮ㄥ鍏XCEL,姣斿鏈夋椂鍊欐垜浠湪Bands閲岄潰鎷栨嫿鍑烘潵鐨凾itle鏍峰紡,鍚庤呮渶澶т紭鐐瑰湪浜庨熷害寰堝揩,浜叉祴10W鏉℃暟鎹鍑哄彧闇2绉掑乏鍙;

No.1:鐢℅ridControl鍑芥暟瀵煎嚭鏁版嵁鍒癊XCEL,寤鸿璁剧疆Options涓婳ptionsPrint—AutoWidth=False,浣垮鍑哄悗鍗曞厓鏍煎搴︽牴鎹唴瀹归暱搴﹁嚜鍔ㄨ皟鏁.

SaveFileDialog fileDialog = new SaveFileDialog();
            fileDialog.Filter = "Excel鏂囦欢娄*.xls;";
            fileDialog.FileName = this.Text + DateTime.Now.ToString("yyMMddHHmm");
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                gridControl1.ExportToXls(fileDialog.FileName);
                XtraMessageBox.Show("鎿嶄綔鎴愬姛!", "鎿嶄綔鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }

No.2:鐢ㄦ祦灏嗘暟鎹鍏XCEL.

#region 鐢ㄦ祦灏嗘暟鎹鍏ュ埌Excel涓
        public static void DataGridToExcel(DataTable dt, GridView dgv, string orderDateTime, string title)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.Filter = "Execl (*.xls)娄*.xls娄 Execl (*.xlsx)娄*.xlsx";
            saveFileDialog.FilterIndex = 0;
            saveFileDialog.RestoreDirectory = true;
            saveFileDialog.CreatePrompt = true;
            saveFileDialog.Title = "瀵煎嚭Excel鏂囦欢鍒";

            DateTime now = SystemManage.GetTimeNow();
            saveFileDialog.FileName = title + orderDateTime;

            DialogResult dr = saveFileDialog.ShowDialog();
            if (dr == DialogResult.Cancel)
                return;
            Stream myStream;

            myStream = saveFileDialog.OpenFile();
            string fileName = saveFileDialog.FileName;
            if (fileName == "")
            {

                XtraMessageBox.Show("璇疯緭鍏ユ枃浠跺悕!", "鎿嶄綔鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            StreamWriter sw = new StreamWriter(myStream, System.Text.Encoding.GetEncoding("gb2312"));
            string str = "";
            try
            {
                //鍐欐爣棰
                string stc = title + orderDateTime;

                sw.WriteLine(stc);
                for (int i = 0; i <= dgv.Columns.Count; i++)
                {
                    if (i == 0)
                    {
                        str += "搴忓彿";
                    }
                    else
                    {
                        if (dgv.Columns[i - 1].Visible == true)
                        {
                            str += "\t";
                            str += dgv.Columns[i - 1].Caption;
                        }

                    }
                }

                sw.WriteLine(str);
                int count = 0;
                //鍐欏唴瀹
                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    count++;
                    string tempStr = "";
                    for (int k = 0; k < dt.Columns.Count + 1; k++)
                    {
                        if (k == 0)
                        {
                            tempStr = count.ToString();
                        }
                        else
                        {
                            if (dgv.Columns[k - 1].Visible == true)
                            {
                                tempStr += "\t";
                                tempStr += dt.Rows[j][k - 1].ToString().Trim();

                            }
                        }

                    }
                    sw.WriteLine(tempStr);

                }
                sw.Close();
                sw.Dispose();
                myStream.Close();
                myStream.Dispose();

                XtraMessageBox.Show("鎿嶄綔鎴愬姛!", "鎿嶄綔鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            catch (Exception e)
            {

                XtraMessageBox.Show("鎿嶄綔澶辫触!", "鎿嶄綔鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            finally
            {
                sw.Close();
                myStream.Close();

            }
        }
        #endregion

OK,璋冪敤灏辩畝鍗曚簡:

ClassName.DataGridToExcel(dt, gridView1, SystemManage.GetTimeNow().ToString(鈥測yMMddHHmmss鈥), this.Text + 鈥滄姤琛ㄢ);

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷DevExpress-GridControl鏁版嵁瀵煎嚭鍒癊XCEL

]]>
http://www.liaoyong.name/?feed=rss2&p=202 4
DevExpress鎺т欢涔婲avBarControl鐏垫椿浣跨敤 http://www.liaoyong.name/?p=193 http://www.liaoyong.name/?p=193#comments Fri, 26 Apr 2013 07:11:14 +0000 Carey http://www.liaoyong.name/?p=193

聽 鍦ㄤ娇鐢∟avBarControl鍔ㄦ佺敓鎴愬鑸彍鍗曟椂浣跨敤鐨勫叧閿〃涓哄姛鑳借〃(_systemFunction),姝よ〃瀛楁璇存槑濡備笅:

绋嬪簭鍏抽敭浠g爜濡備笅:

	/// <summary>
	/// 鍔犺浇瀵艰埅鑿滃崟 
	/// </summary>
	/// <returns>鎴愬姛/澶辫触</returns>
	private boolSystemFunctionLoad() 
	{ 
	    DataTabledat=new DataTable(); 
	    if (AccountInfo._Us_Role==1) 
	    { 
	        //濡傛灉涓虹鐞嗗憳 
	        dat = SystemManage.GetAllSystemFunction();//鏌ヨ鎵鏈夊姛鑳借彍鍗 
	    } 
	    else
	    { 
	        dat = SystemManage.GetAllSystemFunction(AccountInfo._Us_Role);//鏍规嵁瑙掕壊ID鏌ヨ鐩稿叧鍔熻兘鏁版嵁闆嗗悎 
	    } 
	    if (dat != null &&dat.Rows.Count> 0) 
	    { 
	        NavBarGroupnbg = null; 
	        NavBarItem item = null; 
	        for (int i = 0; i <dat.Rows.Count; i++) 
	        { 
	            if (dat.Rows[i]["levels"].ToString() == "0") 
	            { 
	                //鐖剁骇鑿滃崟 
	                nbg = new NavBarGroup(); 
	                nbg.Caption = dat.Rows[i]["funcName"].ToString(); 
	                navBarControl1.Groups.Add(nbg); 
	            } 
	            else
	            { 
	                //瀛愮骇鑿滃崟 
	                item = new NavBarItem(); 
	                item.Caption = dat.Rows[i]["funcName"].ToString();//鑿滃崟鍚嶇О 
	                item.Name = dat.Rows[i]["formName"].ToString();//绐椾綋璺緞 
	                item.Hint = dat.Rows[i]["showType"].ToString();//鎵撳紑妯″紡 
	                item.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(Item_Click);//璧嬩簣鍗曞嚮浜嬩欢 
	                nbg.ItemLinks.Add(item); 
	            } 
	        } 
	        return true; 
	    } 
	    else
	        return false; 
	}
鑿滃崟鍗曞嚮浜嬩欢:
	/// <summary>
	/// 鑿滃崟鍗曞嚮浜嬩欢 
	/// </summary>
	/// <param name="sender"></param>
	/// <param name="e"></param>
	private void Item_Click(object sender, EventArgs e) 
	{ 
	    NavBarItemsd = sender as NavBarItem; 
	    if (sd.Name.Contains("."))//鏍规嵁琛⊿ystemFunction-瀛楁formName纭畾鏄惁鐐瑰嚮鐨勪负鍔熻兘鑿滃崟 
	    { 
	        try
	        { 
	            groupControl1.Visible = false; 
	            System.Reflection.AssemblytempAssembly = System.Reflection.Assembly.GetExecutingAssembly();//鑾峰彇鍖呭惈褰撳墠鎵ц鐨勪唬鐮佺殑绋嬪簭闆 
	            XtraFormfm = (XtraForm)(tempAssembly.CreateInstance(sd.Name)); //鍙嶅皠鏈哄埗鎵惧埌鎸囧畾鍚嶇О鐨勭被鍨嬪苟浣跨敤绯荤粺婵娲诲櫒鍒涘缓瀹冪殑瀹炰緥 
	            if (fm != null) 
	            { 
	                fm.AccessibleName = sd.Hint; 
	                fm.Text = sd.Caption; 
	                CreateChildForm(fm);//鎵撳紑绐椾綋 
	            } 
	            else
	            { 
	                XtraMessageBox.Show("绐楀彛鏁版嵁閰嶇疆閿欒,璇疯仈绯荤郴缁熺鐞嗗憳锛", "绯荤粺鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Information); 
	            } 
	        } 
	        catch (Exception) 
	        { 
	        } 
	    } 
	}
鎵撳紑绐椾綋鐢ㄥ埌鐨勬槸xtraTabbedMdiManager鎺т欢,璇ョ┖闂村厑璁稿悓鏃舵墦寮澶氫釜瀛愮獥浣,浣犻渶瑕佸仛鐨勫氨鏄嫋涓婁竴涓鎺т欢鍒拌璁$獥浣,鐒跺悗鍦ㄧ獥浣撳姞杞戒簨浠朵腑鍔犲叆xtraTabbedMdiManager1.MdiParent = this;鍗冲彲.
	/// <summary>

	        /// 鎵撳紑绐椾綋 

	        /// </summary>

	        /// <param name="ChildForm"></param>

	        /// <returns></returns>

	        public static Form CreateChildForm(XtraFormChildForm) 

	        { 

	            foreach (Form frm in mf.MdiChildren) 

	            { 

	                if (ChildForm.Text == frm.Text) 

                { 

	                    ChildForm.Close(); 

	                    ChildForm.Dispose(); 

	                    frm.Activate(); 

	                    return frm; 

	                } 

            } 

	            if (ChildForm.AccessibleName == "Show") 

	            { 

	                ChildForm.MdiParent = mf; 

	                ChildForm.Show(); 

	            } 

	            else

	            { 

	                ChildForm.MaximizeBox = false;//绂佺敤鏈澶у寲             

	                ChildForm.ShowIcon = false;//绂佺敤鍥炬爣 

                ChildForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;//绐椾綋杈规鏍峰紡 

	                ChildForm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;//绐椾綋鍦ㄤ腑闂翠綅缃墦寮 

	                ChildForm.ShowInTaskbar = false;//涓嶅湪浠诲姟鏍忔樉绀 

	                ChildForm.ShowDialog();//浠ユā寮忕獥浣撴墦寮 

            } 

	            return ChildForm; 

	        }
鏈鍚庡啀闄勫姞涓娈靛姛鑳藉寮轰唬鐮,瀹炵幇褰撳悓鏃舵墦寮澶氫釜瀛愮獥浣撴椂鍙屽嚮page鏍囩鍏抽棴绐椾綋鐨勬晥鏋.
	private void xtraTabbedMdiManager1_MouseDown(object sender, MouseEventArgs e) 
	        { 
            if (e.Button == MouseButtons.Left) 
            { 
	                DateTimedt = DateTime.Now; 
	                TimeSpan span = dt.Subtract(m_LastClick); 
	                if (span.TotalMilliseconds< 300)  //濡傛灉涓ゆ鐐瑰嚮鐨勬椂闂撮棿闅斿皬浜300姣锛屽垯璁や负鏄弻鍑 
	                { 
	                    if (this.MdiChildren.Length> 1) 
	                    { 
                        this.ActiveMdiChild.Close(); 
                   } 
	                    m_LastClick = dt.AddMinutes(-1); 
	                } 
	                else
	                    m_LastClick = dt; 
	            } 
	        }
鍙﹀鐨勫叕鍏辫彍鍗曡濡備慨鏀瑰瘑鐮,閫鍑虹郴缁,鏇存崲鐨偆绛夊姛鑳藉彲浠ョ敤浠g爜鐩存帴鍒涘缓,涔熷彲鍦ㄨ璁$晫闈㈠垱寤. ]]>
鏈枃涓昏灞曠ずCarey鍦–/S缁撴瀯涓嬩娇鐢―evExpress鎺т欢瀵规潈闄愮殑鎺у埗鍙婂鐞嗘柟娉.鍔熻兘瀵艰埅鑿滃崟浣跨敤鐨勬槸NavBarControl.姝ょ鍋氭硶鎼缓涓娆,浠ュ悗涓皬鍨嬮」鐩嵆鍙噸澶嶄娇鐢,涓斿鏉冮檺鐨勬帶鍒,鏇存敼,涓氬姟闇姹傚彉鏇寸瓑閮藉叿鏈夎緝寮虹殑鐏垫椿鎬.

PS:Q缇#DevExpress鎶鏈氦娴 缇ゅ彿:160257101 娆㈣繋鍚勪綅DevExpress鐢ㄦ埛杩涚兢瀛︿範涓庝氦娴.

鍦ㄦ潈闄愭帶鍒舵柟闈㈠簲鐢ㄦ瘮杈冪畝鍗曚笖娴佽鐨勪簲琛ㄦ潈闄愮粨鏋,鍗砤,鐢ㄦ埛琛(_sysEmployee)b,瑙掕壊琛(_sysRoles)c,鍔熻兘琛(_systemFunction),d鐢ㄦ埛瀵硅鑹茶〃(_sysUser_Role),e瑙掕壊瀵瑰姛鑳借〃(_sysRole_Popedom),鍏崇郴鍥惧涓.

聽 鍦ㄤ娇鐢∟avBarControl鍔ㄦ佺敓鎴愬鑸彍鍗曟椂浣跨敤鐨勫叧閿〃涓哄姛鑳借〃(_systemFunction),姝よ〃瀛楁璇存槑濡備笅:

绋嬪簭鍏抽敭浠g爜濡備笅:

	/// <summary>
	/// 鍔犺浇瀵艰埅鑿滃崟
	/// </summary>
	/// <returns>鎴愬姛/澶辫触</returns>
	private boolSystemFunctionLoad()
	{
	    DataTabledat=new DataTable();
	    if (AccountInfo._Us_Role==1)
	    {
	        //濡傛灉涓虹鐞嗗憳
	        dat = SystemManage.GetAllSystemFunction();//鏌ヨ鎵鏈夊姛鑳借彍鍗
	    }
	    else
	    {
	        dat = SystemManage.GetAllSystemFunction(AccountInfo._Us_Role);//鏍规嵁瑙掕壊ID鏌ヨ鐩稿叧鍔熻兘鏁版嵁闆嗗悎
	    }
	    if (dat != null &&dat.Rows.Count> 0)
	    {
	        NavBarGroupnbg = null;
	        NavBarItem item = null;
	        for (int i = 0; i <dat.Rows.Count; i++)
	        {
	            if (dat.Rows[i]["levels"].ToString() == "0")
	            {
	                //鐖剁骇鑿滃崟
	                nbg = new NavBarGroup();
	                nbg.Caption = dat.Rows[i]["funcName"].ToString();
	                navBarControl1.Groups.Add(nbg);
	            }
	            else
	            {
	                //瀛愮骇鑿滃崟
	                item = new NavBarItem();
	                item.Caption = dat.Rows[i]["funcName"].ToString();//鑿滃崟鍚嶇О
	                item.Name = dat.Rows[i]["formName"].ToString();//绐椾綋璺緞
	                item.Hint = dat.Rows[i]["showType"].ToString();//鎵撳紑妯″紡
	                item.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(Item_Click);//璧嬩簣鍗曞嚮浜嬩欢
	                nbg.ItemLinks.Add(item);
	            }
	        }
	        return true;
	    }
	    else
	        return false;
	}

鑿滃崟鍗曞嚮浜嬩欢:

	/// <summary>
	/// 鑿滃崟鍗曞嚮浜嬩欢
	/// </summary>
	/// <param name="sender"></param>
	/// <param name="e"></param>
	private void Item_Click(object sender, EventArgs e)
	{
	    NavBarItemsd = sender as NavBarItem;
	    if (sd.Name.Contains("."))//鏍规嵁琛⊿ystemFunction-瀛楁formName纭畾鏄惁鐐瑰嚮鐨勪负鍔熻兘鑿滃崟
	    {
	        try
	        {
	            groupControl1.Visible = false;
	            System.Reflection.AssemblytempAssembly = System.Reflection.Assembly.GetExecutingAssembly();//鑾峰彇鍖呭惈褰撳墠鎵ц鐨勪唬鐮佺殑绋嬪簭闆
	            XtraFormfm = (XtraForm)(tempAssembly.CreateInstance(sd.Name)); //鍙嶅皠鏈哄埗鎵惧埌鎸囧畾鍚嶇О鐨勭被鍨嬪苟浣跨敤绯荤粺婵娲诲櫒鍒涘缓瀹冪殑瀹炰緥
	            if (fm != null)
	            {
	                fm.AccessibleName = sd.Hint;
	                fm.Text = sd.Caption;
	                CreateChildForm(fm);//鎵撳紑绐椾綋
	            }
	            else
	            {
	                XtraMessageBox.Show("绐楀彛鏁版嵁閰嶇疆閿欒,璇疯仈绯荤郴缁熺鐞嗗憳锛", "绯荤粺鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Information);
	            }
	        }
	        catch (Exception)
	        {
	        }
	    }
	}

鎵撳紑绐椾綋鐢ㄥ埌鐨勬槸xtraTabbedMdiManager鎺т欢,璇ョ┖闂村厑璁稿悓鏃舵墦寮澶氫釜瀛愮獥浣,浣犻渶瑕佸仛鐨勫氨鏄嫋涓婁竴涓鎺т欢鍒拌璁$獥浣,鐒跺悗鍦ㄧ獥浣撳姞杞戒簨浠朵腑鍔犲叆xtraTabbedMdiManager1.MdiParent = this;鍗冲彲.

	/// <summary>

	        /// 鎵撳紑绐椾綋 

	        /// </summary>

	        /// <param name="ChildForm"></param>

	        /// <returns></returns>

	        public static Form CreateChildForm(XtraFormChildForm) 

	        { 

	            foreach (Form frm in mf.MdiChildren) 

	            { 

	                if (ChildForm.Text == frm.Text) 

                { 

	                    ChildForm.Close(); 

	                    ChildForm.Dispose(); 

	                    frm.Activate(); 

	                    return frm; 

	                } 

            } 

	            if (ChildForm.AccessibleName == "Show") 

	            { 

	                ChildForm.MdiParent = mf; 

	                ChildForm.Show(); 

	            } 

	            else

	            { 

	                ChildForm.MaximizeBox = false;//绂佺敤鏈澶у寲             

	                ChildForm.ShowIcon = false;//绂佺敤鍥炬爣 

                ChildForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;//绐椾綋杈规鏍峰紡 

	                ChildForm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;//绐椾綋鍦ㄤ腑闂翠綅缃墦寮 

	                ChildForm.ShowInTaskbar = false;//涓嶅湪浠诲姟鏍忔樉绀 

	                ChildForm.ShowDialog();//浠ユā寮忕獥浣撴墦寮 

            } 

	            return ChildForm; 

	        }

鏈鍚庡啀闄勫姞涓娈靛姛鑳藉寮轰唬鐮,瀹炵幇褰撳悓鏃舵墦寮澶氫釜瀛愮獥浣撴椂鍙屽嚮page鏍囩鍏抽棴绐椾綋鐨勬晥鏋.

	private void xtraTabbedMdiManager1_MouseDown(object sender, MouseEventArgs e)
	        {
            if (e.Button == MouseButtons.Left)
            {
	                DateTimedt = DateTime.Now;
	                TimeSpan span = dt.Subtract(m_LastClick);
	                if (span.TotalMilliseconds< 300)  //濡傛灉涓ゆ鐐瑰嚮鐨勬椂闂撮棿闅斿皬浜300姣锛屽垯璁や负鏄弻鍑
	                {
	                    if (this.MdiChildren.Length> 1)
	                    {
                        this.ActiveMdiChild.Close();
                   }
	                    m_LastClick = dt.AddMinutes(-1);
	                }
	                else
	                    m_LastClick = dt;
	            }
	        }

鍙﹀鐨勫叕鍏辫彍鍗曡濡備慨鏀瑰瘑鐮,閫鍑虹郴缁,鏇存崲鐨偆绛夊姛鑳藉彲浠ョ敤浠g爜鐩存帴鍒涘缓,涔熷彲鍦ㄨ璁$晫闈㈠垱寤.

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷DevExpress鎺т欢涔婲avBarControl鐏垫椿浣跨敤

]]>
http://www.liaoyong.name/?feed=rss2&p=193 2
鑷畾涔夊紓甯告崟鑾锋満鍒,璁╃▼搴忔紡娲炴棤澶勫彲閬 http://www.liaoyong.name/?p=190 http://www.liaoyong.name/?p=190#comments Fri, 26 Apr 2013 02:51:56 +0000 Carey http://www.liaoyong.name/?p=190 public class CustomExceptionHandler { public CustomExceptionHandler() { Application.ThreadException += new ThreadExceptionEventHandler(this.OnThreadException); } private void OnThreadException(object sender, ThreadExceptionEventArgs args) { try { string errorMsg = "绋嬪簭杩愯杩囩▼涓彂鐢熼敊璇,閿欒淇℃伅濡備笅:\n"; errorMsg += args.Exception.Message; errorMsg += "\n鍙戠敓閿欒鐨勭▼搴忛泦涓:"; errorMsg += args.Exception.Source; errorMsg += "\n鍙戠敓閿欒鐨勫叿浣撲綅缃负:\n"; errorMsg += args.Exception.StackTrace; writeLog(errorMsg); XtraMessageBox.Show("绯荤粺杩愯鏃跺彂鐢熸湭鐭ラ敊璇紒璇烽噸鏂板惎鍔ㄧ郴缁", "绯荤粺鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } catch(Exception ex) { writeLog(ex.Message.ToString()); XtraMessageBox.Show("绯荤粺杩愯鏃跺彂鐢熸湭鐭ラ敊璇紒璇烽噸鏂板惎鍔ㄧ郴缁", "绯荤粺鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } } /// <summary> /// 鍐欐枃浠 /// </summary> /// <param name="str"></param> static void writeLog(string str) { if (!Directory.Exists("ErrLog")) { Directory.CreateDirectory("ErrLog"); } using (StreamWriter sw = new StreamWriter(@"ErrLog\ErrLog.txt", true)) { sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); sw.WriteLine(str); sw.WriteLine("------------------------------------------------------------------------------------"); sw.Close(); } } }   鏂板浠ヤ笂寮傚父鎹曡幏绫诲悗鍒繕浜嗗湪绋嬪簭鍏ュ彛鐐瑰惎鍔ㄥ畠:
CustomExceptionHandler cef = new CustomExceptionHandler();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new LoginForm());
   ]]>
鍦╟oding杩囩▼涓伐绋嬪笀浠(濂藉惂,绋嬪簭鐚)鍏嶄笉浜嗗湪鍊煎緱灏忓績缈肩考鐨勫湴鏂箃ry catch涓涓,浣嗗湪杞欢涓栫晫鎬诲厤涓嶄簡寰堝鐏靛紓浜嬩欢,浣犱笉鐭ラ亾浠涔堟椂鍊欏洜涓轰粈涔堝氨缁欎綘宕╂簝涓涓,鎴栬鏄唬鐮佹湰韬‘瀹炴湁闂,鎴栬鏄汉鍝侀棶棰樼瓑绛.

宕╂簝浜嗘庝箞鍔,鎬庝箞澶勭悊.涓嶅Θ缁欑▼搴忓姞涓涓叏澶╁欑殑寮傚父鎹曡幏鏈哄埗,璁╃▼搴忔紡娲炴棤澶勫彲閬佸惂!

 

public class CustomExceptionHandler
    {
        public CustomExceptionHandler()
        {
            Application.ThreadException += new ThreadExceptionEventHandler(this.OnThreadException);
        }
        private void OnThreadException(object sender, ThreadExceptionEventArgs args)
        {
            try
            {
                string errorMsg = "绋嬪簭杩愯杩囩▼涓彂鐢熼敊璇,閿欒淇℃伅濡備笅:\n";
                errorMsg += args.Exception.Message;
                errorMsg += "\n鍙戠敓閿欒鐨勭▼搴忛泦涓:";
                errorMsg += args.Exception.Source;
                errorMsg += "\n鍙戠敓閿欒鐨勫叿浣撲綅缃负:\n";
                errorMsg += args.Exception.StackTrace;
                writeLog(errorMsg);
                XtraMessageBox.Show("绯荤粺杩愯鏃跺彂鐢熸湭鐭ラ敊璇紒璇烽噸鏂板惎鍔ㄧ郴缁", "绯荤粺鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }
            catch(Exception ex)
            {
                writeLog(ex.Message.ToString());
                XtraMessageBox.Show("绯荤粺杩愯鏃跺彂鐢熸湭鐭ラ敊璇紒璇烽噸鏂板惎鍔ㄧ郴缁", "绯荤粺鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }
        }

        /// <summary>
        /// 鍐欐枃浠
        /// </summary>
        /// <param name="str"></param>
        static void writeLog(string str)
        {
            if (!Directory.Exists("ErrLog"))
            {
                Directory.CreateDirectory("ErrLog");
            }

            using (StreamWriter sw = new StreamWriter(@"ErrLog\ErrLog.txt", true))
            {
                sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                sw.WriteLine(str);
                sw.WriteLine("------------------------------------------------------------------------------------");
                sw.Close();
            }
        }

    }

 

鏂板浠ヤ笂寮傚父鎹曡幏绫诲悗鍒繕浜嗗湪绋嬪簭鍏ュ彛鐐瑰惎鍔ㄥ畠:

CustomExceptionHandler cef = new CustomExceptionHandler();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new LoginForm());

 

 

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷鑷畾涔夊紓甯告崟鑾锋満鍒,璁╃▼搴忔紡娲炴棤澶勫彲閬

]]>
http://www.liaoyong.name/?feed=rss2&p=190 0
DevExpress鎺т欢-GridControl鏍规嵁鏉′欢鏀瑰彉鍗曞厓鏍/琛岄鑹 http://www.liaoyong.name/?p=183 http://www.liaoyong.name/?p=183#comments Fri, 19 Apr 2013 08:25:35 +0000 Carey http://www.liaoyong.name/?p=183

 ]]>
DevExpress鎺т欢-鏁版嵁鎺т欢GridControl,鏈夋椂鎴戜滑闇瑕佹牴鎹壒瀹氭潯浠舵敼鍙樼鍚堟潯浠剁殑琛屾垨鑰呭崟鍏冩牸棰滆壊杈惧埌绐佸嚭鏄剧ず鐩殑,鐜板湪鍔ㄨ捣榧犳爣璺熸垜涓璧锋搷浣滃惂,瀵圭殑,瑕佽揪鍒拌繖涓洰鐨勬偍鐢氳嚦閮戒笉鐢ㄥ姩閿洏.

鍦ㄥGridControl缁戝畾濂芥暟鎹悗:

No.1:鍙抽敭GridControl閫夋嫨Run Designer;

No.2:Appearance涓婼tyle Conditions鐐瑰嚮Add,闇瑕佹敞鎰忕殑鏄瘡涓涓彉鑹叉潯浠堕兘寰桝dd涓涓彉鑹叉柟妗;

No.3:鍦≒roperties涓渶瑕佺敤鍒扮殑灞炴т緷娆″線涓嬭瑙d负:

a)Appearance涓婤ackColor=255.255.128,BackColor2=255.255.128,姝ら」鎸囧畾绗﹀悎鐗瑰畾鏉′欢鏃跺崟鍏冩牸/琛岃儗鏅鑹,濡傛灉涓ら」璁剧疆棰滆壊涓嶅悓鏃跺垯涓烘笎鍙樻晥鏋;

b)ApplyToRow=false鏃剁鍚堢壒瀹氭潯浠舵椂鍙敼鍙樺崟鍏冩牸鑳屾櫙棰滆壊,ApplyToRow=true鍒欑鍚堢壒瀹氭潯浠舵椂鏀瑰彉鏁磋鑳屾櫙棰滆壊;

c)Column=[閫夋嫨鍖归厤鏉′欢鐨勫垪]

d)Condition鏉′欢灞炴:Equal=鐩稿悓,NotEqual=涓嶇瓑浜,Between=鍖洪棿,NotBetween=鑼冨洿澶,Less=灏忎簬,Greater=澶т簬,GreaterOrEquel澶т簬鎴栫瓑浜,LessOrEqual=灏忎簬鎴栫瓑浜

e)value1鍜寁alue2:褰撴潯浠跺睘鎬т负Between鎴栬匩otBetween鏄渶瑕佸悓鏃惰缃畍alue1鍜寁alue2,鎰忎负Between value1 and value2;鍏朵綑灞炴ч兘鍙敤璁剧疆value1鍗冲彲;鍗虫寚瀹氭潯浠剁殑鍊;

鍙﹂檮鍥捐В,涓嬪浘璁剧疆鏃负(褰撳勾榫凙ge婊¤冻13鍒18涔嬮棿鏃惰鏁磋閮藉彉涓洪粍鑹):

 

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷DevExpress鎺т欢-GridControl鏍规嵁鏉′欢鏀瑰彉鍗曞厓鏍/琛岄鑹

]]>
http://www.liaoyong.name/?feed=rss2&p=183 0
ABAP绗簲澶-鍒涘缓鍜屽鐞嗗唴琛ㄥ疄鎴樼瘒涔嬪垱寤哄唴琛 http://www.liaoyong.name/?p=160 http://www.liaoyong.name/?p=160#comments Tue, 20 Nov 2012 08:07:42 +0000 Carey http://www.liaoyong.name/?p=160 NO.5鍒涘缓鍜屽鐞嗗唴琛ㄥ疄鎴樼瘒 鍒涘缓鍐呰〃鏁版嵁绫诲瀷 鍒涘缓鍐呰〃鏁版嵁绫诲瀷浣跨敤TYPES璇彞,璇硶: TYPES聽 <t>聽 <type>聽 OCCURS聽 <n>. 璇ヨ鍙ョ畝鍗曟潵璁插氨鏄鍛婁竴涓暟缁<t>,褰㈡佷负<type>,闀垮害涓<n>.OCCURS閫夐」琛ㄧず鎸囧畾鍐呭瓨,PCCURS<n>,<n>涓烘寚瀹氱殑琛屽彿,灏嗙涓琛屽啓鍏ュ垱寤虹殑鍐呰〃鍚,灏变负鎸囧畾琛屼繚鐣欎簡鍐呭瓨.濡傛灉娣诲姞鍒板唴琛ㄤ腑鐨勮姣<n>,鍒欒嚜鍔ㄦ墿灞曚繚鐣欑殑鍐呭瓨.濡傛灉鍐呭瓨涓病鏈夎冻澶熺┖闂村彲鐢ㄤ簬鍐呰〃,鍒欏皢鍏跺啓鍏ョ紦鍐插尯鎴栫鐩. 瀹炰緥:
  • 脴聽 types聽vector聽type聽i聽occurs聽10.
鍒涘缓鍐呰〃vector,鍒跺畾琛屾暟涓10,鍏惰鍖呭惈鍩烘湰绫诲瀷I瀛楁.
  • 聽 types:聽begin聽of聽line, column1聽type聽i, column2聽type聽i, column3聽type聽i, end聽of聽line. TYPES聽itab聽TYPE聽line聽OCCURS聽10.
鍒涘缓鍐呰〃itab,鎸囧畾琛屾暟涓10,鍏惰涓庡瓧娈典覆LINE缁撴瀯鐩稿悓.
  • 聽 types聽vector聽type聽i聽occurs聽10. types:聽begin聽of聽line, column1聽type聽i, column2聽type聽i, column3聽type聽i, end聽of聽line. TYPES聽itab聽TYPE聽line聽OCCURS聽10. types:聽begin聽of聽deepline, table1聽type聽vector, table2聽type聽itab, end聽of聽deepline. types聽deeptable聽type聽deepline聽occurs聽10.
棣栧厛鍒涘缓鍐呰〃鏁版嵁绫诲瀷vectoritab,鐒跺悗鍒涘缓鏁版嵁绫诲瀷deepline浣滀负瀛楁涓蹭笖鍖呭惈杩欎簺鍐呰〃浣滀负缁勪欢.閫氳繃璇ュ瓧娈典覆鍒涘缓鍐呰〃deeptable,鎸囧畾琛屾暟涓10.鍙湅鍑鸿鍐呰〃鐨勫厓绱犳湰韬氨鏄唴琛(vectoritab). 鍒涘缓鍐呰〃鏁版嵁瀵硅薄 鍒涘缓鍐呰〃鏁版嵁瀵硅薄鏈夊嚑绉嶆柟寮:
  • 閫氳繃寮曠敤鍙︿竴涓〃鏍兼潵鍒涘缓鍐呰〃
璇硶: DATA聽 <f>聽 <type>聽 [WITH聽 HEADER聽 LINE]. 鍙互浣跨敤TYPELIKE鏉ュ紩鐢ㄨ〃鏍兼暟鎹被鍨嬫垨琛ㄦ牸鏁版嵁瀵硅薄.濡傛灉鎯冲垱寤哄甫琛ㄥご琛岀殑鍐呰〃,琛岀被鍨嬩笉鑳界洿鎺ユ槸鍐呰〃,浣嗗彲浠ユ槸鐢ㄥ唴琛ㄤ綔涓虹粍浠剁殑缁撴瀯. PS:鍐呰〃甯﹁〃澶村拰涓嶅甫琛ㄥご鐨勫尯鍒: 濡傛灉甯︽湁琛ㄥご,瀵逛簬浠g爜鐨勪功鍐欒捣鏉ュ氨寰堢畝渚夸簡,浣嗘槸浣跨敤甯﹁〃澶寸殑鍐呰〃瀹规槗鍦ㄧ紪鍐欑▼搴忔椂鍑洪敊,骞堕檷浣庡彲璇绘,鍥犱负濡傛灉甯︽湁琛ㄥご琛鈥漈_TAB鈥,绋嬪簭閲鈥漈_TAB鈥浠h〃涓ょ鎰忔,涓涓哄唴琛T_TAB,浜屾槸鍐呰〃鐨勮〃澶磋T_TAB,鍙﹀鍦ㄥ鍐呴儴琛ㄨ繘琛屽垵濮嬪寲,娓呯┖鏃,甯︽湁琛ㄥご鐨勫唴閮ㄨ〃鍔犲叆鐩存帴鍐鈥滳LEAR T_TAB鈥,杩欐牱琚竻鐨勬槸T_TAB鐨勮〃澶磋,鑰屼笉鏄唴閮ㄨ〃,杩欐牱缂栬瘧浼氶氳繃,浣嗙▼搴忛昏緫灏遍敊浜.寤鸿浣跨敤鏍囧噯鐨勫唴閮ㄨ〃(涓嶅甫琛ㄥご鐨勫唴琛). 瀹炰緥: TYPES:聽BEGIN聽OF聽line, column1聽TYPE聽i, column2聽TYPE聽i, column3聽TYPE聽i, END聽OF聽line. TYPES聽itab聽TYPE聽line聽OCCURS聽10. DATA聽tab1聽TYPE聽itab. DATA聽tab2聽LIKE聽tab1聽WITH聽HEADER聽LINE. 姝ゅ疄渚嬪垱寤烘暟鎹被鍨婭TAB浣滀负鍐呰〃,閫氳繃浣跨敤DATA璇彞鐨凾YPE鍙傛暟寮曠敤ITAB,浣挎暟鎹璞AB1涓嶪TAB缁撴瀯鐩稿悓.閫氳繃浣跨敤DATA璇彞鐨凩IKE鍙傛暟寮曠敤TAB1,浣挎暟鎹璞AB2缁撴灉鐩稿悓.鍒涘缓鐨凾AB2甯﹁〃澶磋,鍥犳鍙湪绋嬪簭涓娇鐢═AB2-COLUMN1/TAB2-COLUMN2鍜孴AB2-COLUMN3绛夊畾浣嶈〃鏍煎伐浣滃尯鍩烼AB2.
  • 閫氳繃寮曠敤缁撴瀯鏉ュ垱寤哄唴琛
璇硶: DATA聽 <f>聽 <type>聽 OCCURS聽 <n>聽 [WITH 聽HEADER聽 LINE]. 閫氳繃浣跨敤DATA璇彞鐨OCCURS閫夐」鍒涘缓鍐呰〃<f>.鍐呰〃涓鐨勬暟鎹被鍨嬪湪<type>涓寚瀹.瑕佹寚瀹氭暟鎹被鍨,鍙互浣跨敤TYPELIKE鍙傛暟. 瀹炰緥1: DATA聽 FLIGHT_TAB 聽LIKE 聽SFLIGHT 聽OCCURS 聽10. 璇ュ疄渚嬪垱寤烘暟鎹璞LIGHT_TAB,鍏剁粨鏋勪笌鏁版嵁搴撹〃鏍糞FLIGHT鐩稿悓. 瀹炰緥2: TYPES 聽VECTOR_TYPE 聽TYPE 聽I聽 OCCURS 聽10. DATA 聽VECTOR聽 TYPE 聽VECTOR_TYPE 聽WITH 聽HEADER 聽LINE. 瀹炰緥2鍏堝垱寤轰竴涓唴琛ㄦ暟鎹被鍨媀ECTOR_TYPE,鍏惰鍖呭惈棣栧厛鍒涘缓鐨勫熀鏈被鍨婭瀛楁.鐒跺悗閫氳繃寮曠敤VECTOR_TYPE鍒涘缓鏁版嵁瀵硅薄VECTOR.閫氳繃浣跨敤WITH HEADER LINE閫夐」鍒涘缓琛ㄦ牸宸ヤ綔鍖哄煙VECTOR,璇ヨ〃鏍煎伐浣滃尯鍩熷寘鍚竴绉嶇被鍨婭瀛楁,鍙互閫氳繃鍚嶇ОVECTOR瀹氫綅. 瀹炰緥3: DATA聽 VECTOR聽 TYPE 聽I 聽OCCURS 聽10 聽WITH 聽HEADER 聽LINE. 姝ゆ浠g爜閫氳繃鐩存帴鍦―ATA璇彞涓娇鐢∣CCURS閫夐」鍒涘缓鍜屽疄渚2涓畬鍏ㄤ竴鏍风殑鏁版嵁绫诲瀷VECTOR.
  • 鍒涘缓甯︽柊缁撴瀯鐨勫唴琛
璇硶: DATA: BEGIN OF <f> OCCURS <n>, <component declaration>, ...... END OF <f>. 姝ゆ瀹氫箟鍐呰〃<f>骞跺湪<component declaration>涓鏄庡叾琛岀粍浠.鍏朵綔鐢ㄤ笌鍏堝垱寤哄瓧娈典覆<f>,鐒跺悗鍐嶅垱寤轰笌璇ュ瓧娈典覆琛岀粨鏋勭浉鍚岀殑鍐呰〃<f>鐩稿悓. 瀹炰緥: DATA:聽BEGIN聽OF聽itab聽OCCURS聽10, column1聽TYPE聽i, column2聽TYPE聽i, column2聽TYPE聽i, END聽OF聽itab. 璇ュ疄渚嬪垱寤哄唴琛ㄥ強鍏剁浉搴旂殑琛ㄦ牸宸ヤ綔鍖哄煙ITAB.    ]]>
璺濅笂娆℃洿鏂板凡缁14澶╀簡,鏃跺厜椋為濆晩鍟婂晩鍟.but杩10鏉ュぉ杩囧緱寰堝厖瀹,鍥犱负鏈変綘,娼樻綐!瀛︿範杩樺緱缁х画,杩涙杩樺緱鎸佺画,For my love.

NO.5鍒涘缓鍜屽鐞嗗唴琛ㄥ疄鎴樼瘒

鍒涘缓鍐呰〃鏁版嵁绫诲瀷

鍒涘缓鍐呰〃鏁版嵁绫诲瀷浣跨敤TYPES璇彞,璇硶:

TYPES聽 <t>聽 <type>聽 OCCURS聽 <n>.

璇ヨ鍙ョ畝鍗曟潵璁插氨鏄鍛婁竴涓暟缁<t>,褰㈡佷负<type>,闀垮害涓<n>.OCCURS閫夐」琛ㄧず鎸囧畾鍐呭瓨,PCCURS<n>,<n>涓烘寚瀹氱殑琛屽彿,灏嗙涓琛屽啓鍏ュ垱寤虹殑鍐呰〃鍚,灏变负鎸囧畾琛屼繚鐣欎簡鍐呭瓨.濡傛灉娣诲姞鍒板唴琛ㄤ腑鐨勮姣<n>,鍒欒嚜鍔ㄦ墿灞曚繚鐣欑殑鍐呭瓨.濡傛灉鍐呭瓨涓病鏈夎冻澶熺┖闂村彲鐢ㄤ簬鍐呰〃,鍒欏皢鍏跺啓鍏ョ紦鍐插尯鎴栫鐩.

瀹炰緥:

  • 脴聽 types聽vector聽type聽i聽occurs聽10.

鍒涘缓鍐呰〃vector,鍒跺畾琛屾暟涓10,鍏惰鍖呭惈鍩烘湰绫诲瀷I瀛楁.

  • 聽 types:聽begin聽of聽line,
    column1聽type聽i,
    column2聽type聽i,
    column3聽type聽i,
    end聽of聽line.
    TYPES聽itab聽TYPE聽line聽OCCURS聽10.

鍒涘缓鍐呰〃itab,鎸囧畾琛屾暟涓10,鍏惰涓庡瓧娈典覆LINE缁撴瀯鐩稿悓.

  • 聽 types聽vector聽type聽i聽occurs聽10.
    types:聽begin聽of聽line,
    column1聽type聽i,
    column2聽type聽i,
    column3聽type聽i,
    end聽of聽line.
    TYPES聽itab聽TYPE聽line聽OCCURS聽10.
    types:聽begin聽of聽deepline,
    table1聽type聽vector,
    table2聽type聽itab,
    end聽of聽deepline.
    types聽deeptable聽type聽deepline聽occurs聽10.

棣栧厛鍒涘缓鍐呰〃鏁版嵁绫诲瀷vectoritab,鐒跺悗鍒涘缓鏁版嵁绫诲瀷deepline浣滀负瀛楁涓蹭笖鍖呭惈杩欎簺鍐呰〃浣滀负缁勪欢.閫氳繃璇ュ瓧娈典覆鍒涘缓鍐呰〃deeptable,鎸囧畾琛屾暟涓10.鍙湅鍑鸿鍐呰〃鐨勫厓绱犳湰韬氨鏄唴琛(vectoritab).

鍒涘缓鍐呰〃鏁版嵁瀵硅薄

鍒涘缓鍐呰〃鏁版嵁瀵硅薄鏈夊嚑绉嶆柟寮:

  • 閫氳繃寮曠敤鍙︿竴涓〃鏍兼潵鍒涘缓鍐呰〃

璇硶:

DATA聽 <f>聽 <type>聽 [WITH聽 HEADER聽 LINE].

鍙互浣跨敤TYPELIKE鏉ュ紩鐢ㄨ〃鏍兼暟鎹被鍨嬫垨琛ㄦ牸鏁版嵁瀵硅薄.濡傛灉鎯冲垱寤哄甫琛ㄥご琛岀殑鍐呰〃,琛岀被鍨嬩笉鑳界洿鎺ユ槸鍐呰〃,浣嗗彲浠ユ槸鐢ㄥ唴琛ㄤ綔涓虹粍浠剁殑缁撴瀯.

PS:鍐呰〃甯﹁〃澶村拰涓嶅甫琛ㄥご鐨勫尯鍒:

濡傛灉甯︽湁琛ㄥご,瀵逛簬浠g爜鐨勪功鍐欒捣鏉ュ氨寰堢畝渚夸簡,浣嗘槸浣跨敤甯﹁〃澶寸殑鍐呰〃瀹规槗鍦ㄧ紪鍐欑▼搴忔椂鍑洪敊,骞堕檷浣庡彲璇绘,鍥犱负濡傛灉甯︽湁琛ㄥご琛鈥漈_TAB鈥,绋嬪簭閲鈥漈_TAB鈥浠h〃涓ょ鎰忔,涓涓哄唴琛T_TAB,浜屾槸鍐呰〃鐨勮〃澶磋T_TAB,鍙﹀鍦ㄥ鍐呴儴琛ㄨ繘琛屽垵濮嬪寲,娓呯┖鏃,甯︽湁琛ㄥご鐨勫唴閮ㄨ〃鍔犲叆鐩存帴鍐鈥滳LEAR T_TAB鈥,杩欐牱琚竻鐨勬槸T_TAB鐨勮〃澶磋,鑰屼笉鏄唴閮ㄨ〃,杩欐牱缂栬瘧浼氶氳繃,浣嗙▼搴忛昏緫灏遍敊浜.寤鸿浣跨敤鏍囧噯鐨勫唴閮ㄨ〃(涓嶅甫琛ㄥご鐨勫唴琛).

瀹炰緥:

TYPES:聽BEGIN聽OF聽line,
column1聽TYPE聽i,
column2聽TYPE聽i,
column3聽TYPE聽i,
END聽OF聽line.
TYPES聽itab聽TYPE聽line聽OCCURS聽10.

DATA聽tab1聽TYPE聽itab. DATA聽tab2聽LIKE聽tab1聽WITH聽HEADER聽LINE.

姝ゅ疄渚嬪垱寤烘暟鎹被鍨婭TAB浣滀负鍐呰〃,閫氳繃浣跨敤DATA璇彞鐨凾YPE鍙傛暟寮曠敤ITAB,浣挎暟鎹璞AB1涓嶪TAB缁撴瀯鐩稿悓.閫氳繃浣跨敤DATA璇彞鐨凩IKE鍙傛暟寮曠敤TAB1,浣挎暟鎹璞AB2缁撴灉鐩稿悓.鍒涘缓鐨凾AB2甯﹁〃澶磋,鍥犳鍙湪绋嬪簭涓娇鐢═AB2-COLUMN1/TAB2-COLUMN2鍜孴AB2-COLUMN3绛夊畾浣嶈〃鏍煎伐浣滃尯鍩烼AB2.

  • 閫氳繃寮曠敤缁撴瀯鏉ュ垱寤哄唴琛

璇硶:

DATA聽 <f>聽 <type>聽 OCCURS聽 <n>聽 [WITH 聽HEADER聽 LINE].

閫氳繃浣跨敤DATA璇彞鐨OCCURS閫夐」鍒涘缓鍐呰〃<f>.鍐呰〃涓鐨勬暟鎹被鍨嬪湪<type>涓寚瀹.瑕佹寚瀹氭暟鎹被鍨,鍙互浣跨敤TYPELIKE鍙傛暟.

瀹炰緥1:

DATA聽 FLIGHT_TAB 聽LIKE 聽SFLIGHT 聽OCCURS 聽10.

璇ュ疄渚嬪垱寤烘暟鎹璞LIGHT_TAB,鍏剁粨鏋勪笌鏁版嵁搴撹〃鏍糞FLIGHT鐩稿悓.

瀹炰緥2:

TYPES 聽VECTOR_TYPE 聽TYPE 聽I聽 OCCURS 聽10.

DATA 聽VECTOR聽 TYPE 聽VECTOR_TYPE 聽WITH 聽HEADER 聽LINE.

瀹炰緥2鍏堝垱寤轰竴涓唴琛ㄦ暟鎹被鍨媀ECTOR_TYPE,鍏惰鍖呭惈棣栧厛鍒涘缓鐨勫熀鏈被鍨婭瀛楁.鐒跺悗閫氳繃寮曠敤VECTOR_TYPE鍒涘缓鏁版嵁瀵硅薄VECTOR.閫氳繃浣跨敤WITH HEADER LINE閫夐」鍒涘缓琛ㄦ牸宸ヤ綔鍖哄煙VECTOR,璇ヨ〃鏍煎伐浣滃尯鍩熷寘鍚竴绉嶇被鍨婭瀛楁,鍙互閫氳繃鍚嶇ОVECTOR瀹氫綅.

瀹炰緥3:

DATA聽 VECTOR聽 TYPE 聽I 聽OCCURS 聽10 聽WITH 聽HEADER 聽LINE.

姝ゆ浠g爜閫氳繃鐩存帴鍦―ATA璇彞涓娇鐢∣CCURS閫夐」鍒涘缓鍜屽疄渚2涓畬鍏ㄤ竴鏍风殑鏁版嵁绫诲瀷VECTOR.

  • 鍒涘缓甯︽柊缁撴瀯鐨勫唴琛

璇硶:

DATA: BEGIN OF <f> OCCURS <n>,

<component declaration>,

……

END OF <f>.

姝ゆ瀹氫箟鍐呰〃<f>骞跺湪<component declaration>涓鏄庡叾琛岀粍浠.鍏朵綔鐢ㄤ笌鍏堝垱寤哄瓧娈典覆<f>,鐒跺悗鍐嶅垱寤轰笌璇ュ瓧娈典覆琛岀粨鏋勭浉鍚岀殑鍐呰〃<f>鐩稿悓.

瀹炰緥:

DATA:聽BEGIN聽OF聽itab聽OCCURS聽10,
column1聽TYPE聽i,
column2聽TYPE聽i,
column2聽TYPE聽i,
END聽OF聽itab.

璇ュ疄渚嬪垱寤哄唴琛ㄥ強鍏剁浉搴旂殑琛ㄦ牸宸ヤ綔鍖哄煙ITAB.

 

 

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷ABAP绗簲澶-鍒涘缓鍜屽鐞嗗唴琛ㄥ疄鎴樼瘒涔嬪垱寤哄唴琛

]]>
http://www.liaoyong.name/?feed=rss2&p=160 2
绋嬪簭鍛樼殑琛ㄧ櫧 http://www.liaoyong.name/?p=155 http://www.liaoyong.name/?p=155#comments Thu, 08 Nov 2012 03:26:11 +0000 Carey http://www.liaoyong.name/?p=155 ]]> 鏈変釜绋嬪簭鍛樼粓浜庡湪鍙屽崄涓鍓嶅鎷垮埌浜嗗績浠狹M鐨勬墜鏈哄彿鐮,浠栧叴濂嬬殑绔嬪嵆缁欒繖涓彿鐮佸彂浜嗕竴涓滺ello world鈥,绛変簡鍗婂ぉ娌″弽鏄,鍙堝彂浜嗕釜鈥漷est鈥,鐒跺悗..灏辨湪鏈夌劧鍚庝簡..

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷绋嬪簭鍛樼殑琛ㄧ櫧

]]>
http://www.liaoyong.name/?feed=rss2&p=155 1