Ejemplo n.º 1
0
        public static string ProcessOver(string id)
        {
            string              r    = "";
            BusiWorkFlowBll     snsb = new BusiWorkFlowBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                CB_ProductionProcess p = new CB_ProductionProcess();
                p.id     = Convert.ToInt32(id);
                p.odate  = DateTime.Now.ToString();
                p.gstate = 1;
                CB_ProductionProcess pp = cbppb.Query(" and id=" + id + "");
                if (cbppb.Update(p))
                {
                    //if (pp.jtype == "h")
                    //{
                    //    cosb.UpState(pp.sid, "ifactorydeliver", 1);
                    //}
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Ejemplo n.º 2
0
        public static ArrayList QueryNextProcess(string id, 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);
                int           rcount = 0;
                int           pcount = 0;
                Sys_ViewTable svt    = svtb.QuerySelCols(emcode, tabcode, iv.u.rcode);
                if (svt == null)
                {
                }
                else
                {
                    CB_ProductionProcess copp = cbppb.Query(" and id=" + id + "");
                    if (copp != null)
                    {
                        where.Append(" and sid='" + copp.sid + "'");
                    }
                    where.Append(CommonBll.SqlWhereReplace(iv.u, svt.sqlcondition));
                    string sfield = svt.sqlcols;
                    lsr = cbppb.QueryList(1, 15, sfield, where.ToString(), " scode desc", ref rcount, ref pcount);
                    if (lsr != null)
                    {
                        foreach (DataRow dr in lsr.Rows)
                        {
                            ArrayList al = new ArrayList();
                            al.Add(bebb.QueryBtnListItems(emcode, iv.u.rcode, "LX", dr[1].ToString()));
                            foreach (DataColumn column in lsr.Columns)
                            {
                                if (column.Caption == "gstate")
                                {
                                    int i = Convert.ToInt32(dr[column].ToString());
                                    al.Add(bppb.ProduceProcessState(i));
                                }
                                else
                                {
                                    al.Add(dr[column].ToString());
                                }
                            }
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }