コード例 #1
0
    void GetData()
    {
        int page     = Convert.ToInt32(Request.Params["page"]);
        int pageSize = Convert.ToInt32(Request.Params["pagesize"]);


        string             sData  = "";
        List <CBaseObject> lstObj = Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.GetList();

        int totalPage = lstObj.Count % pageSize == 0 ? lstObj.Count / pageSize : lstObj.Count / pageSize + 1; // 计算总页数

        int index = (page - 1) * pageSize;                                                                    // 开始记录数

        for (int i = index; i < pageSize + index && i < lstObj.Count; i++)
        {
            CView View = (CView)lstObj[i];

            sData += string.Format("{{ \"id\": \"{0}\",\"Name\":\"{1}\"}},"
                                   , View.Id, View.Name);
        }
        sData = sData.TrimEnd(",".ToCharArray());
        sData = "[" + sData + "]";
        string sJson = string.Format("{{\"Rows\":{0},\"Total\":\"{1}\"}}"
                                     , sData, lstObj.Count);

        Response.Write(sJson);
    }
コード例 #2
0
        public CView Convert(DataTable dataTable)
        {
            var view = new CView();

            view.Column = new List <CColumn>();

            foreach (var row2 in dataTable.Rows)
            {
                var row = row2 as DataRow;
                view.ViewName = (string)row[4];
                view.Schema   = new CSchema {
                    SchemaName = (string)row[5]
                };

                var column = new CColumn(view)
                {
                    ColumnName        = (string)row[0],
                    ColumnTypeRaw     = (string)row[1],
                    ColumnSqlDbType   = SqlMapper.ParseValueAsSqlDbType((string)row[1]),
                    ColumnType        = SqlMapper.GetDbType((string)row[1]),
                    ColumnLength      = row[3] != DBNull.Value ? (int)row[3] : -1,
                    ColumnDescription = row[6] != DBNull.Value ? (string)row[6] : null
                };
                view.Column.Add(column);
            }
            return(view);
        }
コード例 #3
0
        /// <summary>
        /// Sets program and view vars by name
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        public void Outputs(String name, object value)
        {
            String var_name = (prc.Outputs[name] != null)? prc.Outputs[name].ToString(): prc.Outputs["-" + name].ToString();

            if (!String.IsNullOrEmpty(var_name))
            {
                if (var_name.Contains("."))
                {
                    String[] tname  = var_name.Split('.');
                    String   var    = tname[tname.Length - 1];
                    String   source = var_name.Replace("." + var, "");

                    CView cv = ((view != null) && (source == view.Name)) ? view : vm.getFirstView(source);
                    if (cv != null)
                    {
                        cv.vars[var] = value;
                    }
                    else
                    {
                        errors.noOutputs = String.Format("Error: view {0} not found, and must content var: {1}", source, var);
                    }
                }
                else
                {
                    prc.vars[var_name] = value;
                }
            }
        }
コード例 #4
0
 public CFichaPrograma(CViewsManager vm)
 {
     view                    = (vm.getFirstView("GestorProgramas.VentanasAyuda.FichaPrograma") != null)? vm.getFirstView("GestorProgramas.VentanasAyuda.FichaPrograma"): vm.AddView("GestorProgramas.VentanasAyuda.FichaPrograma");
     FichaPrograma           = (System.Windows.Forms.Form)view.getCtrl("GestorProgramas.VentanasAyuda.FichaPrograma");
     FichaPrograma_cstr      = view.getCtrlStruct("GestorProgramas.VentanasAyuda.FichaPrograma");
     Content_panel           = (System.Windows.Forms.Panel)view.getCtrl("Content_panel");
     Content_panel_cstr      = view.getCtrlStruct("Content_panel");
     row_panel_head          = (System.Windows.Forms.Panel)view.getCtrl("row_panel_head");
     row_panel_head_cstr     = view.getCtrlStruct("row_panel_head");
     label_head              = (System.Windows.Forms.Label)view.getCtrl("label_head");
     label_head_cstr         = view.getCtrlStruct("label_head");
     row_panel_1             = (System.Windows.Forms.Panel)view.getCtrl("row_panel_1");
     row_panel_1_cstr        = view.getCtrlStruct("row_panel_1");
     l_nombre                = (System.Windows.Forms.Label)view.getCtrl("l_nombre");
     l_nombre_cstr           = view.getCtrlStruct("l_nombre");
     tb_nombre_programa      = (System.Windows.Forms.TextBox)view.getCtrl("tb_nombre_programa");
     tb_nombre_programa_cstr = view.getCtrlStruct("tb_nombre_programa");
     row_panel_2             = (System.Windows.Forms.Panel)view.getCtrl("row_panel_2");
     row_panel_2_cstr        = view.getCtrlStruct("row_panel_2");
     l_descripcion           = (System.Windows.Forms.Label)view.getCtrl("l_descripcion");
     l_descripcion_cstr      = view.getCtrlStruct("l_descripcion");
     tb_descripcion          = (System.Windows.Forms.TextBox)view.getCtrl("tb_descripcion");
     tb_descripcion_cstr     = view.getCtrlStruct("tb_descripcion");
     row_panel_3             = (System.Windows.Forms.Panel)view.getCtrl("row_panel_3");
     row_panel_3_cstr        = view.getCtrlStruct("row_panel_3");
     button_save             = (System.Windows.Forms.Button)view.getCtrl("button_save");
     button_save_cstr        = view.getCtrlStruct("button_save");
     button_cancel           = (System.Windows.Forms.Button)view.getCtrl("button_cancel");
     button_cancel_cstr      = view.getCtrlStruct("button_cancel");
 }
コード例 #5
0
 public CFormControlesEventos(CViewsManager vm)
 {
     view = (vm.getFirstView("GestorControles.FormControlesEventos") != null)? vm.getFirstView("GestorControles.FormControlesEventos"): vm.AddView("GestorControles.FormControlesEventos");
     FormControlesEventos      = (System.Windows.Forms.Form)view.getCtrl("GestorControles.FormControlesEventos");
     FormControlesEventos_cstr = view.getCtrlStruct("GestorControles.FormControlesEventos");
     PRight                 = (System.Windows.Forms.Panel)view.getCtrl("PRight");
     PRight_cstr            = view.getCtrlStruct("PRight");
     PEventBottom           = (System.Windows.Forms.Panel)view.getCtrl("PEventBottom");
     PEventBottom_cstr      = view.getCtrlStruct("PEventBottom");
     PEventsGrid            = (System.Windows.Forms.Panel)view.getCtrl("PEventsGrid");
     PEventsGrid_cstr       = view.getCtrlStruct("PEventsGrid");
     DG_EventosControl      = (System.Windows.Forms.DataGridView)view.getCtrl("DG_EventosControl");
     DG_EventosControl_cstr = view.getCtrlStruct("DG_EventosControl");
     panel1                 = (System.Windows.Forms.Panel)view.getCtrl("panel1");
     panel1_cstr            = view.getCtrlStruct("panel1");
     BGuardar               = (System.Windows.Forms.Button)view.getCtrl("BGuardar");
     BGuardar_cstr          = view.getCtrlStruct("BGuardar");
     PTopEvent_Consult      = (System.Windows.Forms.Panel)view.getCtrl("PTopEvent_Consult");
     PTopEvent_Consult_cstr = view.getCtrlStruct("PTopEvent_Consult");
     toolStrip1             = (System.Windows.Forms.ToolStrip)view.getCtrl("toolStrip1");
     toolStrip1_cstr        = view.getCtrlStruct("toolStrip1");
     ListaEventos           = (System.Windows.Forms.ListView)view.getCtrl("ListaEventos");
     ListaEventos_cstr      = view.getCtrlStruct("ListaEventos");
     PLeft             = (System.Windows.Forms.Panel)view.getCtrl("PLeft");
     PLeft_cstr        = view.getCtrlStruct("PLeft");
     TV_Controles      = (System.Windows.Forms.TreeView)view.getCtrl("TV_Controles");
     TV_Controles_cstr = view.getCtrlStruct("TV_Controles");
 }
コード例 #6
0
        private async void LoadDropBoxContent()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    //loader.StartAnimating();
                    HttpClient httpClient = new HttpClient();
                    httpClient.BaseAddress = new Uri("https://dl.dropboxusercontent.com");
                    var dropBoxContentService = RestService.For <IDropBoxContent>(httpClient);
                    var apiData = await dropBoxContentService.GetDropBoxContent();

                    Data = new List <DropBoxRow>();
                    Data = apiData.DropBoxRows;
                    if (Data == null && Data.Count == 0)
                    {
                        return;
                    }
                    CView.Source = new DropBoxCVS(Data);
                    CView.ReloadData();
                    //Collectionview
                    //loader.StopAnimating();
                    // loader.Hidden = true;
                }
                else
                {
                    var okAlertController = UIAlertController.Create("Alert Message", "Opps..Internet is Connected!!", UIAlertControllerStyle.Alert);
                    okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
                    PresentViewController(okAlertController, true, null);
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #7
0
    bool SavePage1()
    {
        string sName = txtName.Text.Trim();

        if (!sName.Equals(m_View.Name))
        {
            CView view2 = Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.FindByName(sName);
            if (view2 != null)
            {
                RegisterStartupScript("starup", "<script>alert('名称重复!');</script>");
                txtName.Focus();
                return(false);
            }
        }
        m_View.Name = sName;
        if (cbCatalog.SelectedIndex > 0)
        {
            m_Catalog_id             = new Guid(cbCatalog.SelectedItem.Value);
            m_View.UI_ViewCatalog_id = m_Catalog_id;
        }
        else
        {
            m_View.UI_ViewCatalog_id = Guid.Empty;
        }
        //如果是修改,并修改了主表,则清空旧字段
        Guid guidMT = new Guid(cbMasterTable.SelectedItem.Value);

        if (!m_bIsNew && guidMT != m_View.FW_Table_id)
        {
            m_View.ColumnInViewMgr.RemoveAll();
        }
        m_View.FW_Table_id = guidMT;

        return(true);
    }
コード例 #8
0
 public CVentanaProgramas(CViewsManager vm)
 {
     view                       = (vm.getFirstView("GestorProgramas.VentanaProgramas") != null)? vm.getFirstView("GestorProgramas.VentanaProgramas"): vm.AddView("GestorProgramas.VentanaProgramas");
     VentanaProgramas           = (System.Windows.Forms.Form)view.getCtrl("GestorProgramas.VentanaProgramas");
     VentanaProgramas_cstr      = view.getCtrlStruct("GestorProgramas.VentanaProgramas");
     PProcesses                 = (System.Windows.Forms.Panel)view.getCtrl("PProcesses");
     PProcesses_cstr            = view.getCtrlStruct("PProcesses");
     PTop                       = (System.Windows.Forms.Panel)view.getCtrl("PTop");
     PTop_cstr                  = view.getCtrlStruct("PTop");
     PListaProcesos             = (System.Windows.Forms.Panel)view.getCtrl("PListaProcesos");
     PListaProcesos_cstr        = view.getCtrlStruct("PListaProcesos");
     ListaProcesos              = (System.Windows.Forms.DataGridView)view.getCtrl("ListaProcesos");
     ListaProcesos_cstr         = view.getCtrlStruct("ListaProcesos");
     contextMenu_LProcesos      = (System.Windows.Forms.ContextMenuStrip)view.getCtrl("contextMenu_LProcesos");
     contextMenu_LProcesos_cstr = view.getCtrlStruct("contextMenu_LProcesos");
     PanelArbolProgramas        = (System.Windows.Forms.Panel)view.getCtrl("PanelArbolProgramas");
     PanelArbolProgramas_cstr   = view.getCtrlStruct("PanelArbolProgramas");
     ArbolProgramas             = (System.Windows.Forms.TreeView)view.getCtrl("ArbolProgramas");
     ArbolProgramas_cstr        = view.getCtrlStruct("ArbolProgramas");
     contextMenu_Programas      = (System.Windows.Forms.ContextMenuStrip)view.getCtrl("contextMenu_Programas");
     contextMenu_Programas_cstr = view.getCtrlStruct("contextMenu_Programas");
     MenuTop                    = (System.Windows.Forms.ToolStrip)view.getCtrl("MenuTop");
     MenuTop_cstr               = view.getCtrlStruct("MenuTop");
     OpenXML_Document           = new o_OpenXML_Document(view);
     Cargar_arbol_recursivo     = new o_Cargar_arbol_recursivo(view);
 }
コード例 #9
0
        bool SavePage1()
        {
            string sName = txtName.Text.Trim();

            if (!sName.Equals(m_View.Name))
            {
                CView view2 = Program.Ctx.ViewMgr.FindByName(sName);
                if (view2 != null)
                {
                    MessageBox.Show("名称重复!");
                    txtName.Focus();
                    return(false);
                }
            }
            m_View.Name = sName;
            if (cbCatalog.SelectedIndex > 0)
            {
                DataItem     item    = (DataItem)cbCatalog.SelectedItem;
                CViewCatalog catalog = (CViewCatalog)item.Data;
                m_View.UI_ViewCatalog_id = catalog.Id;
            }
            else
            {
                m_View.UI_ViewCatalog_id = Guid.Empty;
            }
            DataItem itemP  = (DataItem)cbMasterTable.SelectedItem;
            CTable   tableP = (CTable)itemP.Data;

            m_View.FW_Table_id = tableP.Id;


            return(true);
        }
コード例 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
        {
            Response.Redirect("../Login.aspx");
            Response.End();
        }

        //编辑视图
        string id = Request["id"];

        if (!string.IsNullOrEmpty(id))
        {
            m_View = (CView)Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.Find(new Guid(id));
            if (m_View.VType == enumViewType.Single)
            {
                Response.Redirect("SingleViewInfo1.aspx?id=" + Request["id"] + "&catalog_id=" + Request["catalog_id"]);
            }
            else if (m_View.VType == enumViewType.MasterDetail)
            {
                Response.Redirect("MasterDetailViewInfo1.aspx?id=" + Request["id"] + "&catalog_id=" + Request["catalog_id"]);
            }
            else
            {
                Response.Redirect("MultMasterDetailViewInfo1.aspx?id=" + Request["id"] + "&catalog_id=" + Request["catalog_id"]);
            }
        }
    }
コード例 #11
0
        void LoadData()
        {
            if (m_View == null) //新建
            {
                m_bIsNew       = true;
                m_View         = new CView();
                m_View.Ctx     = Program.Ctx;
                m_View.VType   = enumViewType.Single;
                m_View.Creator = Program.User.Id;
                return;
            }
            m_bIsLoadingData = true;

            txtName.Text = m_View.Name;
            //默认表
            for (int i = 0; i < cbMasterTable.Items.Count; i++)
            {
                DataItem item = (DataItem)cbMasterTable.Items[i];
                CTable   tb   = (CTable)item.Data;
                if (tb.Id == m_View.FW_Table_id)
                {
                    cbMasterTable.SelectedIndex = i;
                    cbMasterTable_SelectedIndexChanged(null, null);
                    break;
                }
            }


            LoadGridView();
            LoadGridView4();

            m_bIsLoadingData = false;
        }
コード例 #12
0
        /// #NAME#: #DESCRIPTION#
        public void f_Abrir_ventana_principal()
        {
            //INI CODE PRCGUID: Abrir ventana principal

            String ventana = (Config_str_nullable("-ventana") != "") ? Config_str("-ventana") : Input_str("-ventana");

            CView cventana = vm.getFirstView(ventana);

            if (cventana != null)
            {
                try
                {
                    cventana.mainControl().Show();
                }
                catch (Exception exc)
                {
                    errors.warning = exc.Message;
                    vm.freeView(cventana.Name);

                    cventana = vm.AddView(ventana);
                    cventana.mainControl().Show();
                }
            }
            else
            {
                cventana = vm.AddView(ventana);
                cventana.mainControl().Show();
            }
            //END CODE PRCGUID: Abrir ventana principal
        }
コード例 #13
0
        /// <summary>
        /// Gets program & views variables by name, get error only if MustExists is true
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public object Input(String name, bool nullable)
        {
            String var_name = (prc.Inputs[name] != null) ? prc.Inputs[name].ToString() : prc.Inputs["-" + name].ToString();

            if (!String.IsNullOrEmpty(var_name))
            {
                if (var_name.Contains("."))
                {
                    String[] tname  = var_name.Split('.');
                    String   var    = tname[tname.Length - 1];
                    String   source = var_name.Replace("." + var, "");

                    if (source.StartsWith(dGLOBALS.GLOBALS))
                    {
                        return(Globals.get(source, var));
                    }
                    else
                    {
                        CView cv = ((view != null) && (source == view.Name)) ? view : vm.getFirstView(source);

                        if (cv != null)
                        {
                            if (cv.vars.Keys.Contains(var))
                            {
                                return(cv.vars[var]);
                            }
                            else
                            {
                                if (!nullable)
                                {
                                    errors.noInputs = String.Format("Error: Var: '{0}' not found in view: {1}", var, source);
                                }
                            }
                        }
                        else
                        {
                            if (!nullable)
                            {
                                errors.noInputs = String.Format("Error: view {0} not found, and must content var: {1}", source, var);
                            }
                        }
                    }
                }
                else
                {
                    if (prc.vars.Keys.Contains(var_name))
                    {
                        return(prc.vars[var_name]);
                    }
                    else
                    {
                        if (!nullable)
                        {
                            errors.noInputs = String.Format("Error: program var: '{0}' not found", var_name);
                        }
                    }
                }
            }
            return(null);
        }
コード例 #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
        {
            Response.Redirect("../Login.aspx");
            Response.End();
        }
        string id = Request["id"];

        m_View = (CView)Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.Find(new Guid(id));

        m_Table = (CTable)Global.GetCtx(Session["TopCompany"].ToString()).TableMgr.Find(m_View.FW_Table_id);


        if (Request.Params["Action"] == "GetData")
        {
            GetData();
            Response.End();
        }
        else if (Request.Params["Action"] == "PostData")
        {
            PostData();
            Response.End();
        }
        else if (Request.Params["Action"] == "Cancel")
        {
            Cancel();
            Response.End();
        }
        else if (Request.Params["Action"] == "Delete")
        {
            Delete();
            Response.End();
        }
    }
コード例 #15
0
        private List <CTable> GetTables(IEnumerable <KView> views, bool isAudit)
        {
            var tables = new List <CTable>();

            foreach (var view in views)
            {
                var converter2 = new CViewToCTableConverter();

                CView view2 = view;
                if (view.GeneratedView != null)
                {
                    view2 = view.GeneratedView;
                }
                var table = converter2.Convert(view2);

                var schema = view.Schema.SchemaName;
                if (isAudit)
                {
                    schema = $"{schema}{AuditSuffix}";
                }
                table.Schema = new CSchema {
                    SchemaName = schema
                };

                //temp hack
                table.Column.First().IsPrimaryKey = true;
                tables.Add(table);
            }
            return(tables);
        }
コード例 #16
0
ファイル: VentanaProcesos_map.cs プロジェクト: jiman14/ARQODE
 public CVentanaProcesos(CViewsManager vm)
 {
     view                      = (vm.getFirstView("GestorProcesos.VentanaProcesos") != null)? vm.getFirstView("GestorProcesos.VentanaProcesos"): vm.AddView("GestorProcesos.VentanaProcesos");
     VentanaProcesos           = (System.Windows.Forms.UserControl)view.getCtrl("GestorProcesos.VentanaProcesos");
     VentanaProcesos_cstr      = view.getCtrlStruct("GestorProcesos.VentanaProcesos");
     tabProcesos               = (System.Windows.Forms.TabControl)view.getCtrl("tabProcesos");
     tabProcesos_cstr          = view.getCtrlStruct("tabProcesos");
     Pcontent                  = (System.Windows.Forms.TabPage)view.getCtrl("Pcontent");
     Pcontent_cstr             = view.getCtrlStruct("Pcontent");
     PProcessPanel             = (System.Windows.Forms.TabPage)view.getCtrl("PProcessPanel");
     PProcessPanel_cstr        = view.getCtrlStruct("PProcessPanel");
     PLeft                     = (System.Windows.Forms.Panel)view.getCtrl("PLeft");
     PLeft_cstr                = view.getCtrlStruct("PLeft");
     PProcessList              = (System.Windows.Forms.Panel)view.getCtrl("PProcessList");
     PProcessList_cstr         = view.getCtrlStruct("PProcessList");
     LProcess                  = (System.Windows.Forms.ListBox)view.getCtrl("LProcess");
     LProcess_cstr             = view.getCtrlStruct("LProcess");
     contextMenu_Proceso       = (System.Windows.Forms.ContextMenuStrip)view.getCtrl("contextMenu_Proceso");
     contextMenu_Proceso_cstr  = view.getCtrlStruct("contextMenu_Proceso");
     PProcessDir               = (System.Windows.Forms.Panel)view.getCtrl("PProcessDir");
     PProcessDir_cstr          = view.getCtrlStruct("PProcessDir");
     TV_Processes              = (System.Windows.Forms.TreeView)view.getCtrl("TV_Processes");
     TV_Processes_cstr         = view.getCtrlStruct("TV_Processes");
     contextMenu_Procesos      = (System.Windows.Forms.ContextMenuStrip)view.getCtrl("contextMenu_Procesos");
     contextMenu_Procesos_cstr = view.getCtrlStruct("contextMenu_Procesos");
 }
コード例 #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
        {
            Response.End();
        }
        m_User = (CUser)Session["User"];

        string vid = Request["vid"];

        if (string.IsNullOrEmpty(vid))
        {
            Response.End();
        }
        string vdid = Request["vdid"];

        if (string.IsNullOrEmpty(vdid))
        {
            Response.End();
        }
        m_View = (CView)Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.Find(new Guid(vid));
        if (m_View == null)
        {
            Response.End();
        }
        m_ViewDetail = (CViewDetail)m_View.ViewDetailMgr.Find(new Guid(vdid));
        if (m_ViewDetail == null)
        {
            Response.End();
        }
        m_Table = (CTable)Global.GetCtx(Session["TopCompany"].ToString()).TableMgr.Find(m_ViewDetail.FW_Table_id);

        //检查权限
        if (!CheckAccess())
        {
            Response.End();
        }

        if (Session["EditMultMasterDetailViewRecord"] == null)
        {
            Response.End();
        }

        SortedList <Guid, CBaseObject> arrP = (SortedList <Guid, CBaseObject>)Session["EditMultMasterDetailViewRecord"];
        CBaseObject objP = (CBaseObject)arrP.Values[0];

        m_BaseObjectMgr = objP.GetSubObjectMgr(m_Table.Code, typeof(CBaseObjectMgr));

        if (Request.Params["Action"] == "GetData")
        {
            GetData();
            Response.End();
        }
        else if (Request.Params["Action"] == "Delete")
        {
            Delete();
            Response.End();
        }
    }
コード例 #18
0
        void LoadData()
        {
            if (m_View == null) //新建
            {
                m_bIsNew       = true;
                m_View         = new CView();
                m_View.Ctx     = Program.Ctx;
                m_View.VType   = enumViewType.MultMasterDetail;
                m_View.Creator = Program.User.Id;
                return;
            }
            m_bIsLoadingData = true;

            txtName.Text = m_View.Name;
            //默认表
            for (int i = 0; i < cbMasterTable.Items.Count; i++)
            {
                DataItem item = (DataItem)cbMasterTable.Items[i];
                CTable   tb   = (CTable)item.Data;
                if (tb.Id == m_View.FW_Table_id)
                {
                    cbMasterTable.SelectedIndex = i;
                    cbMasterTable_SelectedIndexChanged(null, null);
                    break;
                }
            }

            List <CBaseObject> lstObj  = m_View.ViewDetailMgr.GetList();
            List <CViewDetail> sortObj = new List <CViewDetail>();

            foreach (CBaseObject obj in lstObj)
            {
                CViewDetail vd = (CViewDetail)obj;
                sortObj.Add(vd);
            }
            sortObj.Sort();

            listViewDetail.Items.Clear();
            foreach (CViewDetail ViewDetail in sortObj)
            {
                ListViewItem it = new ListViewItem();
                it.Text = ViewDetail.Name;
                it.Tag  = ViewDetail;
                listViewDetail.Items.Add(it);

                CTable   table = (CTable)Program.Ctx.TableMgr.Find(ViewDetail.FW_Table_id);
                DataItem itT   = new DataItem(table.Name, table);
                cbDetailTable2.Items.Add(itT);
                DataItem itT2 = new DataItem(table.Name, table);
                cbDetailTable3.Items.Add(itT2);
            }


            LoadGridView();
            LoadGridView4();

            m_bIsLoadingData = false;
        }
コード例 #19
0
    void LoopGetMenu(ref string sData, Guid Parent_id)
    {
        List <CBaseObject> lstObj = Global.GetCtx(Session["TopCompany"].ToString()).MenuMgr.GetList();

        foreach (CBaseObject obj in lstObj)
        {
            CMenu menu = (CMenu)obj;
            if (menu.Parent_id != Parent_id)
            {
                continue;
            }
            string sChildren = "";
            LoopGetMenu(ref sChildren, menu.Id);
            string sIconUrl = string.Format("../{0}/MenuIcon/default.png",
                                            Global.GetDesktopIconPathName());
            if (menu.IconUrl != "")
            {
                sIconUrl = string.Format("../{0}/MenuIcon/{1}",
                                         Global.GetDesktopIconPathName(), menu.IconUrl);
            }
            string url = menu.Url;
            if (menu.MType == enumMenuType.CatalogMenu)
            {
                url = "SelectMenu.aspx?pid=" + menu.Id.ToString();
            }
            else if (menu.MType == enumMenuType.ViewMenu)
            {
                CView view = (CView)Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.Find(menu.UI_View_id);
                if (view == null)
                {
                    continue;
                }
                if (view.VType == enumViewType.Single)
                {
                    url = "../View/SingleView.aspx?vid=" + view.Id.ToString();
                }
                else if (view.VType == enumViewType.MasterDetail)
                {
                    url = "../View/MasterDetailView.aspx?vid=" + view.Id.ToString();
                }
                else
                {
                    url = "../View/MultMasterDetailView.aspx?vid=" + view.Id.ToString();
                }
            }
            else if (menu.MType == enumMenuType.WindowMenu)
            {
            }
            else if (menu.MType == enumMenuType.ReportMenu)
            {
                url = "../Report/RunReport.aspx?id=" + menu.RPT_Report_id.ToString();
            }
            sData += string.Format("{{\"id\":\"{0}\",\"text\":\"{1}\",\"icon\":\"{2}\",\"mtype\":\"{3}\",\"url\":\"{4}\", children: [{5}]}},",
                                   menu.Id, menu.Name, sIconUrl, (int)menu.MType, url, sChildren);
        }
        sData = sData.TrimEnd(",".ToCharArray());
    }
コード例 #20
0
        public async override void ViewDidLoad()
        {
            base.ViewDidLoad();
            LoadDropBoxContent();
            await RefreshAsync();

            AddRefreshControl();
            CView.Add(RefreshControl);
        }
コード例 #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
        {
            Response.End();
        }
        m_User = (CUser)Session["User"];

        string vid = Request["vid"];

        if (string.IsNullOrEmpty(vid))
        {
            Response.End();
        }
        string vdid = Request["vdid"];

        if (string.IsNullOrEmpty(vdid))
        {
            Response.End();
        }
        m_View = (CView)Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.Find(new Guid(vid));
        if (m_View == null)
        {
            Response.End();
        }
        m_ViewDetail = (CViewDetail)m_View.ViewDetailMgr.Find(new Guid(vdid));
        if (m_ViewDetail == null)
        {
            Response.End();
        }
        m_Table = (CTable)Global.GetCtx(Session["TopCompany"].ToString()).TableMgr.Find(m_ViewDetail.FW_Table_id);

        //检查权限
        if (!CheckAccess())
        {
            Response.End();
        }

        string ParentId = Request["ParentId"];

        if (!string.IsNullOrEmpty(ParentId))
        {
            m_guidParentId = new Guid(ParentId);
        }

        if (Request.Params["Action"] == "GetData")
        {
            GetData();
            Response.End();
        }
        else if (Request.Params["Action"] == "Delete")
        {
            Delete();
            Response.End();
        }
    }
コード例 #22
0
ファイル: MenuInfo.cs プロジェクト: stonezhu870/RapidCore
        void LoadView()
        {
            cbView.Items.Clear();
            List <CBaseObject> lstObj = Program.Ctx.ViewMgr.GetList();

            foreach (CBaseObject obj in lstObj)
            {
                CView    view = (CView)obj;
                DataItem item = new DataItem(view.Name, view);
                cbView.Items.Add(item);
            }
        }
コード例 #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
        {
            Response.Redirect("../Login.aspx");
            Response.End();
        }
        string id = Request["id"];

        if (!string.IsNullOrEmpty(id))
        {
            m_View = (CView)Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.Find(new Guid(id));
        }
        else
        {
            m_bIsNew = true;
            if (Session["NewView"] == null)
            {
                Response.Redirect("SingleViewInfo1.aspx?id=" + Request["id"] + "&catalog_id=" + Request["catalog_id"]);
                return;
            }
            else
            {
                SortedList <Guid, CView> sortObj = (SortedList <Guid, CView>)Session["NewView"];
                m_View = sortObj.Values[0];
            }
        }
        m_Table = (CTable)Global.GetCtx(Session["TopCompany"].ToString()).TableMgr.Find(m_View.FW_Table_id);

        string catalog_id = Request["catalog_id"];

        if (!string.IsNullOrEmpty(catalog_id))
        {
            m_Catalog_id = new Guid(catalog_id);
        }


        if (Request.Params["Action"] == "GetData")
        {
            GetData();
            Response.End();
        }
        else if (Request.Params["Action"] == "PostData")
        {
            PostData();
            Response.End();
        }
        else if (Request.Params["Action"] == "Cancel")
        {
            Cancel();
            Response.End();
        }
    }
コード例 #24
0
ファイル: Iniparser.cs プロジェクト: DiosnaCS/UsersDiosna-New
        public void ParseCfg(CIniFile config, string[] separators, CIniFile iniFileInstance)
        {
            string[] separeted_string = null;

            CView         lastView         = null;
            CField        lastField        = null;
            CSignal       lastSignal       = null;
            CSigMultitext lastSigMultitext = null;

            string[] lines = System.IO.File.ReadAllLines(CfgPath, System.Text.Encoding.Default);

            for (int i = 0; i < lines.Length; i++)
            {
                separeted_string = lines[i].Split(separators, StringSplitOptions.RemoveEmptyEntries);

                try
                {
                    if (!(lines[i].StartsWith("#")) && (lines[i].Length != 0))
                    {
                        switch (separeted_string[0])
                        {
                        case "View":
                            separeted_string = lines[i].Split(Const.separators_view, StringSplitOptions.RemoveEmptyEntries);
                            lastView         = parseView(config, separeted_string);
                            iniFileInstance.AddView(lastView);
                            break;

                        case "Field":
                            lastField = parseField(config, separeted_string);
                            lastView.AddField(lastField);
                            break;

                        case "Signal":
                            separeted_string = lines[i].Split(Const.separators_signal, StringSplitOptions.RemoveEmptyEntries);
                            lastSignal       = parseSignal(config, separeted_string);
                            lastField.AddSignal(lastSignal);
                            break;

                        case "SigMultitext":
                            separeted_string = lines[i].Split(Const.separators_signal, StringSplitOptions.RemoveEmptyEntries);
                            lastSigMultitext = parseSigMultitext(config, separeted_string);
                            lastField.AddSignalMultitext(lastSigMultitext);
                            break;
                        }
                    }
                }
                catch (Exception e) {
                    Error.toFile(e.Message.ToString(), this.GetType().Name.ToString());
                }
            }
        }
コード例 #25
0
        private async Task RefreshAsync()
        {
            if (useRefreshControl)
            {
                RefreshControl.BeginRefreshing();
            }

            if (useRefreshControl)
            {
                RefreshControl.EndRefreshing();
            }

            CView.ReloadData();
        }
コード例 #26
0
 private void AddLoadDateUtcToView(CView view2)
 {
     if (view2.Column.Exists(c => c.ColumnName.ToLower() == "loaddateutc"))
     {
         return;
     }
     view2.Column.Add(new CColumn(view2)
     {
         ColumnName    = "LoadDateUTC",
         ColumnType    = DbType.DateTime2,
         ColumnTypeRaw = "datetime2",
         IsNullable    = false
     });
 }
コード例 #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
        {
            Response.Redirect("../Login.aspx");
            Response.End();
        }
        string id = Request["id"];

        if (!string.IsNullOrEmpty(id))
        {
            m_View = (CView)Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.Find(new Guid(id));
        }
        else
        {
            m_bIsNew = true;
            if (Session["NewMasterDetailView"] == null)
            {
                m_View       = new CView();
                m_View.Ctx   = Global.GetCtx(Session["TopCompany"].ToString());
                m_View.VType = enumViewType.MasterDetail;
                CViewDetail ViewDetail = new CViewDetail();
                ViewDetail.Ctx        = m_View.Ctx;
                ViewDetail.UI_View_id = m_View.Id;
                m_View.ViewDetailMgr.AddNew(ViewDetail);

                SortedList <Guid, CView> sortObj = new SortedList <Guid, CView>();
                sortObj.Add(m_View.Id, m_View);
                Session["NewMasterDetailView"] = sortObj;
            }
            else
            {
                SortedList <Guid, CView> sortObj = (SortedList <Guid, CView>)Session["NewMasterDetailView"];
                m_View = sortObj.Values[0];
            }
        }
        string catalog_id = Request["catalog_id"];

        if (!string.IsNullOrEmpty(catalog_id))
        {
            m_Catalog_id = new Guid(catalog_id);
        }

        if (!IsPostBack)
        {
            LoadCatalog();
            LoadTable();
            LoadData();
        }
    }
コード例 #28
0
ファイル: TablaB_map.cs プロジェクト: jiman14/ARQODE
 public CTablaB(CViewsManager vm)
 {
     view          = (vm.getFirstView("ARQODE_UI.TablaB") != null)? vm.getFirstView("ARQODE_UI.TablaB"): vm.AddView("ARQODE_UI.TablaB");
     TablaB        = (System.Windows.Forms.Form)view.getCtrl("ARQODE_UI.TablaB");
     TablaB_cstr   = view.getCtrlStruct("ARQODE_UI.TablaB");
     panel1        = (System.Windows.Forms.Panel)view.getCtrl("panel1");
     panel1_cstr   = view.getCtrlStruct("panel1");
     Buscar        = (System.Windows.Forms.Button)view.getCtrl("Buscar");
     Buscar_cstr   = view.getCtrlStruct("Buscar");
     Tabla         = (System.Windows.Forms.DataGridView)view.getCtrl("Tabla");
     Tabla_cstr    = view.getCtrlStruct("Tabla");
     TextBox1      = (System.Windows.Forms.TextBox)view.getCtrl("TextBox1");
     TextBox1_cstr = view.getCtrlStruct("TextBox1");
 }
コード例 #29
0
 private void AddModifiedDateUtcToView(CView view2)
 {
     if (view2.Column.Exists(c => c.ColumnName.ToLower() == "modifieddateutc"))
     {
         return;
     }
     view2.Column.Add(new CColumn(view2)
     {
         ColumnName    = "ModifiedDateUtc",
         ColumnType    = DbType.DateTime2,
         ColumnTypeRaw = "datetime2",
         IsNullable    = true
     });
 }
コード例 #30
0
ファイル: ViewPanel.cs プロジェクト: stonezhu870/RapidCore
        private void tbtSetDefaultVal_Click(object sender, EventArgs e)
        {
            if (dataGridView.CurrentRow == null)
            {
                MessageBox.Show("请选择一项!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            CView         obj = (CView)dataGridView.CurrentRow.Tag;
            SetDefaultVal frm = new SetDefaultVal();

            frm.m_View = obj;
            frm.ShowDialog();
        }