Esempio n. 1
0
        public static string SaveReasonCate(string lcode, string lid, string lname, string lpcode, string lpname)
        {
            string r = "";
            Sys_RepairReasonCategory sv = new Sys_RepairReasonCategory();
            SessionUserValidate      iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (iv.u.rcode == "xtgl")
                {
                    sv.rtype = "";
                    sv.rread = false;
                    sv.isend = true;
                    sv.dcode = "00010001";
                }
                else
                {
                    sv.dcode = iv.u.dcode.Substring(0, 8);
                    sv.rtype = "";
                    sv.rread = false;
                    sv.isend = true;
                }
                sv.rrcode  = lcode;
                sv.rrname  = lname;
                sv.rrpcode = lpcode;
                sv.rrpname = lpname;
                sv.cdate   = DateTime.Now.ToString();
                sv.maker   = iv.u.ename;

                if (lid == "0")
                {
                    if (srdcb.Add(sv) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (srdcb.Update(sv))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Esempio n. 2
0
        public static ArrayList QueryAllList()
        {
            ArrayList           r  = new ArrayList();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                string where = "";
                if (iv.u.rcode != "xtgl")
                {
                    where = " and rrcode in(select rrcode from Sys_RepairReasonCategory where dcode='" + iv.u.dcode.Substring(0, 8) + "')";
                }
                List <Sys_RepairReason> ls = srdb.QueryList(where);
                if (ls != null)
                {
                    foreach (Sys_RepairReason s in ls)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(s.rcode);
                        al.Add(s.rrname);
                        al.Add(s.rdetail);
                        Sys_RepairReasonCategory src = srdcb.Query(" and rrcode='" + s.rrcode + "'");
                        if (src != null)
                        {
                            al.Add(src.rrname);
                        }
                        else
                        {
                            al.Add("");
                        }
                        al.Add(s.rdetail);
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Esempio n. 3
0
        public static string InitReasonCate(string rrpcode, string rrcode)
        {
            string r = "";
            Sys_RepairReasonCategory st  = new Sys_RepairReasonCategory();
            Sys_RepairReasonCategory srp = new Sys_RepairReasonCategory();
            SessionUserValidate      iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                srp = srdcb.Query(" and rrcode='" + rrpcode + "'");
                if (rrcode == "")
                {
                    st.rrcode = rrpcode + srdcb.CreateCode(rrpcode).ToString().PadLeft(2, '0');
                    st.rrname = "";
                    if (srp != null)
                    {
                        st.rrpcode = srp.rrcode;
                        st.rrpname = srp.rrname;
                    }
                    else
                    {
                        st.rrpcode = "";
                        st.rrpname = "";
                    }
                    st.id = 0;
                }
                else
                {
                    st = srdcb.Query(" and rrcode='" + rrcode + "'");
                }
                r = js.Serialize(st);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Esempio n. 4
0
        public static string CustDelReasonCate(string rrcode)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_RepairReasonCategory srrc = srdcb.Query(" and rrcode='" + rrcode + "'");
                if (srrc != null)
                {
                    if (srrc.rread)
                    {
                        r = "R";
                    }
                    else
                    {
                        if (srdcb.Delete(rrcode))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }