public str_sys_dw f_constr_load(string as_username, string as_winname, ref DataWindow adw_dw, ref str_sys_dw astr_dws_g, ref str_sys_dw astr_dws_i) { //待实现 str_sys_dw ret = new str_sys_dw(); return(ret); }
public long f_delt_dw_pre_file(ref DataWindow adw_dw) {// 数据浏览界面删除数据不做检查 //choose case left(adw_dw.tag,1) // case "0","1" // return 0 //end choose ////上传文件的字段后缀必须是“_7z” //long ll_ci,ll_i,ll_j,ll_cj //string ls_data,ls_col //ll_ci = adw_dw.rowcount() //ll_cj=long(adw_dw.Object.DataWindow.Column.Count) //for ll_j = 1 to ll_cj // if left(adw_dw.Describe("#" + string(ll_j) + ".coltype") , 5) <> "char(" then continue // 不是字符型的不判断 // ls_col = adw_dw.Describe("#" + string(ll_j) + ".name") // if right(ls_col,3) <> "_7z" then continue // 后缀名不是_7z的不判断 // for ll_i = 1 to ll_ci // ls_data = adw_dw.getitemstring(ll_i, ls_col) // if isnull(ls_data) or trim(ls_data) = "" then continue // f_msg( "请先删除,第 " + string(ll_i) + " 行 " + adw_dw.describe(ls_col + "_t.text") + " 的上传文件 " + ls_data ) // return -1 // next //next return(0); }
public void f_constr_private(ref DataWindow adw_dw) { //adw_dw.SetTransObject(sqlca) //string ls_sort //ls_sort = adw_dw.object.DataWindow.Table.Sort //adw_dw.describe("DataWindow.Table.Sort") //if not (((ls_sort = "?") or (ls_sort = "!") or (ls_sort = "") or isnull(ls_sort))) then // adw_dw.title = ls_sort // adw_dw.setsort("") //end if //adw_dw.object.DataWindow.Table.Sort="" ////adw_dw.modify('DataWindow.Table.Sort=""') ////settrans()和settransobject()得功能几乎一样,只是前者内部自动调用connect或disconnect,在系统中这样频繁的调用对系统的性能是有影响。 //string ls_colname,ls_t9,ls_9 //string ls_lpobjects //long ll_looppos //ls_9 = char(9) //ls_t9 = "_t" + ls_9 //ls_lpobjects = adw_dw.Describe("datawindow.objects") + ls_9 //if ls_lpobjects = ls_9 then // f_error("datawindow未设置", adw_dw.classname()) ////f_msg("",g5_sys.s_object) //end if //ll_looppos = pos(ls_lpobjects,ls_t9) //do while ll_looppos >= 2 // ls_colname = left(ls_lpobjects, ll_looppos - 1) //// ls_lpobjects = mid(ls_lpobjects, ll_looppos + 3) // ll_looppos = pos(ls_lpobjects, ls_t9, ll_looppos + 3) // if lastpos(ls_colname, ls_9) >= 1 then ls_colname = midw(ls_colname, lastpos(ls_colname, ls_9) + 1) // if adw_dw.Describe(ls_colname + ".visible") = "0" then adw_dw.modify(ls_colname + '_t.tag="private"') //loop //adw_dw.object.datawindow.print.documentname = string(long(adw_dw.DesCribe('datawindow.detail.height')) - 8) }
public void f_get_sql_id_table(ref DataWindow adw_dw, ref string as_id_name, ref string as_sql_name, ref string as_tb_name) { as_id_name = adw_dw.IdCol; as_sql_name = adw_dw.SqlName; as_tb_name = adw_dw.TableName; //if (lower(left(as_tb_name,4)) == "dbo." ) // as_tb_name = mid(as_tb_name,5); }
public long f_itemchanged(ref long row, ref string dwo, ref string data, ref DataWindow adw_dw, DateTime adt_0) { //if isnull(data) or data = "" then return 0 //long ll_data,ll_year,ll_jk //string ls_mess = "",ls_name //CHOOSE CASE dwo.ColType // CASE "date","datetime" // ll_data = long(left(data,4)) // ll_year = year(date(adt_0)) // 服务器上的当前日期 // if ll_data <= 1753 then // ls_mess = "您输入的 " + adw_dw.describe(dwo.name+"_t.text") + ":" + data + "太小了,必须大于1753年!" // goto rtend // end if // ls_name = trim(adw_dw.describe(dwo.name+"_t.tag")) // choose case ls_name // case "?","" // ls_name = right(dwo.name,3) // end choose // choose case ls_name // case "_1t" // ll_jk = 10 // case "_2t" // ll_jk = 20 // case "_5t" // ll_jk = 50 // case "_1h" // ll_jk = 100 // case "_2h" // ll_jk = 200 // case "_5h" // ll_jk = 500 // case "_1k" // ll_jk = 1000 // case "_2k" // ll_jk = 2000 // case "_5k" // ll_jk = 5000 // case else // ll_jk = 1 // end choose // if ll_data > ll_year + ll_jk or ll_data < ll_year - ll_jk then // ls_mess = "您输入的 " + adw_dw.describe(dwo.name+"_t.text") + ":" + data + "不正确,与当前日期相差太大了!" // goto rtend // end if //END CHOOSE //rtend: //if ls_mess = "" then // return 0 //else // f_msg(ls_mess) // return 1 //end if return(0); }
public void f_sql_retrieve(string as_select, string as_cxtj, ref DataWindow adw_dw, bool ab_retrieve) { if (as_cxtj.Contains("\"")) { MessageBox.Show("查询语句中不能含有双引号!"); return; } adw_dw.CurrentConditoin = as_cxtj; adw_dw.Retrieve(); }
public void f_dddw_show(string as_col, ref DataWindow adw_dw, ref long al_dropdown_show) { //choose case adw_dw.DesCribe(as_col+'.edit.style') // case 'dddw' // if al_dropdown_show <= 256 then // keybd_event(115, 0, 0, 0 ) // 按下F4 // keybd_event(115, 0, 2, 0 ) // 释放F4 // end if // case 'ddlb' // if al_dropdown_show <= 256 then // keybd_event(115, 0, 0, 0 ) // 按下F4 // al_dropdown_show = 888 // keybd_event(115, 0, 2, 0 ) // 释放F4 // end if //end choose }
public void f_constr_save(string as_username, string as_winname, DataWindow adw_dw) { //string ls_dwname; //ls_dwname = adw_dw.DataObject + "_" + adw_dw.Tag.ToString().Substring(0,3); //string ls_colwb,ls_colxb,ls_colvb,ls_colsortb,ls_colnb; //string[] ls_colxa,ls_colna,ls_colwa,ls_colva; //f_constr_getx(adw_dw,ls_colna,ls_colxa,ls_colwa,ls_colva); //ls_colnb=global.gu_pub1.f_s_arraytolista(ls_colna,";"); //ls_colxb=global.gu_pub1.f_s_arraytolista(ls_colxa,";"); //ls_colwb=global.gu_pub1.f_s_arraytolista(ls_colwa,";"); //ls_colvb=global.gu_pub1.f_s_arraytolista(ls_colva,";"); //string ls_colwc,ls_colxc,ls_colvc,ls_colnc,ls_colsortc,ls_colsortsetc //select top 1 colname,colx,colwidth,colvisible,colsort,sort_set //into :ls_colnc,:ls_colxc,:ls_colwc,:ls_colvc,:ls_colsortc,:ls_colsortsetc // from mis_dw_argument WITH (NOLOCK) // where user_name1 = :as_username and window1 = :as_winname and dataobject = :ls_dwname ; //if ls_colsortsetc = "Y" then // 每次打开页面时排序固定,用在设置页面设置好的排序 // if ls_colnc + ls_colxc + ls_colwc + ls_colvc = ls_colnb + ls_colxb + ls_colwb + ls_colvb then return // update mis_dw_argument set // colname = :ls_colnb, // colx = :ls_colxb, // colwidth = :ls_colwb, // colvisible = :ls_colvb, // lrsj=getdate() // where user_name1 = :as_username and window1 = :as_winname and dataobject = :ls_dwname ; //elseif ls_colsortsetc = "N" then // 每次打开页面时排序不固定,用每次关闭页面时的排序 // ls_colsortb = adw_dw.title //describe("DataWindow.Table.Sort") // if ls_colnc + ls_colxc + ls_colwc + ls_colvc + ls_colsortc = ls_colnb + ls_colxb + ls_colwb + ls_colvb + ls_colsortb then return // update mis_dw_argument set // colname = :ls_colnb, // colx = :ls_colxb, // colwidth = :ls_colwb, // colvisible = :ls_colvb, // colsort = :ls_colsortb, // lrsj=getdate() // where user_name1 = :as_username and window1 = :as_winname and dataobject = :ls_dwname ; //else // ls_colsortb = adw_dw.title //describe("DataWindow.Table.Sort") // insert into mis_dw_argument (user_name1,window1,dataobject,colname,colx,colwidth,colvisible,colsort,sort_set,lrsj) // values (:as_username,:as_winname,:ls_dwname,:ls_colnb,:ls_colxb,:ls_colwb,:ls_colvb,:ls_colsortb,"N",getdate()) ; //end if }
public void f_dwsort(DataWindow adw_dw, string as_colname) { //if mid(adw_dw.tag,5,1) = "N" then return //string ls_sort ////f_msg("2",as_dwname+as_colname) //if rightw(as_colname,2) = '_t' then // adw_dw.SetRedraw(false) // ls_sort = f_dwsort_ctrl(adw_dw,as_colname) //else // ls_sort = f_dwsort_sort(adw_dw,as_colname) //end if //if trim(ls_sort) = "" or isnull(ls_sort) then // if rightw(as_colname,2) = '_t' then adw_dw.SetRedraw(true) // return //end if //adw_dw.title = ls_sort //string ls_upper[],ls_col //long ll_i,ll_ci //any lll //gu_pub1.f_s_listtoarray(ls_sort,", ",ls_upper[]) //ll_ci = upperbound(ls_upper[]) //for ll_i = 1 to ll_ci // ls_col = left(ls_upper[ll_i],len(ls_upper[ll_i]) - 2) // if left(adw_dw.Describe(ls_col+'.coltype') , 5) = "char(" then // ls_upper[ll_i] = "upper("+ls_col+") " + right(ls_upper[ll_i],1) // end if //next //ls_sort = gu_pub1.f_s_arraytolists(ls_upper[],", ") //adw_dw.SetSort(ls_sort) //adw_dw.Sort() //adw_dw.SetSort("") //adw_dw.GroupCalc()//重新计算分组 //// f_msg("当前排序",fdw_dw.describe("DataWindow.Table.Sort")) //if rightw(as_colname,2) = '_t' then adw_dw.SetRedraw(true) //return }
private void Form1_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("Name"); dt.Columns.Add("Value"); dt.Rows.Add("北京", "Y"); dt.Rows.Add("上海", "N"); dt.Rows.Add("南京", "N"); dt.Rows.Add("哈尔滨", "N"); myOptions1.Columns = 1; myOptions1.BindData(dt); ((MyOptionsColumn)dataGridView1.Columns["Column1"]).DataSource = dt; dataGridView1.Rows.Add(); dataGridView1.Rows[0].Cells[0].Value = "哈尔滨"; dataGridView1.Columns[0].DefaultCellStyle.Format = ""; dataWindow1.Retrieve("1"); DataWindow dw = dataWindow1; dw.setitem(0, "pihao", "aaaaa"); }
public long f_dw_col_isnull(ref long row, ref string dwo, ref string data, ref DataWindow adw_dw) { // choose case left(dwo.coltype , 5) // case "char(" // if isnull(data) or data = "" or left(data,1) = " " or right(data,1) = " " then // f_msg( adw_dw.describe(dwo.name + "_t.text") + " 为空或第一个字符为空或最后一个字符为空!") // return -1 // end if // case "date" // if isnull(data) then // f_msg( adw_dw.describe(dwo.name + "_t.text") + " 不能为空!") // return -1 // end if // case "datet" // if isnull(data) then // f_msg( adw_dw.describe(dwo.name + "_t.text") + " 不能为空!") // return -1 // end if // case "decim","int","long","numbe","real","ulong" // if isnull(data) then // f_msg( adw_dw.describe(dwo.name + "_t.text") + " 不能为空!") // return -1 // end if // case "time","times" // if isnull(data) then // f_msg( adw_dw.describe(dwo.name + "_t.text") + " 不能为空!") // return -1 // end if // case "!" // f_msg("提示dw_col_isnull 找不到相对应的字段(" + string(dwo.name) + ")!") // return 0 // case else // f_msg("提示dw_col_isnull " + string(dwo.coltype) + " 未知的数据类型,请把这条信息发送给信息管理员") // return 0 //end choose return(0); }
public long f_delt_dw_row(ref DataWindow adw_dw, ref long al_focuschanged, long al_xuhao) { if (al_xuhao >= 0) { if (MessageBox.Show("您确实要删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return(-1); } } al_focuschanged = 666; //多行删除选中行后导致的焦点改变 long ll_i, ll_count; ll_count = adw_dw.rowcount(); if (adw_dw.Tag.ToString().Substring(0, 1) == "3") // 单行删除 { if (ll_count == 1) { if (f_delt_dw_pre_file(ref adw_dw, ll_count) == -1) { return(-1); } adw_dw.deleterow(1); } } else // 多行删除 { //for (ll_i = ll_count; ll_i >= 1; ll_i--) //{ // if (adw_dw.IsSelected(ll_i)) // { // if (f_delt_dw_pre_file(ref adw_dw, ll_i) == -1) // return -1; // adw_dw.deleterow(ll_i); // } //} for (int i = adw_dw.dataGridView1.SelectedRows.Count - 1; i >= 0; i--) { if (f_delt_dw_pre_file(ref adw_dw, adw_dw.dataGridView1.SelectedRows[i].Index) == -1) { return(-1); } adw_dw.deleterow(adw_dw.dataGridView1.SelectedRows[i].Index); } } al_focuschanged = 0; //al_xuhao // 1代表有序号的需要重新更改序号 0代表没有序号的跳过 负数代表不提示直接删除 if (al_xuhao == 1) { string ls_colname, ls_sort = ""; //ls_sort = adw_dw.title; ls_colname = adw_dw.Cols[0].Name; f_dwsort(adw_dw, ls_colname + " A"); for (ll_i = 0; ll_i < adw_dw.rowcount(); ll_i++) { if (adw_dw.GetItemData(ll_i, ls_colname) != ll_i.ToString()) { adw_dw.setitem(ll_i, ls_colname, ll_i + 1); } } f_dwsort(adw_dw, ls_sort); } return(1); }