Esempio n. 1
0
        public static string InitOrderCode(string ccode)
        {
            string              r   = "";
            Sys_OrderCode       soc = new Sys_OrderCode();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (ccode != "")
                {
                    soc = socb.Query(" and ccode='" + ccode + "'");
                    if (soc != null)
                    {
                        r = js.Serialize(soc);
                    }
                }
                else
                {
                    soc.cname = "";
                    soc.id    = 0;
                    soc.ccode = socb.CreateCode().ToString().PadLeft(4, '0');
                    r         = js.Serialize(soc);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Esempio n. 2
0
        public static string CustSaveOrderCode(string ccode, string city, string cname, string id, string inum, string otype, string precode, string years)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_OrderCode sr = new Sys_OrderCode();
                sr.cname    = cname;
                sr.ccode    = ccode;
                sr.inum     = Convert.ToInt32(inum);
                sr.citytype = city;
                sr.emcode   = otype;
                sr.prestr   = precode;
                sr.maker    = iv.u.ename;
                sr.dcode    = iv.u.dcode.Substring(0, 8);
                sr.cdate    = DateTime.Now.ToString();
                if (years != null)
                {
                    sr.years = Convert.ToDateTime(years).ToString("yyyy");
                }
                else
                {
                    sr.years = "";
                }
                if (id == "0")
                {
                    if (socb.Add(sr) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (socb.Update(sr))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Esempio n. 3
0
        public static string SaveOrderCode(string ccode, string ccstr, string cname, string cqstr, string csjsstr, string csource, string ctype, string cystr, string czstr, string id, string inum, string otype, string precode, string years)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_OrderCode sr = new Sys_OrderCode();
                sr.cname    = cname;
                sr.ccode    = ccode;
                sr.inum     = Convert.ToInt32(inum);
                sr.citytype = "";
                sr.ctype    = ctype;
                if (iv.u.rcode == "xtgl")
                {
                    sr.dcode = "";
                }
                else
                {
                    sr.dcode = iv.u.dcode.Substring(0, 8);
                }
                if (ctype == "sl")
                {
                    sr.cqstr = Convert.ToInt32(cqstr);
                    sr.ccstr = Convert.ToInt32(ccstr);
                    sr.czstr = Convert.ToInt32(czstr);
                }
                if (ctype == "rq")
                {
                    sr.cystr   = cystr;
                    sr.csjsstr = Convert.ToInt32(csjsstr);
                }
                sr.years   = years;
                sr.emcode  = otype;
                sr.prestr  = precode;
                sr.csource = csource;
                sr.maker   = iv.u.ename;
                sr.cdate   = DateTime.Now.ToString();
                if (id == "0")
                {
                    if (!socb.Exists(" and emcode='" + otype + "'"))
                    {
                        if (socb.Add(sr) > 0)
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        r = "T";
                    }
                }
                else
                {
                    if (socb.Update(sr))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }