Example #1
0
        public static string SaveDuty(string adremark, string aduty, string afcode, string afname, string areason, string omoney, string premark, string qmoney, string sid, string stype)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_AfterReModifyOrder co = basob.Query("and sid='" + sid + "'");

                B_AfterReModifyOrder bao = new B_AfterReModifyOrder();
                bao.sid       = sid;
                bao.aduty     = aduty;
                bao.adremark  = adremark;
                bao.fname     = afname;
                bao.fcode     = afcode;
                bao.omoney    = Convert.ToDecimal(omoney);
                bao.qmoney    = Convert.ToDecimal(qmoney);
                bao.premark   = premark;
                bao.settlment = stype;
                bao.areason   = areason == "" ? co.areason : areason;
                if (basob.SaveDuty(bao))
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #2
0
        public static string SetDuty(string sid, ArrayList pduty, string clfs, string om)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                decimal                 blnum = 0;
                StringBuilder           dstr  = new StringBuilder();
                List <B_AfterOrderDuty> lbd   = new List <B_AfterOrderDuty>();
                if (pduty != null)
                {
                    foreach (object[] pdl in pduty)
                    {
                        if (pdl[2].ToString() != "" && pdl[2].ToString() != "0")
                        {
                            B_AfterOrderDuty rd = new B_AfterOrderDuty();
                            rd.sid    = sid;
                            rd.dname  = pdl[0].ToString();
                            rd.dcode  = pdl[1].ToString();
                            rd.dprev  = Convert.ToDecimal(pdl[2].ToString());
                            rd.dmoney = Convert.ToDecimal(pdl[3].ToString());
                            rd.maker  = iv.u.ename;
                            rd.cdate  = DateTime.Now.ToString();
                            lbd.Add(rd);
                            blnum = blnum + rd.dprev;
                            dstr.AppendFormat("{0}-{1}-{2};", rd.dname, rd.dprev, rd.dmoney);
                        }
                    }
                }
                if (blnum > 100)
                {
                    r = "BLB";
                }
                else
                {
                    abodb.Delete(" and sid='" + sid + "'");
                    abodb.AddList(lbd);
                    B_AfterReModifyOrder baso = basob.Query(" and sid='" + sid + "'");
                    if (baso != null)
                    {
                        //if (basob.SetDuty(sid, dstr.ToString(), clfs, Convert.ToDecimal(om)) > 0)
                        //{
                        //    r = "S";
                        //}
                        //else
                        //{
                        //    r = "F";
                        //}
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #3
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);
        }
Example #4
0
        public static string ProductionInHouse(string bcode, string sid, string psids, string remark)
        {
            string r = "";
            SessionUserValidate     iv  = SysValidateBll.ValidateSession();
            B_AfterPartInHouseOrder bio = new B_AfterPartInHouseOrder();

            if (iv.f)
            {
                string eco = "";
                int    pc  = bapihob.CreateNum(sid, psids);
                if (pc != 0)
                {
                    eco = "-" + pc.ToString().PadLeft(2, '0');
                }
                B_AfterReModifyOrder bro = barmob.Query(" and sid='" + sid + "'");
                bio.sid    = CommonBll.GetSid();
                bio.osid   = sid;
                bio.pscode = bro.scode + eco;
                bio.scode  = bro.scode;
                bio.remark = remark;
                bio.maker  = iv.u.ename;
                bio.cdate  = DateTime.Now.ToString();
                bio.plist  = psids;
                if (bapihob.Add(bio) > 0)
                {
                    if (!bagpb.Exists(" and sid='" + sid + "' and psid not in (select psid from dbo.B_AfterPartInHouseProduction where osid='" + sid + "')"))
                    {
                        cosb.UpState(sid, "istoreget", 2);
                        cosb.UpState(sid, "iproduce", 2);
                        EventBtnDo.FireEventBtn(sid, bcode, "1", "产品全部入库");
                    }
                    else
                    {
                        EventBtnDo.FireEventBtn(sid, bcode, "1", "产品部分入库");
                    }
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #5
0
        public static string QueryOrder(string sid)
        {
            string r = "";
            SessionUserValidate  iv = SysValidateBll.ValidateSession();
            B_AfterReModifyOrder ao = new B_AfterReModifyOrder();

            if (iv.f)
            {
                ao        = basob.Query(" and sid='" + sid + "'");
                ao.rcode  = iv.u.rcode;
                ao.tsdate = cofb.Query(" and sid='" + sid + "' and wcode='0096'").edate;
                r         = js.Serialize(ao);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #6
0
        public static string SetServiceOver(string sid, string otype, string odate, string oinfo, string cinfo, string fmoney)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_AfterReModifyOrder bo = basmob.Query(" and sid='" + sid + "'");
                if (bo != null)
                {
                    if (basmob.SetOverInfo(sid, otype, odate, oinfo, cinfo, fmoney))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                B_AfterFreeBackOrder bao = bsob.Query(" and sid='" + sid + "'");
                if (bao != null)
                {
                    if (bsob.SetOverInfo(sid, otype, odate, oinfo, cinfo))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #7
0
        public static string SetFixter(string sid, string azperson)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_AfterReModifyOrder bo = basmob.Query(" and sid='" + sid + "'");
                if (bo != null)
                {
                    if (basmob.SetFixer(sid, azperson))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                B_AfterFreeBackOrder bao = bsob.Query(" and sid='" + sid + "'");
                if (bao != null)
                {
                    if (bsob.SetFixer(sid, azperson))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #8
0
        public static string SetPmethod(string sid, string pmethod)
        {
            string r = "";
            B_AfterReModifyOrder b  = new B_AfterReModifyOrder();
            SessionUserValidate  iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (basob.SetPmethod(sid, pmethod))
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #9
0
        public static string SetTrueMoney(string sid, string cv)
        {
            string r = "";
            B_AfterReModifyOrder b  = new B_AfterReModifyOrder();
            SessionUserValidate  iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (basob.SetTMoney(sid, Convert.ToDecimal(cv)))
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #10
0
        public static string UpdateAppointment(string sid, string cv, string gv, string vv, string sv, string sdv)
        {
            string r = "";
            B_AfterReModifyOrder b  = new B_AfterReModifyOrder();
            SessionUserValidate  iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                b.sid = sid;
                if (cv == null || cv == "")
                {
                    b.sdate = "2000-01-01";
                }
                else
                {
                    b.sdate = CommonBll.GetBdate(cv);
                }
                b.senddate = CommonBll.GetBdate(sdv);
                b.gofee    = Convert.ToDecimal(gv);
                b.servfee  = Convert.ToDecimal(vv);
                b.stext    = sv;
                if (basob.SetAppointment(b))
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #11
0
        public static string SaveOrder(string acity, string address, string aprovince, string areason, string ascode, string asid, string bcode, string city, string citycode, string customer, string dcode, string dname, string emcode, string isfc, string maker, string oscode, string osid, string otype, string ptype, string remark, string sid, string stype, string telephone)
        {
            string r = "";
            SessionUserValidate  iv = SysValidateBll.ValidateSession();
            B_AfterReModifyOrder ao = new B_AfterReModifyOrder();

            if (iv.f)
            {
                ao.acity     = acity;
                ao.aprovince = aprovince;
                if (acity == "")
                {
                    Sys_CityGetAddress sca = scgab.QueryRefFrist(dcode);
                    ao.address = sca != null ? sca.address : "";
                }
                else
                {
                    ao.address = address;
                }
                Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                ao.ascode    = ascode.Trim();
                ao.asid      = asid;
                ao.cdate     = DateTime.Now.ToString();
                ao.city      = city;
                ao.citycode  = citycode;
                ao.customer  = customer;
                ao.dcode     = dcode;
                ao.dname     = dname;
                ao.isbf      = isfc == "1" ? true : false;
                ao.maker     = maker;
                ao.oscode    = oscode;
                ao.osid      = osid;
                ao.otype     = otype;
                ao.ptype     = ptype;
                ao.remark    = remark;
                ao.sendtype  = stype;
                ao.telephone = telephone;
                ao.areason   = areason;
                ao.qytype    = sd != null ? sd.dmattr : "";
                if (sid == "")
                {
                    string cnstr = basob.GetOrderNum().ToString().PadLeft(4, '0');
                    if (cnstr.Length > 4)
                    {
                        cnstr = cnstr.Substring(1, cnstr.Length - 1);
                    }
                    ao.scode = "HF" + DateTime.Now.ToString("yyMM") + cnstr;
                    ao.sid   = CommonBll.GetSid();
                    if (basob.Add(ao) > 0)
                    {
                        r = ao.sid;
                        CB_OrderState cs = new CB_OrderState();
                        cs.sid = ao.sid;
                        cosb.Add(cs);
                        bwfb.CreateWorkFlow(ao.sid, emcode);
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(ao.sid, bcode, "1", "创建返修单");
                }
                else
                {
                    ao.sid = sid;
                    if (basob.Update(ao))
                    {
                        r = ao.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(ao.sid, bcode, "1", "更新返修单");
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }