示例#1
0
        public static string QueryMzOrder(string sid)
        {
            string              r   = "";
            B_QbqqSaleOrder     bms = new B_QbqqSaleOrder();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (sid == "")
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                    bms.id       = 0;
                    bms.city     = sd.dpname;
                    bms.citycode = sd.dpcode;
                    bms.dcode    = iv.u.dcode;
                    bms.dname    = iv.u.dname;
                    bms.maker    = iv.u.ename;
                }
                else
                {
                    bms = bmsob.Query("and sid='" + sid + "'");
                    //bms.ztimg = bosb.QueryOrderStateImg(sid);
                }
                r = js.Serialize(bms);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#2
0
        public JsonResult InitAddr(string id, string dcode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_AddressList sal = new Sys_AddressList();
                if (id != "")
                {
                    sal = salb.Query(" and  id=" + id + "");
                }
                else
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                    sal.id     = 0;
                    sal.adcode = sd == null ? "" : sd.dcode;
                    sal.adname = sd == null ? "" : sd.dname;
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
示例#3
0
        public static string InitAddOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();
            B_AfterApplyOrder   ao = new B_AfterApplyOrder();

            if (iv.f)
            {
                #region//存在原单
                if (sid != "")
                {
                    ao = bsob.Query(" and sid='" + sid + "'");
                }
                #endregion
                #region//不存在原单
                if (sid == "")
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                    ao.id       = 0;
                    ao.dcode    = iv.u.dcode;
                    ao.dname    = iv.u.dname;
                    ao.city     = sd.dpname;
                    ao.citycode = sd.dpcode;
                    ao.maker    = iv.u.ename;
                }
                #endregion
                r = js.Serialize(ao);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#4
0
        public JsonResult InitAddr(string dcode, string sacode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_CityGetAddress sal = new Sys_CityGetAddress();
                if (sacode != "")
                {
                    sal = scgab.Query(" and  sacode='" + sacode + "'");
                }
                else
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                    sal.id     = 0;
                    sal.sacode = scgab.CreateCode().ToString().PadLeft(4, '0');
                    sal.dcode  = sd == null ? "" : sd.dcode;
                    sal.dname  = sd == null ? "" : sd.dname;
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
示例#5
0
        public JsonResult InitAccount(string dcode, string acode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sbk_Account sal = new Sbk_Account();
                if (acode != "")
                {
                    sal = sab.Query(" and  acode='" + acode + "'");
                }
                else
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                    sal.id    = 0;
                    sal.dcode = sd == null ? "" : sd.dcode;
                    sal.dname = sd == null ? "" : sd.dname;
                    sal.acode = sab.CreateCode().ToString().PadLeft(4, '0');
                    sal.aname = "A" + DateTime.Now.ToString("yyyyMMdd") + sal.acode;
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
示例#6
0
        public JsonResult InitACapacity(string dcode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_ProduceAllCapacity sal = new Sys_ProduceAllCapacity();
                sal = spacb.Query(" and  dcode='" + dcode + "'");
                if (sal != null)
                {
                    d.d = js.Serialize(sal);
                }
                else
                {
                    Sys_ProduceAllCapacity sal1 = new Sys_ProduceAllCapacity();
                    Sys_Depment            sd   = sdb.Query(" and dcode='" + dcode + "'");
                    sal1.dcode = sd.dcode;
                    sal1.dname = sd.dname;
                    sal1.id    = 0;
                    d.d        = js.Serialize(sal1);
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
示例#7
0
        public JsonResult InitProduce(string dcode, string cccode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_ProductionCapacity sal = new Sys_ProductionCapacity();

                if (cccode != "")
                {
                    sal = spscb.Query(" and  cccode='" + cccode + "'");
                    d.d = js.Serialize(sal);
                }
                else
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                    sal.cccode = spscb.CreateCode().ToString().PadLeft(4, '0');
                    sal.dcode  = dcode;
                    sal.dname  = sd.dname;
                    sal.id     = 0;
                    d.d        = js.Serialize(sal);
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
示例#8
0
        public static ArrayList QueryDayWorkSchedule(string dcode, string wdate)
        {
            ArrayList           r  = new ArrayList();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                if (sd != null)
                {
                    List <B_WorkSchedule> lbw = bwsb.QueryList("  and dcode='" + sd.dcode + "' and curdate='" + wdate + "'");
                    if (lbw != null)
                    {
                        foreach (B_WorkSchedule b in lbw)
                        {
                            ArrayList al = new ArrayList();
                            al.Add(b.id);
                            al.Add(b.title);
                            al.Add(b.btime);
                            al.Add(b.etime);
                            al.Add(b.color);
                            al.Add(b.classname);
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
示例#9
0
        public static ArrayList QueryList(string ptcode)
        {
            ArrayList                r    = new ArrayList();
            Sys_AgentFeeBll          srb  = new Sys_AgentFeeBll();
            List <Sys_AgentFee>      lsf  = new List <Sys_AgentFee>();
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            Sys_DepmentBll           sdb  = new Sys_DepmentBll();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                lsf = srb.QueryList(" and acode='" + ptcode + "'");
                if (lsf != null)
                {
                    foreach (Sys_AgentFee s in lsf)
                    {
                        ArrayList             al  = new ArrayList();
                        Sys_InventoryCategory sic = sicb.Query(" and iccode='" + s.icode + "'");
                        Sys_Depment           dt  = sdb.Query(" and dcode='" + s.acode + "'");
                        al.Add(s.id);
                        al.Add(dt == null?"":dt.dname);
                        al.Add(sic == null?"":sic.icname);
                        al.Add(s.fmoney);
                        al.Add(s.tfmoney);
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
示例#10
0
        public static ArrayList QueryList(string dcode)
        {
            ArrayList           r   = new ArrayList();
            Sys_EmployeeBll     seb = new Sys_EmployeeBll();
            Sys_DepmentBll      sdb = new Sys_DepmentBll();
            Sys_RoleBll         srb = new Sys_RoleBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                List <Sys_Employee> ls = seb.QueryList(" and dcode='" + dcode + "' and estate='true'");
                if (ls != null)
                {
                    foreach (Sys_Employee s in ls)
                    {
                        Sys_Depment dep = sdb.Query(" and dcode='" + s.dcode + "'");
                        Sys_Role    sr  = srb.Query(" and rcode='" + s.rcode + "'");
                        ArrayList   al  = new ArrayList();
                        al.Add(s.eno);
                        al.Add(s.ename);
                        al.Add(dep == null?"":dep.dname);
                        al.Add(sr == null ? "" :sr.rname);
                        al.Add(s.estate == true ? "是" : "否");
                        al.Add(s.elogin == true?"是":"否");
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
示例#11
0
        public static string CustDel(string dcode)
        {
            string              r   = "";
            Sys_DepmentBll      sdb = new Sys_DepmentBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Depment psd = sdb.Query(" and dcode='" + dcode + "'");
                if (psd.dread)
                {
                    r = "R";
                }
                else
                {
                    if (sdb.Delete(dcode))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#12
0
        public static string QueryCustomerOrder(string sid)
        {
            string              r   = "";
            Sys_DepmentBll      sdb = new Sys_DepmentBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_CustormOrder bco = new B_CustormOrder();
                if (sid != "")
                {
                    bco = bcob.Query(" and csid='" + sid + "'");
                }
                else
                {
                    Sys_Depment shop = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                    if (shop != null)
                    {
                        bco.dname      = shop.dname;
                        bco.dcode      = shop.dcode;
                        bco.e_city     = shop.dpname;
                        bco.e_citycode = shop.dpcode;
                    }
                    bco.otype = "销售预定单";
                }
                r = js.Serialize(bco);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#13
0
        public static string QueryYyApi(string dcode)
        {
            string              r   = "";
            API_yyBll           ayb = new API_yyBll();
            Sys_DepmentBll      sdb = new Sys_DepmentBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                API_yy ay = new API_yy();
                if (ayb.Exists(" and dcode='" + dcode + "'"))
                {
                    ay = ayb.Query(" and dcode='" + dcode + "'");
                }
                else
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                    if (sd != null)
                    {
                        ay.dname  = sd.dname;
                        ay.dcode  = sd.dcode;
                        ay.yycode = "";
                    }
                }
                r = js.Serialize(ay);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#14
0
        public static string initCustomer()
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_Customer  bc = new B_Customer();
                Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                if (sd != null)
                {
                    Sys_Depment ct = sdb.Query(" and dcode='" + sd.dpcode + "'");
                    if (ct != null)
                    {
                        bc.aprovince = ct.dpname;
                        bc.acity     = ct.dcity;
                    }
                }
                r = js.Serialize(bc);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#15
0
        public static string SaveFactory(string bcode, string fcode, string fline, string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                int                   dn   = 0;
                Sys_Depment           sd   = sdb.Query(" and dcode='" + fcode + "'");
                B_OrderFacotory       bf   = new B_OrderFacotory();
                B_YqAfterSaleOrder    baso = bsob.Query(" and sid='" + sid + "'");
                B_OrderFacotory       bof  = bofb.Query(" and sid='" + sid + "'");
                List <Sys_ProduceCyc> lc   = spcb.QueryCheckList(" and emcode='0006' and dcode='" + fcode + "'");
                if (lc != null)
                {
                    dn = lc[0].cnum;
                }
                bf.dname    = sd != null ? sd.dname : "";
                bf.dcode    = fcode;
                bf.maker    = iv.u.ename;
                bf.sid      = sid;
                bf.overdate = DateTime.Now.AddDays(dn).ToString("yyyy-MM-dd");
                bf.otype    = baso == null ? "" : baso.otype;
                bf.cdate    = DateTime.Now.ToString();
                if (bof != null)
                {
                    if (bofb.Update(bf))
                    {
                        r = "S";
                        bppb.SetProduceProcess(sid, fline);
                        BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "分单");
                        //bcpb.OrderCgComputePrice(sid);
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (bofb.Add(bf) > 0)
                    {
                        r = "S";
                        bppb.SetProduceProcess(sid, fline);
                        BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "分单");
                        //bcpb.OrderCgComputePrice(sid);
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#16
0
        public static string SaveWorkSchedule(string dcode, string wdate, string wtype)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                if (sd != null)
                {
                    int            year  = Convert.ToDateTime(wdate).Year;
                    int            month = Convert.ToDateTime(wdate).Month;
                    B_WorkSchedule bws   = new B_WorkSchedule();
                    bws.dcode     = sd.dcode;
                    bws.dname     = sd.dname;
                    bws.color     = "green";
                    bws.cmonth    = month;
                    bws.cyear     = year;
                    bws.classname = "";
                    bws.cdate     = DateTime.Now.ToString();
                    bws.curdate   = wdate;
                    if (wtype == "上午生产")
                    {
                        bws.title = "上午生产";
                        bws.btime = wdate + " 07:30:00";
                        bws.etime = wdate + " 11:30:00";
                    }
                    if (wtype == "下午生产")
                    {
                        bws.title = "下午生产";
                        bws.btime = wdate + " 13:30:00";
                        bws.etime = wdate + " 17:30:00";
                    }
                    if (wtype == "晚上生产")
                    {
                        bws.title = "晚上生产";
                        bws.btime = wdate + " 19:00:00";
                        bws.etime = wdate + " 23:00:00";
                    }
                    bwsb.Delete(" and dcode='" + sd.dcode + "' and curdate='" + wdate + "' and title='" + wtype + "'");
                    if (bwsb.Add(bws) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#17
0
        public static string LoadSaleOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_YqSaleOrder bco = bsob.Query(" and sid='" + sid + "'");
                if (bco != null)
                {
                    B_CustormOrder bdj = bcob.Query(" and csid='" + bco.csid + "'");
                    r = js.Serialize(bco);
                }
                else
                {
                    Sys_Depment sd  = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                    B_SaleOrder kco = new B_SaleOrder();
                    if (sd != null)
                    {
                        if (sd.dattr == "cs")
                        {
                            Sys_DepmentDpt sdd = sddb.Query(" and dcode='" + sd.dcode + "'");
                            kco.city       = sd.dpname;
                            kco.citycode   = sd.dpcode;
                            kco.dname      = sd.dname;
                            kco.dcode      = sd.dcode;
                            kco.stelephone = sdd != null ? sdd.dcontact : "";
                        }
                        else if (sd.dattr == "dm")
                        {
                            Sys_DepmentDpt sdd = sddb.Query(" and dcode='" + sd.dcode.Substring(0, sd.dcode.Length - 4) + "'");
                            kco.city       = sd.dpname;
                            kco.citycode   = sd.dpcode;
                            kco.dname      = sd.dname;
                            kco.dcode      = sd.dcode;
                            kco.stelephone = sdd != null ? sdd.dcontact : "";
                        }
                        else
                        {
                            kco.city     = "";
                            kco.citycode = "";
                            kco.dname    = "";
                            kco.dcode    = "";
                        }
                    }
                    kco.maker = iv.u.ename;
                    r         = js.Serialize(kco);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#18
0
        public static string initOrder(string sid, string asid)
        {
            string r = "";
            SessionUserValidate  iv = SysValidateBll.ValidateSession();
            B_AfterReModifyOrder ao = new B_AfterReModifyOrder();

            if (iv.f)
            {
                if (sid != "")
                {
                    ao = basob.Query(" and sid='" + sid + "'");
                    r  = js.Serialize(ao);
                }
                else
                {
                    if (asid != "")
                    {
                        B_AfterFreeBackOrder bo = bsob.Query(" and sid='" + asid + "'");
                        ao.city      = bo.city;
                        ao.citycode  = bo.citycode;
                        ao.dcode     = bo.dcode;
                        ao.dname     = bo.dname;
                        ao.acity     = bo.acity;
                        ao.aprovince = bo.aprovince;
                        ao.areason   = bo.areason;
                        ao.ascode    = bo.scode;
                        ao.asid      = bo.sid;
                        ao.osid      = bo.osid;
                        ao.otype     = bo.otype;
                        ao.customer  = bo.customer;
                        ao.telephone = bo.telephone;
                        ao.remark    = bo.remark;
                        ao.maker     = iv.u.ename;
                        ao.oscode    = bo.oscode;
                    }
                    else
                    {
                        Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                        ao.id       = 0;
                        ao.dcode    = iv.u.dcode;
                        ao.dname    = iv.u.dname;
                        ao.city     = sd.dpname;
                        ao.citycode = sd.dpcode;
                        ao.maker    = iv.u.ename;
                    }
                    r = js.Serialize(ao);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#19
0
        public static ArrayList InitWorkSchedule(string mnum)
        {
            ArrayList           r  = new ArrayList();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                int         year  = DateTime.Now.Year;
                int         month = DateTime.Now.Month;
                Sys_Depment sd    = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                if (sd != null)
                {
                    if (sd.dattr == "gc")
                    {
                        if (!bwsb.Exists(" and dcode='" + sd.dcode + "' and cyear=" + year + " and cmonth=" + month + ""))
                        {
                            bwsb.SaveList(sd.dname, sd.dcode, year, month);
                        }
                    }
                    if (mnum != "")
                    {
                        month = Convert.ToInt32(mnum);
                        if (mnum == "1")
                        {
                            year = year + 1;
                        }
                    }
                    List <B_WorkSchedule> lbw = bwsb.QueryList("  and dcode='" + sd.dcode + "' and cyear=" + year + " and cmonth=" + month + "");
                    if (lbw != null)
                    {
                        foreach (B_WorkSchedule b in lbw)
                        {
                            ArrayList al = new ArrayList();
                            al.Add(b.id);
                            al.Add(b.title);
                            al.Add(b.btime);
                            al.Add(b.etime);
                            al.Add(b.color);
                            al.Add(b.classname);
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
示例#20
0
        public static string InitCustomeAccount(string id, string ptype)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                A_CustomeAccount sd = new A_CustomeAccount();
                if (id == "")
                {
                    Sys_Depment sdm = sdb.Query(" and dcode='" + iv.u.dcode + "' and dattr='d'");
                    if (sdm != null)
                    {
                        Sys_Depment sc = sdb.Query(" and dcode='" + sdm.dcode.Substring(0, sdm.dcode.Length - 2) + "' and dattr='s'");
                        if (ptype == "g")
                        {
                            sd.pcate = "补款";
                        }
                        if (ptype == "p")
                        {
                            sd.pcate = "退款";
                        }
                        sd.citycode  = sc.dcode;
                        sd.cityname  = sc.dname;
                        sd.dcode     = sdm.dcode;
                        sd.dname     = sdm.dname;
                        sd.customer  = "";
                        sd.telephone = "";
                        sd.address   = "";
                        sd.pmoney    = 0;
                        sd.id        = 0;
                    }
                    else
                    {
                        r = "PB";
                    }
                }
                else
                {
                    sd = acab.Query(" and gsid='" + id + "'");
                }
                r = js.Serialize(sd);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#21
0
        public JsonResult SavePeriod(string fcode, string gqcode, string gqid, string gqname, string gqnum)
        {
            JsonData             d  = new JsonData();
            Sys_ProductionPeriod sb = new Sys_ProductionPeriod();
            SessionUserValidate  iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Depment sd = sdb.Query("and dcode='" + fcode + "'");
                if (sd != null)
                {
                    sb.fcode = sd.dcode;
                    sb.fname = sd.dname;
                }
                sb.gqname = gqname;
                sb.gqcode = gqcode;
                sb.gqnum  = Convert.ToInt32(gqnum);
                sb.maker  = iv.u.ename;
                sb.cdate  = DateTime.Now.ToString();
                if (gqid == "0")
                {
                    if (sltb.Add(sb) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (sltb.Update(sb))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
示例#22
0
        public static string CustQueryDepmentByDepCode(string dcode)
        {
            string              r    = "";
            VDepment            vsd  = new VDepment();
            Sys_Depment         sd   = new Sys_Depment();
            Sys_DepmentBll      sdb  = new Sys_DepmentBll();
            Sys_DepmentDpt      sdd  = new Sys_DepmentDpt();
            Sys_DepmentDptBll   sddb = new Sys_DepmentDptBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sd  = sdb.Query(" and dcode='" + dcode + "'");
                sdd = sddb.Query(" and dcode='" + dcode + "'");
                if (sd != null)
                {
                    vsd.dcode  = sd.dcode;
                    vsd.dname  = sd.dname;
                    vsd.dpname = sd.dpname;
                    vsd.dpcode = sd.dpcode;
                    vsd.id     = sd.id;
                    vsd.khcode = sd.khcode;
                    vsd.dattr  = sd.dattr;
                    if (sdd != null)
                    {
                        vsd.dmanager = sdd.dmanager;
                        vsd.dcontact = sdd.dcontact;
                    }
                    if (sd.dread)
                    {
                        r = "R";
                    }
                    else
                    {
                        r = js.Serialize(vsd);
                    }
                }
                else
                {
                    r = iv.badstr;
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#23
0
        public static string SaveOrder(string sid, string ncity, string nprovince, string nad)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string      dc = iv.u.dcode;
                Sys_Depment sd = sdb.Query(" and dcode='" + dc + "'");
                B_Customer  bc = bcb.Query(" and sid='" + sid + "'");
                if (bc != null)
                {
                    B_Orders bs = new B_Orders();
                    bs.address   = nad.Trim() == "" ? bs.address : nad;
                    bs.community = "";
                    bs.cdate     = DateTime.Now.ToString();
                    bs.city      = bc.city;
                    bs.citycode  = bc.citycode;
                    bs.csid      = bc.sid;
                    bs.customer  = bc.customer;
                    bs.dcode     = bc.dcode;
                    bs.dname     = bc.dname;
                    bs.telephone = bc.telephone;
                    bs.sid       = CommonBll.GetSid();
                    bs.acity     = ncity;
                    bs.aprovince = nprovince;
                    bs.zcode     = "Z" + DateTime.Now.ToString("yyyyMMddHHmmss");
                    if (bob.Add(bs) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#24
0
        public static string QueryCompany(string dcode)
        {
            string              r    = "";
            Sys_Depment         sd   = new Sys_Depment();
            Sys_DepmentDpt      sdd  = new Sys_DepmentDpt();
            Sys_DepmentBll      sdb  = new Sys_DepmentBll();
            Sys_DepmentDptBll   sddb = new Sys_DepmentDptBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                VDepment vd = new VDepment();
                if (dcode == "")
                {
                    vd.dcode = "0001" + sdb.CreateCode("0001").ToString().PadLeft(4, '0');
                    vd.id    = 0;
                }
                else
                {
                    sd             = sdb.Query(" and dcode='" + dcode + "'");
                    sdd            = sddb.Query(" and dcode='" + dcode + "'");
                    vd.id          = sd.id;
                    vd.dcode       = sd.dcode;
                    vd.dname       = sd.dname;
                    vd.dabc        = sd.dabc;
                    vd.dattr       = sd.dattr;
                    vd.daddress    = sdd.daddress;
                    vd.dcontact    = sdd.dcontact;
                    vd.dmanager    = sdd.dmanager;
                    vd.disused     = sd.disused;
                    vd.iadmin      = sdd.iadmin == true ? "1" : "0";
                    vd.idepment    = sdd.idepment;
                    vd.logo        = sdd.logo;
                    vd.iproduction = sdd.iproduction == true ? "1" : "0";
                }
                r = js.Serialize(vd);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#25
0
        public static ArrayList CustQueryList()
        {
            ArrayList           r   = new ArrayList();
            Sys_EventMenuBll    srb = new Sys_EventMenuBll();
            Sys_DepmentBll      sdb = new Sys_DepmentBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                string where = "";
                if (iv.u.rcode == "xtgl")
                {
                }
                else
                {
                    where = " and dcode like '" + iv.u.dcode.Substring(0, 8) + "%'";
                }
                List <Sys_ProduceCyc> ls = spcb.QueryList(where);
                if (ls != null)
                {
                    foreach (Sys_ProduceCyc s in ls)
                    {
                        Sys_Depment   d  = sdb.Query(" and dcode='" + s.fcode + "'");
                        Sys_EventMenu em = srb.Query(" and emcode='" + s.emcode + "'");
                        ArrayList     al = new ArrayList();
                        al.Add(s.ccode);
                        al.Add(s.cname);
                        al.Add(em == null ? "" : em.emname);
                        al.Add(d == null ? "" : d.dname);
                        al.Add(s.cnum);
                        al.Add(s.otype);
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
示例#26
0
        public static string InitDepmentEx(string pdepcode, string cdcode)
        {
            string              r   = "";
            Sys_Depment         psd = new Sys_Depment();
            Sys_Depment         sd  = new Sys_Depment();
            Sys_DepmentBll      sdb = new Sys_DepmentBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (cdcode == "")
                {
                    psd = sdb.Query(" and dcode='" + pdepcode + "'");
                    if (psd != null)
                    {
                        sd.dpname = psd.dname;
                        sd.dpcode = psd.dcode;
                        sd.dcode  = pdepcode + sdb.CreateCode(psd.dcode).ToString().PadLeft(4, '0');
                        sd.id     = 0;
                        r         = js.Serialize(sd);
                    }
                    else
                    {
                        sd.dpname = "";
                        sd.dpcode = "";
                        sd.dcode  = sdb.CreateCode("").ToString().PadLeft(4, '0');
                        sd.id     = 0;
                        r         = js.Serialize(sd);
                    }
                }
                else
                {
                    sd = sdb.Query(" and dcode='" + cdcode + "'");
                    r  = js.Serialize(sd);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#27
0
        public static string QueryLoginUser()
        {
            string              r   = "";
            Sys_DepmentBll      sdb = new Sys_DepmentBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Depment lay = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                if (lay != null)
                {
                    r = js.Serialize(lay);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#28
0
        public static string InitAfterOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();
            B_YqAfterSaleOrder  ao = new B_YqAfterSaleOrder();
            Sys_Depment         sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");

            if (iv.f)
            {
                ao       = basob.Query(" and sid='" + sid + "'");
                ao.cdate = CommonBll.GetBdate(ao.cdate);
                // ao.ztimg = bosb.QueryOrderStateImg(sid);
                r = js.Serialize(ao);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#29
0
        public static string InitFee(string ptcode, string pcode, string id)
        {
            string                   r    = "";
            Sys_AgentFee             sr   = new Sys_AgentFee();
            Sys_AgentFeeBll          srb  = new Sys_AgentFeeBll();
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            Sys_DepmentBll           sdb  = new Sys_DepmentBll();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_InventoryCategory ic = new Sys_InventoryCategory();
                Sys_Depment           dt = new Sys_Depment();
                if (id == "0" || id == "")
                {
                    ic       = sicb.Query(" and iccode='" + pcode + "'");
                    dt       = sdb.Query(" and dcode='" + ptcode + "'");
                    sr.acode = ptcode;
                    sr.aname = dt.dname;
                    sr.iname = ic.icname;
                    sr.icode = pcode;
                    sr.id    = 0;
                    r        = js.Serialize(sr);
                }
                else
                {
                    sr       = srb.Query(" and id=" + id + "");
                    sr.iname = sicb.Query(" and iccode='" + sr.icode + "'").icname;
                    sr.aname = sdb.Query(" and dcode='" + sr.acode + "'").dname;
                    r        = js.Serialize(sr);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#30
0
        public static string SetOrderPrint(string sid, string bcode)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                if (sd != null)
                {
                    if (sd.dattr == "gc")
                    {
                        cosb.UpState(sid, "iprint", 1);
                        LionVERP.UIServer.BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "");
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }