コード例 #1
0
        public static string SaveDutyCate(string lcode, string lid, string lname, string lpcode, string lpname)
        {
            string r = "";
            Sys_RepairDutyCategory sv = new Sys_RepairDutyCategory();
            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.rccode  = lcode;
                sv.rcname  = lname;
                sv.rcpcode = lpcode;
                sv.rcpname = 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);
        }
コード例 #2
0
        public static string InitDutyCate(string rcpcode, string rccode)
        {
            string r = "";
            Sys_RepairDutyCategory st  = new Sys_RepairDutyCategory();
            Sys_RepairDutyCategory srp = new Sys_RepairDutyCategory();
            SessionUserValidate    iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                srp = srdcb.Query(" and rccode='" + rcpcode + "'");
                if (rccode == "")
                {
                    st.rccode = rcpcode + srdcb.CreateCode(rcpcode).ToString().PadLeft(2, '0');
                    st.rcname = "";
                    if (srp != null)
                    {
                        st.rcpcode = srp.rccode;
                        st.rcpname = srp.rcname;
                    }
                    else
                    {
                        st.rcpcode = "";
                        st.rcpname = "";
                    }
                    st.id = 0;
                }
                else
                {
                    st = srdcb.Query(" and rccode='" + rccode + "'");
                }
                r = js.Serialize(st);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
コード例 #3
0
        public static string CustDelDutyCate(string rccode)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

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