Beispiel #1
0
        public static ArrayList QueryPlatList(string sid)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                DataTable dt = tsb.QueryList("View_B_ProductionProcess", "*", " and sid='" + sid + "'", " order by id asc");
                if (dt != null)
                {
                    int xh = 1;
                    foreach (DataRow dr in dt.Rows)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(xh);
                        al.Add(dr["place"].ToString());
                        al.Add(dr["iname"].ToString());
                        al.Add(dr["place"].ToString());
                        al.Add(dr["gname"].ToString());
                        al.Add(dr["bdate"].ToString());
                        r.Add(al);
                        xh++;
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #2
0
        public static ArrayList QuerySetlment(string bdate, string code, string curpage, string edate, string emcode, string pagesize, string platform, string tabcode, string zt)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                if (code != "")
                {
                    where.AppendFormat(" and scode like '%{0}%'", code);
                }
                if (platform != "")
                {
                    where.AppendFormat(" and dname like '%{0}%'", platform);
                }
                if (bdate != "" && bdate != null)
                {
                    where.AppendFormat(" and cdate >='{0}'", bdate);
                }
                if (edate != "" && edate != null)
                {
                    where.AppendFormat(" and cdate <='{0}'", edate);
                }
                if (zt == "1")
                {
                    where.AppendFormat(" and isetlment ={0} and imoney=2 ", zt);
                }
                else
                {
                    where.AppendFormat(" and isetlment ={0} and imoney=2 ", "0");
                }
                lsr = tsb.QueryList("View_B_SaleOrderMoney", " count(1) as n, isnull(sum(gmoney),0) as m ", " and sid in (select sid from View_B_SaleOrder where 1=1 " + where.ToString() + ") ", "");
                if (lsr != null)
                {
                    ArrayList al = new ArrayList();
                    al.Add(lsr.Rows[0]["n"].ToString());
                    al.Add(lsr.Rows[0]["m"].ToString());
                    r.Add(al);
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #3
0
        public static ArrayList QueryPackageProductionList(string sid)
        {
            ArrayList           r  = new ArrayList();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                DataTable bpqo = tsb.QueryList("View_GPitems", "*", "and sid='" + sid + "' and psid in(select psid from B_PartQualityItems where sid='" + sid + "') and psid not in (select bsid from B_Package where sid='" + sid + "' and bz=1) ", "order by gnum,id ");
                if (bpqo != null)
                {
                    foreach (DataRow dr in bpqo.Rows)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(dr["id"].ToString());
                        al.Add(dr["bnum"].ToString());
                        al.Add(dr["gnum"].ToString());
                        al.Add(dr["pname"].ToString());
                        al.Add(dr["mname"].ToString());
                        al.Add(dr["height"].ToString() + "*" + dr["width"].ToString() + "*" + dr["deep"].ToString());
                        al.Add(dr["pnum"].ToString());
                        for (int i = 0; i < Convert.ToInt32(dr["pnum"].ToString()); i++)
                        {
                            al.Add(1);
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #4
0
        public static string SaleProductionTj(string emcode, string sid, string cols)
        {
            string              r      = "";
            StringBuilder       invhtm = new StringBuilder();
            SessionUserValidate iv     = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                DataTable lb = tsb.QueryList("[View_CB_ProduceTj]", "*", " and sid='" + sid + "'", "  ");
                if (lb != null)
                {
                    DataRow dr = lb.Rows[0];
                    invhtm.AppendFormat("<tr><td colspan='{0}' style='font-weight:bolder;text-align:center'>订单产品统计 门樘:[{1}] / 窗套:[{2}] / 垭口:[{3}] / 门扇:[{4}] </td></tr>", cols, dr["dkm"].ToString(), dr["ct"].ToString(), dr["yk"].ToString(), dr["ms"].ToString());
                    #region//加载表脚
                    invhtm.Append(btb.TempFoot(emcode) + "<br/><br/>");
                    #endregion
                    r = invhtm.ToString();
                }
                else
                {
                    r = invhtm.Append(btb.TempFoot(emcode) + "<br/><br/>").ToString();
                }
            }
            else
            {
                r = invhtm.Append(btb.TempFoot(emcode) + "<br/><br/>").ToString();
            }
            return(r);
        }
Beispiel #5
0
        public static ArrayList QuerySearchOrder(string stype, string sstr)
        {
            ArrayList           r   = new ArrayList();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();
            DataTable           lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            if (iv.f)
            {
                r.Add(iv.badstr);
                string stable = "";
                string sfield = " sid,scode,city,dname,customer,telephone,address";
                if (sstr != "")
                {
                    where.AppendFormat(" and ifactorydeliver>0 and (customer like '%{0}%' or scode like '%{0}%' or city like '%{0}%' or dname like '%{0}%' or telephone like '%{0}%')", sstr);
                }
                if (stype == "mm")
                {
                    stable = "View_B_YqSaleOrder";
                }
                DataTable dt = tsb.QueryList(stable, sfield, where.ToString(), " order by id desc");
                if (dt != null)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        ArrayList al = new ArrayList();
                        foreach (DataColumn column in dt.Columns)
                        {
                            al.Add(dr[column].ToString());
                        }
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #6
0
        public static string ExportSaleOrder(string bdate, string city, string code, string customer, string dname, string edate, string emcode, string otype, string tabcode)
        {
            string    r   = "";
            DataTable lsr = new DataTable();
            ArrayList row = new ArrayList();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (customer != "")
                {
                    where.AppendFormat(" and customer like '%{0}%'", customer);
                }
                if (code != "")
                {
                    where.AppendFormat(" and scode like '%{0}%'", code);
                }
                if (city != "")
                {
                    where.AppendFormat(" and e_city like '%{0}%'", city);
                }
                if (dname != "")
                {
                    where.AppendFormat(" and dname like '%{0}%'", dname);
                }
                if (bdate != "" && bdate != null)
                {
                    where.AppendFormat(" and cdate >='{0}'", bdate);
                }
                if (edate != "" && edate != null)
                {
                    where.AppendFormat(" and cdate <='{0}'", edate);
                }
                Sys_ViewTable svt = svtb.QuerySelCols(emcode, tabcode, iv.u.rcode);
                if (svt == null)
                {
                }
                else
                {
                    where.Append(CommonBll.SqlWhereReplace(iv.u, svt.sqlcondition));
                    string sfield = svt.sqlcols;
                    lsr = tsb.QueryList(svt.tname, svt.esqlcols, svt.sqlcondition, " order by id desc");
                    if (lsr != null)
                    {
                        foreach (DataRow dr in lsr.Rows)
                        {
                            ArrayList al = new ArrayList();
                            foreach (DataColumn column in lsr.Columns)
                            {
                                if (column.Caption == "zt")
                                {
                                    al.Add("<span style='color:blue; font-weight:bolder'>" + cbeb.GetOrderState(dr[1].ToString()) + "</span>");
                                }
                                else
                                {
                                    if (column.Caption == "sid")
                                    {
                                    }
                                    else
                                    {
                                        al.Add(dr[column].ToString());
                                    }
                                }
                            }
                            row.Add(al);
                        }
                    }
                }
                r = beb.ExportHtm(otype, svt.ecols, row);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #7
0
        public static ArrayList QueryBalanceTj(string bdate, string city, string dcode, string edate, string emcode, string tabcode)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            StringBuilder       htmstr = new StringBuilder();
            SessionUserValidate iv     = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                string b      = "";
                string e      = "";
                int    rcount = 0;
                int    pcount = 0;
                if (bdate == null || bdate == "")
                {
                    b = CommonBll.GetBdate2();
                }
                else
                {
                    b = CommonBll.GetBdate(bdate);
                }
                if (edate == null || edate == "")
                {
                    e = CommonBll.GetEdate();
                }
                else
                {
                    e = CommonBll.GetEdate(edate);
                }
                if (dcode == "")
                {
                }
                else
                {
                    where.AppendFormat(" and dcode = '{0}'", dcode);
                }
                if (city == "")
                {
                }
                else
                {
                    where.AppendFormat(" and e_city like '%{0}%'", city);
                }
                Sys_ViewTable svt  = svtb.QuerySelCols(emcode, tabcode, iv.u.rcode);
                string        sqlw = svt.sqlcondition.Replace("[BDATE]", b).Replace("[EDATE]", e);
                where.Append(CommonBll.SqlWhereReplace(iv.u, sqlw));
                lsr = bsob.QueryList(1, 1000, " * ", where.ToString(), " substring(scode,len(scode)-4,5) asc", ref rcount, ref pcount);
                if (lsr != null)
                {
                    int i = 1;
                    foreach (DataRow dr in lsr.Rows)
                    {
                        int       k        = 1;
                        DataTable plistfwj = new DataTable();
                        DataTable plistwj  = new DataTable();
                        DataTable allplist = new DataTable();
                        string    sqlfwj   = "[iname],[sid], [psid], [gnum],[icode],[uname], [mname], [psize],[place],[direction], [fix], [locktype],[gmoney] , [govermoney],[gothermoney],[pnum]";
                        string    sqlwj    = "distinct([iname]),'' as [sid],'' as [psid],0 as [gnum],'' as [icode],[uname],'' as [mname],'' as [psize],'' as [place],'' as [direction],'' as [fix],'' as [locktype],sum([gmoney]) as [gmoney],sum([govermoney])as [govermoney],sum([gothermoney]) as[gothermoney],sum([pnum]) as[pnum]";
                        decimal   omoney   = 0;
                        plistfwj = tsb.QueryList("View_Tj_SaleBalance", sqlfwj + ", gmoney+govermoney+gothermoney as mm ", " and sid='" + dr["sid"].ToString() + "' and substring(icode,1,2)<>'04'", "");
                        plistwj  = tsb.QueryList("View_Tj_SaleBalance", sqlwj + ", sum(gmoney+govermoney+gothermoney) as mm", " and sid='" + dr["sid"].ToString() + "' and substring(icode,1,2)='04'  group by [iname] ,[uname] ", "");
                        if (plistfwj != null)
                        {
                            k        = k + plistfwj.Rows.Count;
                            allplist = plistfwj.Clone();
                            object[] obj = new object[allplist.Columns.Count];
                            if (plistfwj != null)
                            {
                                for (int ii = 0; ii < plistfwj.Rows.Count; ii++)
                                {
                                    plistfwj.Rows[ii].ItemArray.CopyTo(obj, 0);
                                    allplist.Rows.Add(obj);
                                }
                            }
                            if (plistwj != null)
                            {
                                k = k + plistwj.Rows.Count;
                                for (int ii = 0; ii < plistwj.Rows.Count; ii++)
                                {
                                    plistwj.Rows[ii].ItemArray.CopyTo(obj, 0);
                                    allplist.Rows.Add(obj);
                                }
                            }
                        }
                        else
                        {
                            if (plistwj != null)
                            {
                                //k = k + plistwj.Rows.Count;
                                //allplist = plistwj.Clone();
                                k        = k + plistwj.Rows.Count;
                                allplist = plistwj.Clone();
                                object[] obj = new object[allplist.Columns.Count];
                                for (int ii = 0; ii < plistwj.Rows.Count; ii++)
                                {
                                    plistwj.Rows[ii].ItemArray.CopyTo(obj, 0);
                                    allplist.Rows.Add(obj);
                                }
                            }
                        }
                        #region
                        htmstr.AppendFormat("<tr>");
                        htmstr.AppendFormat("<td rowspan='{0}'>{1}</td>", k, i);
                        htmstr.AppendFormat("<td rowspan='{0}'>{1}</td>", k, dr["dname"].ToString());
                        htmstr.AppendFormat("<td rowspan='{0}'>{1}</td>", k, dr["scode"].ToString());
                        htmstr.AppendFormat("<td rowspan='{0}'>{1}</td>", k, dr["customer"].ToString());
                        htmstr.AppendFormat("<td rowspan='{0}'>{1}</td>", k, dr["gzname"].ToString());
                        htmstr.AppendFormat("<td rowspan='{0}'>{1}</td>", k, dr["e_city"].ToString());
                        htmstr.AppendFormat("<td rowspan='{0}'>{1}</td>", k, dr["address"].ToString());

                        if (k == 1)
                        {
                            htmstr.AppendFormat("<td colspan='11' style='background:#cccccc'>{0}</td>", "小计");
                            htmstr.AppendFormat("<td>{0}</td>", "0");
                            htmstr.AppendFormat("</tr>");
                        }
                        else
                        {
                            if (allplist.Rows.Count > 0)
                            {
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["place"].ToString());
                                htmstr.AppendFormat("<td>{0}</td>", "派的门");
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["iname"].ToString());
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["mname"].ToString());
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["uname"].ToString());
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["psize"].ToString());
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["pnum"].ToString());
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["gmoney"].ToString());
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["govermoney"].ToString());
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["gothermoney"].ToString());
                                htmstr.AppendFormat("<td>{0}</td>", "0");
                                htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[0]["mm"].ToString());
                                htmstr.AppendFormat("</tr>");
                                omoney = omoney + Convert.ToDecimal(allplist.Rows[0]["mm"].ToString());
                                for (int l = 1; l < allplist.Rows.Count; l++)
                                {
                                    htmstr.AppendFormat("<tr>");
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["place"].ToString());
                                    htmstr.AppendFormat("<td>{0}</td>", "派的门");
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["iname"].ToString());
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["mname"].ToString());
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["uname"].ToString());
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["psize"].ToString());
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["pnum"].ToString());
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["gmoney"].ToString());
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["govermoney"].ToString());
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["gothermoney"].ToString());
                                    htmstr.AppendFormat("<td>{0}</td>", "0");
                                    htmstr.AppendFormat("<td>{0}</td>", allplist.Rows[l]["mm"].ToString());
                                    htmstr.AppendFormat("</tr>");
                                    omoney = omoney + Convert.ToDecimal(allplist.Rows[l]["mm"].ToString());
                                }
                                htmstr.AppendFormat("<tr>");
                                htmstr.AppendFormat("<td colspan='11' style='background:#cccccc'>{0}</td>", "小计");
                                htmstr.AppendFormat("<td>{0}</td>", omoney.ToString());
                                htmstr.AppendFormat("</tr>");
                                htmstr.AppendFormat("</tr>");
                            }
                        }
                        #endregion
                        i = i + 1;
                    }
                }
                r.Add(htmstr.ToString());
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #8
0
        public static ArrayList QueryTTaskTj(string bdate, string emcode)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            StringBuilder       wh2 = new StringBuilder();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                DateTime dv = DateTime.Now;
                if (bdate != null && bdate != "")
                {
                    wh2.AppendFormat(" and bdate='{0}'", CommonBll.GetBdate(bdate));
                }
                else
                {
                    wh2.AppendFormat(" and bdate='{0}'", DateTime.Now.ToString("yyyy-MM-dd"));
                }

                Sys_RptTemp srt = srtb.Query(" and emcode='" + emcode + "'");
                if (srt != null)
                {
                    lsr = tsb.QueryList(srt.dbtname, srt.dbcol, wh2.ToString() + srt.dbwhere, " ");
                    if (lsr != null)
                    {
                        int i = 1;
                        foreach (DataRow dr in lsr.Rows)
                        {
                            ArrayList al = new ArrayList();
                            if (lsr.Columns.Contains("xh"))
                            {
                                al.Add(i);
                            }
                            foreach (DataColumn column in lsr.Columns)
                            {
                                switch (column.Caption)
                                {
                                case "id":
                                    break;

                                case "xh":
                                    break;

                                default:
                                    al.Add(dr[column].ToString());
                                    break;
                                }
                            }
                            r.Add(al);
                            i++;
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #9
0
        public static ArrayList QueryTj(string bdate, string edate, string ptype, string ymethod)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                if (bdate != null)
                {
                    bdate = Convert.ToDateTime(bdate).ToString("yyyy-MM-dd");
                }
                else
                {
                    bdate = DateTime.Now.ToString("yyyy-MM-dd");
                }
                if (edate != null)
                {
                    edate = Convert.ToDateTime(edate).AddDays(1).ToString("yyyy-MM-dd");
                }
                else
                {
                    edate = DateTime.Now.ToString("yyyy-MM-dd");
                }

                Sys_Optimize so = sob.Query(" and ocode='" + ptype + "'");
                if (so != null)
                {
                    where.Append(" and ddate>='" + bdate + "' and ddate<'" + edate + "' ");
                    where.Append("  and pcode in (select  pcode from LvErpBase.dbo.Sys_RInventoryOptimize where ocode='" + ptype + "' ) ");
                    string sort = "";
                    if (ymethod == "m-s-p")
                    {
                        sort = " order by pmname, width, pname";
                    }
                    if (ymethod == "m-p-s")
                    {
                        sort = " order by pmname, pname, width";
                    }
                    if (ymethod == "s-p-m")
                    {
                        sort = " order by  pname, width,pmname";
                    }
                    DataTable dt = tsb.QueryList(" B_Tj_ProductionItems", so.pcols, where.ToString(), sort);
                    if (dt != null)
                    {
                        int xh = 1;
                        foreach (DataRow dr in dt.Rows)
                        {
                            ArrayList al = new ArrayList();
                            al.Add(xh);
                            foreach (DataColumn column in dt.Columns)
                            {
                                al.Add(dr[column].ToString());
                            }
                            r.Add(al);
                            xh++;
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #10
0
        public static ArrayList QueryReceiptTj(string bdate, string dcode, string edate, string emcode, string pzt, string tabcode)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);

                Sys_ViewTable svt = svtb.QuerySelCols(emcode, tabcode, iv.u.rcode);
                if (svt == null)
                {
                }
                else
                {
                    string b  = "";
                    string e  = "";
                    string dn = "";
                    if (bdate == null || bdate == "")
                    {
                        b = CommonBll.GetBdate();
                        where.AppendFormat(" and cdate >= '{0}'", b);
                    }
                    else
                    {
                        b = CommonBll.GetBdate(bdate);
                        where.AppendFormat(" and cdate >= '{0}'", b);
                    }
                    if (edate == null || edate == "")
                    {
                        e = CommonBll.GetEdate();
                        where.AppendFormat(" and cdate <= '{0}'", e);
                    }
                    else
                    {
                        e = CommonBll.GetEdate(edate);
                        where.AppendFormat(" and cdate <= '{0}'", e);
                    }
                    if (dcode == "")
                    {
                    }
                    else
                    {
                        where.AppendFormat(" and dcode = '{0}'", dcode);
                    }
                    if (pzt == "")
                    {
                    }
                    else
                    {
                        where.AppendFormat(" and imoney = {0}", pzt);
                    }
                    string sqlw = svt.sqlcondition.Replace("[DNAME]", dn).Replace("[BDATE]", b).Replace("[EDATE]", e);
                    where.Append(CommonBll.SqlWhereReplace(iv.u, sqlw));
                    string sfield = svt.sqlcols;
                    lsr = tsb.QueryList(svt.tname, sfield, where.ToString(), "order by scode desc");
                    if (lsr != null)
                    {
                        int i = 1;
                        foreach (DataRow dr in lsr.Rows)
                        {
                            ArrayList al = new ArrayList();
                            foreach (DataColumn column in lsr.Columns)
                            {
                                string sid = dr[0].ToString();

                                decimal gm = bpb.GetSkMoney(sid);
                                switch (column.Caption)
                                {
                                case "xh":
                                    al.Add(i);
                                    break;

                                case "fkdh":
                                    al.Add("");
                                    break;

                                case "gmoney":
                                    al.Add(gm.ToString());
                                    break;

                                case "pmethod":
                                    al.Add("");
                                    break;

                                case "cmoney":
                                    al.Add(Convert.ToDecimal(dr[column].ToString()) - gm);
                                    break;

                                case "sxfax":
                                    al.Add("0");
                                    break;

                                case "qts":
                                    al.Add("");
                                    break;

                                case "azfs":
                                    al.Add("");
                                    break;

                                default:
                                    al.Add(dr[column].ToString());
                                    break;
                                }
                            }
                            i++;
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #11
0
        public static ArrayList QueryProductions(string bdate, string edate, string productiontype, string tjtype)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            StringBuilder       wh2 = new StringBuilder();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                DateTime dv = DateTime.Now;
                if (productiontype != "")
                {
                    where.Append(" and icode like '" + productiontype + "%'");
                }

                if (bdate != null && bdate != "")
                {
                    wh2.AppendFormat(" and bdate>='{0}'", bdate);
                }
                else
                {
                    wh2.AppendFormat(" and bdate>='{0}'", dv.Year + "-" + dv.Month + "-01");
                }
                if (edate != null && edate != "")
                {
                    wh2.AppendFormat(" and bdate<='{0}'", edate);
                }
                else
                {
                    wh2.AppendFormat(" and bdate<='{0}'", dv.ToString());
                }
                if (tjtype == "x")
                {
                    lsr = tsb.QueryList("B_GroupProduction", " iname,  isnull (sum(inum),0) as n ", where.ToString() + " and sid in (select sid from CB_OrderFlow where wcode='0003' and state=1 " + wh2.ToString() + ")", " group by iname order by n desc");
                }
                else
                {
                    lsr = tsb.QueryList("B_GroupProduction", " mname,  isnull (sum(inum),0) as n ", where.ToString() + " and sid in (select sid from CB_OrderFlow where wcode='0003' and state=1 " + wh2.ToString() + ")", " group by mname order by n desc");
                }

                if (lsr != null)
                {
                    foreach (DataRow dr in lsr.Rows)
                    {
                        ArrayList al = new ArrayList();
                        foreach (DataColumn column in lsr.Columns)
                        {
                            al.Add(dr[column].ToString());
                        }
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #12
0
        public static string QueryOrderTj(string bdate, string edate, string emcode, string pzt, string tabcode)
        {
            string        r    = "";
            StringBuilder hstr = new StringBuilder();
            DataTable     lsr  = new DataTable();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_ViewTable svt = svtb.QuerySelCols(emcode, tabcode, iv.u.rcode);
                if (svt == null)
                {
                }
                else
                {
                    string b = "";
                    string e = "";
                    if (bdate == null || bdate == "")
                    {
                        b = CommonBll.GetBdate2();
                    }
                    else
                    {
                        b = CommonBll.GetBdate(bdate);
                    }
                    if (edate == null || edate == "")
                    {
                        e = CommonBll.GetEdate();
                    }
                    else
                    {
                        e = CommonBll.GetEdate(edate);;
                    }
                    if (pzt != "")
                    {
                        if (pzt == "scz")
                        {
                            where.Append(" and sid in (select sid from CB_orderflow where wcode='0094' and state<1)");
                        }
                        if (pzt == "ysc")
                        {
                            where.Append(" and sid in (select sid from CB_orderflow where wcode='0094' and state=1)");
                        }
                    }
                    string sqlw = svt.sqlcondition.Replace("[dcode]", iv.u.dcode).Replace("[bdate]", b).Replace("[edate]", e);
                    where.Append(CommonBll.SqlWhereReplace(iv.u, sqlw));
                    string sfield = svt.sqlcols;
                    lsr = tsb.QueryList(svt.tname, sfield, where.ToString(), " order by scode desc");
                    if (lsr != null)
                    {
                        int i = 1;
                        foreach (DataRow dr in lsr.Rows)
                        {
                            int rnum = 0;
                            List <B_AfterGroupProduction> lbp = bgb.QueryList(" and sid='" + dr["sid"].ToString() + "' order by id asc");
                            if (lbp != null)
                            {
                                rnum = lbp.Count;
                            }

                            hstr.Append("<tr>");
                            hstr.AppendFormat("<td rowspan='{0}'>{1}</td>", rnum, i.ToString());
                            hstr.AppendFormat("<td rowspan='{0}'>{1}</td>", rnum, dr["scode"].ToString());
                            hstr.AppendFormat("<td rowspan='{0}'>{1}</td>", rnum, dr["oscode"].ToString());
                            hstr.AppendFormat("<td rowspan='{0}'>{1}</td>", rnum, dr["dname"].ToString());
                            hstr.AppendFormat("<td rowspan='{0}'>{1}</td>", rnum, dr["customer"].ToString());
                            hstr.AppendFormat("<td rowspan='{0}'>{1}</td>", rnum, dr["isfc"].ToString() == "True"?"是":"否");
                            hstr.AppendFormat("<td rowspan='{0}'>{1}</td>", rnum, dr["adremark"].ToString());
                            if (rnum > 0)
                            {
                                hstr.AppendFormat("<td>{0}</td>", "1." + lbp[0].place);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].itype);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].sitype);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].msname);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].direction);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].stype);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].height.ToString() + "*" + lbp[0].width.ToString() + "*" + lbp[0].deep.ToString());
                                if (lbp[0].itype == "门板")
                                {
                                    hstr.AppendFormat("<td>{0}</td>", lbp[0].deep.ToString());
                                }
                                else
                                {
                                    hstr.AppendFormat("<td>{0}</td>", lbp[0].pmsd.ToString());
                                }
                                // hstr.AppendFormat("<td>{0}</td>", lbp[0].pnum.ToString());
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].mname);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].glass);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].gsize);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].fixs);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].locks);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].workform);
                                hstr.AppendFormat("<td>{0}</td>", lbp[0].pname + lbp[0].remark);
                                hstr.AppendFormat("<td rowspan='{0}'>{1}</td>", rnum, CommonBll.GetBdate(dr["scdate"].ToString()));
                                hstr.AppendFormat("<td rowspan='{0}'>{1}</td>", rnum, CommonBll.GetBdate(dr["sodate"].ToString()));
                            }
                            else
                            {
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");

                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                                hstr.AppendFormat("<td>{0}</td>", "");
                            }
                            hstr.Append("</tr>");
                            if (rnum > 1)
                            {
                                int pxh = 2;
                                for (int k = 1; k < rnum; k++)
                                {
                                    hstr.Append("<tr>");
                                    hstr.AppendFormat("<td>{0}</td>", pxh.ToString() + "." + lbp[k].place);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].itype);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].sitype);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].msname);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].direction);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].stype);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].height.ToString() + "*" + lbp[k].width.ToString() + "*" + lbp[k].deep.ToString());
                                    if (lbp[k].itype == "门板")
                                    {
                                        hstr.AppendFormat("<td>{0}</td>", lbp[k].deep.ToString());
                                    }
                                    else
                                    {
                                        hstr.AppendFormat("<td>{0}</td>", lbp[k].pmsd.ToString());
                                    }

                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].mname);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].glass);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].gsize);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].fixs);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].locks);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].workform);
                                    hstr.AppendFormat("<td>{0}</td>", lbp[k].pname + lbp[k].remark);
                                    hstr.Append("</tr>");
                                    pxh++;
                                }
                            }
                            i++;
                        }
                    }
                    r = hstr.ToString();
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #13
0
        public static ArrayList QuerySubmitTj(string bdate, string dcode, string edate, string emcode, string tabcode)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                Sys_ViewTable svt = svtb.QuerySelCols(emcode, tabcode, iv.u.rcode);
                if (svt == null)
                {
                }
                else
                {
                    string b = "";
                    string e = "";
                    if (bdate == null || bdate == "")
                    {
                        b = CommonBll.GetBdate2();
                    }
                    else
                    {
                        b = CommonBll.GetBdate(bdate);
                    }
                    if (edate == null || edate == "")
                    {
                        e = CommonBll.GetEdate();
                    }
                    else
                    {
                        e = CommonBll.GetEdate(edate);
                    }
                    if (dcode == "")
                    {
                    }
                    else
                    {
                        where.AppendFormat(" and dcode = '{0}'", dcode);
                    }
                    string sqlw = svt.sqlcondition.Replace("[BDATE]", b).Replace("[EDATE]", e);
                    where.Append(CommonBll.SqlWhereReplace(iv.u, sqlw));
                    string sfield = svt.sqlcols;
                    lsr = tsb.QueryList(svt.tname, sfield, where.ToString(), " order by substring(scode,len(scode)-4,5) asc");
                    if (lsr != null)
                    {
                        int i = 1;
                        foreach (DataRow dr in lsr.Rows)
                        {
                            string    sid   = dr[0].ToString();
                            string[]  wjarr = bgpb.Sjtj(sid, "0401");
                            string[]  gdarr = bgpb.Sjtj(sid, "0402");
                            ArrayList al    = new ArrayList();
                            foreach (DataColumn column in lsr.Columns)
                            {
                                switch (column.Caption)
                                {
                                case "xh":
                                    al.Add(i);
                                    break;

                                case "sjname":
                                    al.Add(wjarr[0]);
                                    break;

                                case "sjnum":
                                    al.Add(wjarr[1]);
                                    break;

                                case "gdname":
                                    al.Add(gdarr[0]);
                                    break;

                                case "gdnum":
                                    al.Add(gdarr[1]);
                                    break;

                                default:
                                    al.Add(dr[column].ToString());
                                    break;
                                }
                            }
                            i++;
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #14
0
        public static ArrayList QueryProductions(string emcode, string tabcode, string bdate, string edate)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                if (bdate != "" && bdate != null)
                {
                    where.AppendFormat(" and scdate >='{0}'", bdate);
                }
                else
                {
                    where.AppendFormat(" and scdate>='{0}'", CommonBll.GetBdate2());
                }
                if (edate != "" && edate != null)
                {
                    where.AppendFormat(" and scdate <='{0}'", edate);
                }
                else
                {
                    DateTime dv = DateTime.Now.AddDays(1);
                    where.AppendFormat(" and scdate<='{0}'", dv.ToString("yyyy-MM-dd"));
                }

                Sys_ViewTable svt = svtb.QuerySelCols(emcode, tabcode, iv.u.rcode);
                lsr = tsb.QueryList(svt.tname, svt.sqlcols, where.ToString(), " order by pid ");
                if (lsr != null)
                {
                    int xh = 1;
                    foreach (DataRow dr in lsr.Rows)
                    {
                        ArrayList al = new ArrayList();
                        foreach (DataColumn column in lsr.Columns)
                        {
                            switch (column.Caption)
                            {
                            case "xh":
                                al.Add(xh);
                                break;

                            case "e_ptype":
                                switch (dr[column].ToString())
                                {
                                case "f":
                                case "s":
                                    al.Add("门扇");
                                    break;

                                case "mt":
                                    al.Add("横挺");
                                    break;

                                case "lb":
                                    al.Add("立挺");
                                    break;

                                case "stl":
                                    al.Add("横L线");
                                    break;

                                case "ltl":
                                    al.Add("竖L线");
                                    break;

                                default:
                                    al.Add(" ");
                                    break;
                                }
                                break;

                            default:
                                al.Add(dr[column].ToString());
                                break;
                            }
                        }
                        xh++;
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #15
0
        public static ArrayList QueryOrderTj(string bdate, string dname, string edate, string emcode, string tabcode)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);

                Sys_ViewTable svt = svtb.QuerySelCols(emcode, tabcode, iv.u.rcode);
                if (svt == null)
                {
                }
                else
                {
                    string b  = "";
                    string e  = "";
                    string dn = "";
                    if (bdate == null || bdate == "")
                    {
                        b = CommonBll.GetBdate2();
                    }
                    else
                    {
                        b = CommonBll.GetBdate(bdate);
                    }
                    if (edate == null || edate == "")
                    {
                        e = CommonBll.GetEdate();
                    }
                    else
                    {
                        e = CommonBll.GetEdate(edate);
                    }
                    if (dname == "")
                    {
                    }
                    else
                    {
                        dn = " and dname like '" + dname + "%'";
                    }
                    string sqlw = svt.sqlcondition.Replace("[DNAME]", dn).Replace("[BDATE]", b).Replace("[EDATE]", e);
                    where.Append(CommonBll.SqlWhereReplace(iv.u, sqlw));
                    string sfield = svt.sqlcols;
                    lsr = tsb.QueryList(svt.tname, sfield, where.ToString(), " order by scode desc");
                    if (lsr != null)
                    {
                        int i = 1;
                        foreach (DataRow dr in lsr.Rows)
                        {
                            ArrayList al = new ArrayList();
                            foreach (DataColumn column in lsr.Columns)
                            {
                                string sid = dr[0].ToString();
                                switch (column.Caption)
                                {
                                case "xh":
                                    al.Add(i);
                                    break;

                                case "money":
                                    al.Add(0);
                                    break;

                                case "pmoney":
                                    al.Add(0);
                                    break;

                                case "mss":
                                    al.Add(bgb.TjProductionMsNum(sid));
                                    break;

                                case "mts":
                                    al.Add(bgb.TjProductionCNum(" and sid='" + sid + "' and substring(icode,1,2)='02'"));
                                    break;

                                case "cts":
                                    al.Add(bgb.TjProductionCNum(" and sid='" + sid + "' and substring(icode,1,2)='06'"));
                                    break;

                                case "yks":
                                    al.Add(bgb.TjProductionCNum(" and sid='" + sid + "' and substring(icode,1,2)='07'"));
                                    break;

                                case "wjs":
                                    al.Add(bgb.TjProductionQtNum(" and sid='" + sid + "' and substring(icode,1,2)='04'"));
                                    break;

                                case "qts":
                                    al.Add(bgb.TjProductionQtNum(" and sid='" + sid + "' and( substring(icode,1,2)='08'or substring(icode,1,2)='09'"));
                                    break;

                                case "azfs":
                                    al.Add("");
                                    break;

                                default:
                                    al.Add(dr[column].ToString());
                                    break;
                                }
                            }
                            i++;
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #16
0
        public static ArrayList BlQueryProductions(string bdate, string emcode, string tabcode)
        {
            ArrayList r   = new ArrayList();
            DataTable lsr = new DataTable();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                Sys_RptTemp srt = srtb.Query(" and emcode='" + emcode + "'");
                if (srt != null)
                {
                    DateTime dv = DateTime.Now;
                    if (bdate != null && bdate != "")
                    {
                        where.AppendFormat(" and edate='{0}' ", CommonBll.GetBdate(bdate));
                    }
                    else
                    {
                        where.AppendFormat(" and edate='{0}' ", CommonBll.GetBdate(DateTime.Now.ToString()));
                    }
                    if (iv.u.dcode != "")
                    {
                        string sqlw = srt.dbwhere.Replace("[dcode]", iv.u.dcode.Substring(0, iv.u.dcode.Length - 4));
                        where.Append(CommonBll.SqlWhereReplace(iv.u, sqlw));
                    }
                    string sfield = srt.dbcol;
                    lsr = tsb.QueryList(srt.dbtname, sfield, where.ToString(), " order by edate asc");
                    if (lsr != null)
                    {
                        int xh = 1;
                        foreach (DataRow dr in lsr.Rows)
                        {
                            ArrayList al = new ArrayList();
                            foreach (DataColumn column in lsr.Columns)
                            {
                                switch (column.Caption)
                                {
                                case "xh":
                                    al.Add(xh);
                                    break;

                                case "sid":
                                    break;

                                default:
                                    al.Add(dr[column].ToString());
                                    break;
                                }
                            }
                            xh++;
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }