Exemplo n.º 1
0
        protected static FR_L5ST_GSTFSPI_1037 Execute(DbConnection Connection, DbTransaction Transaction, P_L5ST_GSTFSPI_1037 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5ST_GSTFSPI_1037();
            returnValue.Result = new L5ST_GSTFSPI_1037();

            L5CM_GCSFT_1157      company              = cls_Get_Company_Structure_For_Tenant.Invoke(Connection, Transaction, securityTicket).Result;
            L6TN_GSFT_1017       settingsForTenant    = cls_Get_Settings_For_Tenant.Invoke(Connection, Transaction, securityTicket).Result;
            StructureBuilderUtil structureBuilderUtil = new StructureBuilderUtil();
            TreeNodeUtil         treeNodeUtil         = new TreeNodeUtil();
            List <Guid>          structurePartsList   = new List <Guid>();
            structurePartsList.Add(Parameter.StructurePartID);

            structureBuilderUtil.company         = cls_Get_Company_Structure_For_Tenant.Invoke(Connection, Transaction, securityTicket).Result;;
            structureBuilderUtil.sessionToken    = securityTicket.SessionTicket;
            structureBuilderUtil.addEmployees    = false;
            structureBuilderUtil.employees       = cls_Get_Employees_For_Tenant.Invoke(Connection, Transaction, securityTicket).Result;
            structureBuilderUtil.sessionSettings = cls_Get_Settings_For_Tenant.Invoke(Connection, Transaction, securityTicket).Result;
            structureBuilderUtil.startDate       = cls_Get_CalculationTimeFramesForTenant.Invoke(Connection, Transaction, securityTicket).Result.Min(x => x.CalculationTimeframe_StartDate).Date;
            structureBuilderUtil.endDate         = DateTime.Now;
            structureBuilderUtil.hidenNodeType   = CompanyStructureType.None;

            EmployeeUtils employeeUtil = new EmployeeUtils();
            structureBuilderUtil.employeeUtil = employeeUtil;

            List <Node>            companyStructure        = structureBuilderUtil.organizeData(DateTime.Now);
            List <L5ST_GSTFT_1610> remainingShiftTemplates = new List <L5ST_GSTFT_1610>();
            List <L5ST_GSTFT_1610> tempShiftTemplates      = new List <L5ST_GSTFT_1610>();

            Node foundNode = treeNodeUtil.findNodeForID(companyStructure[0], Parameter.StructurePartID);
            if (foundNode != null)
            {
                treeNodeUtil.getParentIDsForStructurePart(foundNode, structurePartsList);

                L5ST_GSTFT_1610[] shiftTemplates = cls_Get_ShiftTemplates_For_Tenant.Invoke(Connection, Transaction, securityTicket).Result;

                foreach (var structureID in structurePartsList)
                {
                    tempShiftTemplates = shiftTemplates.Where(i => (i.CMN_STR_Office_RefID == structureID && structureID != Guid.Empty) || (i.CMN_STR_Workarea_RefID == structureID && structureID != Guid.Empty) || (i.CMN_STR_Workplace_RefID == structureID && structureID != Guid.Empty) || (i.CMN_STR_Workplace_RefID == Guid.Empty && i.CMN_STR_Workarea_RefID == Guid.Empty && i.CMN_STR_Office_RefID == Guid.Empty)).ToList();
                    foreach (var shiftTemplate in tempShiftTemplates)
                    {
                        if (!remainingShiftTemplates.Contains(shiftTemplate))
                        {
                            remainingShiftTemplates.Add(shiftTemplate);
                        }
                    }
                }
            }
            returnValue.Result.ShiftTemplates = remainingShiftTemplates.ToArray();

            //Put your code here
            return(returnValue);

            #endregion UserCode
        }
Exemplo n.º 2
0
    //查看
    void Show1_ShowClickEvent(object sender, EventArgs e)
    {
        ArrayList selectedNodes = TreeNodeUtil.GetSelectedTreeNodes(this.treeMenu.Nodes[0]);

        if (selectedNodes.Count == 0)
        {
            JSUtility.Alert("请选择一个要编辑的节点!");
        }
        else if (selectedNodes.Count == 1)
        {
            string menuId = ((TreeNode)selectedNodes[0]).Value;
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "<Script language=JavaScript>show_method(" + menuId + ")</Script>");
        }
        else
        {
            JSUtility.Alert("只能选择一个要编辑的节点!");
        }
    }
Exemplo n.º 3
0
    // copy
    void TopButtons1_SearchClickEvent(object sender, EventArgs e)
    {
        ArrayList selectedNodes = TreeNodeUtil.GetSelectedTreeNodes(this.treeMenu.Nodes[0]);

        if (selectedNodes.Count == 0)
        {
            JSUtility.Alert("请选择一个节点!");
        }
        else if (selectedNodes.Count == 1)
        {
            string menuId = ((TreeNode)selectedNodes[0]).Value;
            Response.Redirect(String.Format("CopyMenu.aspx?MenuId={0}", menuId), true);
        }
        else
        {
            JSUtility.Alert("只能选择一个节点!");
        }
    }
Exemplo n.º 4
0
    //删除
    void Delete1_DeleteClickEvent(object sender, EventArgs e)
    {
        ArrayList selectedNodes = TreeNodeUtil.GetSelectedTreeNodes(this.treeMenu.Nodes[0]);

        if (selectedNodes.Count == 0)
        {
            JSUtility.Alert("请选择要删除的页节点!");
        }
        else
        {
            int[]  selectedIds = new int[selectedNodes.Count];
            string typeList    = "";
            for (int i = 0; i < selectedNodes.Count; i++)
            {
                selectedIds[i] = Convert.ToInt32(((TreeNode)selectedNodes[i]).Value);
                typeList      += "《" + ((TreeNode)selectedNodes[i]).Text + "》";

                /*日志归档*/
                //  string sql = @"select l.Description as title from T_Permission l where PermissionId=" + selectedIds[i].ToString() + "";
                //  PubFunction.InsertLog("系统管理", "菜单管理", "菜单列表", "删除", sql, selectedIds[i].ToString());
            }
            bool sucess = this.bll.Delete(selectedIds);
            if (sucess)
            {
                LogAdd.CreateLog(HttpContext.Current.Session["UserId"].ToString(), "删除菜谱分类" + typeList + "", "删除", "", "", HttpContext.Current.Request.Url.ToString());

                JSUtility.Alert("删除菜单项成功!");
            }
            else
            {
                JSUtility.Alert("包含子节点的菜单项无法删除,子节点已删除!");
            }
            this.treeMenu.Nodes.Clear();
            //this.treeMenu.Nodes.Add(this._menu.GetMenuTree(false));
            BindTreeView();
        }
    }
Exemplo n.º 5
0
 public ArrayList GetSelectedTreeNodes(TreeNode root)
 {
     return(TreeNodeUtil.GetSelectedTreeNodes(root));
 }
        protected static FR_L5CM_CSNU_1524 Execute(DbConnection Connection, DbTransaction Transaction, P_L5CM_CSNU_1524 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5CM_CSNU_1524();

            StructureBuilderUtil structureBuilderUtil = new StructureBuilderUtil();
            TreeNodeUtil         treeNodeUtil         = new TreeNodeUtil();

            structureBuilderUtil.company         = cls_Get_Company_Structure_For_Tenant.Invoke(Connection, Transaction, securityTicket).Result;;
            structureBuilderUtil.sessionToken    = securityTicket.SessionTicket;
            structureBuilderUtil.addEmployees    = false;
            structureBuilderUtil.sessionSettings = cls_Get_Settings_For_Tenant.Invoke(Connection, Transaction, securityTicket).Result;
            structureBuilderUtil.startDate       = cls_Get_CalculationTimeFramesForTenant.Invoke(Connection, Transaction, securityTicket).Result.Min(x => x.CalculationTimeframe_StartDate).Date;
            structureBuilderUtil.endDate         = DateTime.Now;
            structureBuilderUtil.hidenNodeType   = CompanyStructureType.None;
            structureBuilderUtil.employees       = new L5EM_GEFT_0959[0];

            EmployeeUtils employeeUtil = new EmployeeUtils();
            structureBuilderUtil.employeeUtil = employeeUtil;
            returnValue.Result = new L5CM_CSNU_1524();
            List <Node> companyStructure = structureBuilderUtil.organizeData(DateTime.Now);

            Node node = treeNodeUtil.findNodeForID(companyStructure[0], Parameter.ParentRefID);
            if (node != null && node.Children.Count != 0)
            {
                if (node.Children[0].data is L5OF_GOFT_1157)
                {
                    var officeQuery = new ORM_CMN_STR_Office.Query();
                    officeQuery.Tenant_RefID     = securityTicket.TenantID;
                    officeQuery.IsDeleted        = false;
                    officeQuery.Office_ShortName = Parameter.ShortName;
                    var officeQueryRes = ORM_CMN_STR_Office.Query.Search(Connection, Transaction, officeQuery);

                    if (officeQueryRes.Count > 0)
                    {
                        if (officeQueryRes.Count > 0)
                        {
                            returnValue.Result.OfficeID        = officeQueryRes[0].CMN_STR_OfficeID;
                            returnValue.Result.OfficeShortName = officeQueryRes[0].Office_ShortName;
                        }
                    }
                }
                else if (node.Children[0].data is L5WA_GWAFT_1201)
                {
                    var workareaQuery = new ORM_CMN_STR_PPS_WorkArea.Query();
                    workareaQuery.Tenant_RefID = securityTicket.TenantID;
                    workareaQuery.IsDeleted    = false;
                    workareaQuery.ShortName    = Parameter.ShortName;
                    if (node.data is L5WA_GWAFT_1201)
                    {
                        workareaQuery.Parent_RefID = Parameter.ParentRefID;
                    }
                    else
                    {
                        workareaQuery.Office_RefID = Parameter.ParentRefID;
                    }

                    var workareaQueryRes = ORM_CMN_STR_PPS_WorkArea.Query.Search(Connection, Transaction, workareaQuery);
                    if (workareaQueryRes.Count > 0)
                    {
                        returnValue.Result.WorkAreaID        = workareaQueryRes[0].CMN_STR_PPS_WorkAreaID;
                        returnValue.Result.WorkAreaShortName = workareaQueryRes[0].ShortName;
                    }
                }
                else if (node.Children[0].data is L5WP_GWFT_1203)
                {
                    var workplaceQuery = new ORM_CMN_STR_PPS_Workplace.Query();
                    workplaceQuery.Tenant_RefID   = securityTicket.TenantID;
                    workplaceQuery.IsDeleted      = false;
                    workplaceQuery.ShortName      = Parameter.ShortName;
                    workplaceQuery.WorkArea_RefID = Parameter.ParentRefID;
                    var workplaceQueryRes = ORM_CMN_STR_PPS_Workplace.Query.Search(Connection, Transaction, workplaceQuery);
                    if (workplaceQueryRes.Count > 0)
                    {
                        if (workplaceQueryRes.Count > 0)
                        {
                            returnValue.Result.WorkPlaceID        = workplaceQueryRes[0].CMN_STR_PPS_WorkplaceID;
                            returnValue.Result.WorkPlaceShortName = workplaceQueryRes[0].ShortName;
                        }
                    }
                }
            }


            return(returnValue);

            #endregion UserCode
        }