Пример #1
0
        public static ArrayList CustQueryList()
        {
            ArrayList r = new ArrayList();
            Sys_ComputeFunctionBll     srb = new Sys_ComputeFunctionBll();
            List <Sys_ComputeFunction> lsf = new List <Sys_ComputeFunction>();
            SessionUserValidate        iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                lsf = srb.QueryList(" and dcode ='" + iv.u.dcode.Substring(0, 8) + "'");
                if (lsf != null)
                {
                    foreach (Sys_ComputeFunction s in lsf)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(s.fcode);
                        al.Add(s.fname);
                        al.Add(s.fattr);
                        al.Add(s.fstr);
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Пример #2
0
        public static string CustSaveComputeMethod(string fcode, string fgs, string fid, string flx, string fname, string ftx)
        {
            string r = "";
            Sys_ComputeFunctionBll srb = new Sys_ComputeFunctionBll();
            SessionUserValidate    iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_ComputeFunction sr = new Sys_ComputeFunction();
                sr.fname = fname;
                sr.fcode = fcode;
                sr.fattr = flx;
                sr.fstr  = fgs;
                sr.ftx   = "";
                sr.dcode = iv.u.dcode.Substring(0, 8);
                sr.cdate = DateTime.Now.ToString();
                sr.maker = iv.u.ename;
                if (fid == "0")
                {
                    if (!srb.Exists(" and fname='" + fname + "'"))
                    {
                        if (srb.Add(sr) > 0)
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        r = "T";
                    }
                }
                else
                {
                    if (!srb.Exists(" and fname='" + fname + "' and fcode<>'" + fcode + "'"))
                    {
                        if (srb.Update(sr))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        r = "T";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Пример #3
0
        public static string InitComputeMethod(string fcode)
        {
            string r = "";
            Sys_ComputeFunction    sr  = new Sys_ComputeFunction();
            Sys_ComputeFunctionBll srb = new Sys_ComputeFunctionBll();
            SessionUserValidate    iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_ComputeFunction csr = srb.Query(" and fcode='" + fcode + "'");
                if (csr != null)
                {
                    r = js.Serialize(csr);
                }
                else
                {
                    sr.fname = "";
                    sr.fcode = srb.CreateCode().ToString().PadLeft(4, '0');
                    sr.id    = 0;
                    r        = js.Serialize(sr);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Пример #4
0
        public static string GetProductionCm(string pcode, string ptx)
        {
            string r = "";
            Sys_ComputeFunctionBll srb = new Sys_ComputeFunctionBll();
            SessionUserValidate    iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r = srb.GetProductionCm(pcode, ptx);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Пример #5
0
        public static ArrayList QueryByTypeList(string ctype)
        {
            ArrayList r = new ArrayList();
            Sys_ComputeFunctionBll     srb = new Sys_ComputeFunctionBll();
            List <Sys_ComputeFunction> lsf = new List <Sys_ComputeFunction>();
            SessionUserValidate        iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                string where = "";
                if (iv.u.rcode != "xtgl")
                {
                    where = "  and fattr='" + ctype + "' and dcode ='" + iv.u.dcode.Substring(0, 8) + "'";
                }
                else
                {
                    where = " and fattr='" + ctype + "'";
                }
                lsf = srb.QueryList(where);
                if (lsf != null)
                {
                    foreach (Sys_ComputeFunction s in lsf)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(s.fcode);
                        al.Add(s.fname);
                        al.Add(s.fattr);
                        al.Add(s.fstr);
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Пример #6
0
        public static string DelComputeMethod(string fcode)
        {
            string r = "";
            Sys_ComputeFunctionBll srb = new Sys_ComputeFunctionBll();
            SessionUserValidate    iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (srb.Delete(" and fcode='" + fcode + "'"))
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }