Пример #1
0
        public static string SetGroupMenu(string gcode, string menulist)
        {
            string              r   = "";
            Sys_GroupBll        sgb = new Sys_GroupBll();
            ArrayList           al  = new ArrayList();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sgb.DelGroupMenu(gcode);
                string[] mlarr = menulist.Split(';');
                for (int i = 0; i < mlarr.Length; i++)
                {
                    int arrstr    = mlarr[i].Length;
                    int arrstrlen = arrstr / 2;
                    if (arrstrlen >= 1)
                    {
                        for (int k = 1; k <= arrstrlen; k++)
                        {
                            string leftcode = mlarr[i].Substring(0, k * 2);
                            if (!al.Contains(leftcode))
                            {
                                al.Add(leftcode);
                            }
                        }
                    }
                }
                if (al.Count > 0)
                {
                    DataTable dt = new DataTable();
                    dt.Columns.Add(new DataColumn("gcode", typeof(string)));
                    dt.Columns.Add(new DataColumn("mcode", typeof(string)));

                    for (int i = 0; i < al.Count; i++)
                    {
                        dt.Rows.Add(new object[] { gcode, al[i] });
                    }
                    if (sgb.SetGroupMenu(dt) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Пример #2
0
        public static string ReSetGroupMenu(string gcode)
        {
            string              r   = "";
            Sys_GroupBll        sgb = new Sys_GroupBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (sgb.DelGroupMenu(gcode) > 0)
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }