コード例 #1
0
ファイル: tUserInfo.cs プロジェクト: fengyubox/SFIS
        /// <summary>
        /// 添加用户ATE权限
        /// </summary>
        /// <param name="lsAteEmp"></param>
        /// <returns></returns>
        public string AddUserAteEmp(string lsAteEmp)
        {
            DbConnection  conn = ProviderHelper.GetConnection(ProConfiguration.GetConfig().DatabaseType, ProConfiguration.GetConfig().DatabaseConnect);
            DbTransaction tx   = ProviderHelper.BeginTransaction(conn);

            try
            {
                IList <IDictionary <string, object> > LsDic = MapListConverter.JsonToListDictionary(lsAteEmp);

                string         table             = "sfcb.b_Ate_Emp".ToUpper();
                IAdminProvider dp                = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
                IDictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("USERID", LsDic[0]["USERID"]);
                dp.DeleteData(tx, table, dic);
                dp.AddListData(tx, table, LsDic);

                tx.Commit();

                return("OK");
            }
            catch (Exception ex)
            {
                tx.Rollback();
                return(ex.Message);
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
        }
コード例 #2
0
        public string CheckPrgVsersion(string Prg_Name, string Prg_Ver)
        {
            string SystemVer = string.Empty;


            int            count             = 0;
            IAdminProvider dp                = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = new Dictionary <string, object>();

            mst.Add("ap_name", Prg_Name);
            System.Data.DataSet ds = dp.GetData("sfcb.b_ap_info", "ap_name,ap_version,ap_desc,ap_type,ap_path", mst, out count);


            if ((ds != null) && (ds.Tables[0].Rows.Count > 0))
            {
                SystemVer = ds.Tables[0].Rows[0]["ap_version"].ToString();
                System.Version SysVer = new Version(SystemVer);
                System.Version PrgVer = new Version(Prg_Ver);
                if (SysVer != PrgVer)
                {
                    return(string.Format(" Current Program Version: {0} \r\n New Program Version:{1}", PrgVer.ToString(), SysVer.ToString()));
                }
            }
            return("OK");
        }
コード例 #3
0
ファイル: tPartStorehousehad.cs プロジェクト: fengyubox/SFIS
        ///// <summary>
        ///// 根据钢网编号,修改仓库和库位
        ///// </summary>
        ///// <param name="trsn"></param>
        ///// <param name="storehouseid"></param>
        ///// <param name="locid"></param>
        ///// <returns></returns>
        //public void UpdateByTrsn(string trsn, string storehouseid, string locid)
        //{
        //    //MySqlCommand cmd = new MySqlCommand();
        //    //cmd.CommandText = "update  SFCR.T_PART_STOREHOUSE_HAD set storehouseId=@storehouseid,locId=@locid where trsn=@trsn ";
        //    //cmd.Parameters.Add("trsn", MySqlDbType.VarChar, 20).Value = trsn;
        //    //cmd.Parameters.Add("storehouseid", MySqlDbType.VarChar, 20).Value = storehouseid;
        //    //cmd.Parameters.Add("locid", MySqlDbType.VarChar, 20).Value = locid;
        //    //return BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);

        //    IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
        //    IDictionary<string, object> mst = new Dictionary<string, object>();
        //    mst.Add("STOREHOUSEID", storehouseid);
        //    mst.Add("LOCID", locid);
        //    mst.Add("TRSN", trsn);
        //    dp.UpdateData("SFCR.T_PART_STOREHOUSE_HAD", new string[] { "TRSN" }, mst);
        //}

        ///// <summary>
        ///// 记录钢网使用次数
        ///// </summary>
        ///// <param name="trsn"></param>
        ///// <param name="total"></param>
        //public void UpdateGangWangUseCount(string trsn, int total)
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "UPDATE SFCR.T_GANGWANG Set usernum=@total+usernum where trsn=@trsn";
        //    cmd.Parameters.Add("total", MySqlDbType.Int32).Value = total;
        //    cmd.Parameters.Add("trsn", MySqlDbType.VarChar, 20).Value = trsn;
        //    BLL.BllMsSqllib.Instance.ExecteNonQuery(cmd);
        //}

        ///// <summary>
        ///// 获取钢网要刷的板子总数
        ///// </summary>
        ///// <param name="kpnumber"></param>
        ///// <returns></returns>
        //public System.Data.DataSet GetGangwangTotal(string kpnumber)
        //{

        //    MySqlCommand cmd = new MySqlCommand();
        //    if (!string.IsNullOrEmpty(kpnumber))
        //    {
        //        cmd.CommandText = "SELECT D.TRSN,C.KPNUMBER,D.STOREHOUSEID,D.LOCID,D.REMARK,SUM(C.QTY) AS TOTAL " +
        //                        "FROM (SELECT A.WOID, A.KPNUMBER, B.QTY FROM SFCR.T_SMT_KP_NORMAL_LOG A, SFCR.T_WO_INFO B " +
        //                        "WHERE A.WOID = B.WOID AND A.KPNUMBER = @sPN GROUP BY A.WOID, A.KPNUMBER, B.QTY) C " +
        //                        "INNER JOIN SFCR.T_PART_STOREHOUSE_HAD D ON C.KPNUMBER = D.KPNUMBER " +
        //                        "GROUP BY C.KPNUMBER, D.TRSN, D.STOREHOUSEID, D.LOCID, D.REMARK ";
        //        cmd.Parameters.Add("sPN", MySqlDbType.VarChar, 30).Value = kpnumber;
        //    }
        //    else
        //    {
        //        cmd.CommandText = "SELECT D.TRSN,C.KPNUMBER,D.STOREHOUSEID,D.LOCID,D.REMARK,SUM(C.QTY) AS TOTAL FROM (SELECT A.WOID, A.KPNUMBER, B.QTY " +
        //                        "FROM SFCR.T_SMT_KP_NORMAL_LOG A, SFCR.T_WO_INFO B WHERE A.WOID = B.WOID AND A.KPNUMBER IN (SELECT KPNUMBER " +
        //                        "FROM SFCR.T_PART_STOREHOUSE_HAD WHERE TRSN LIKE '999999%') GROUP BY A.WOID, A.KPNUMBER, B.QTY) C " +
        //                        "INNER JOIN SFCR.T_PART_STOREHOUSE_HAD D ON C.KPNUMBER = D.KPNUMBER " +
        //                        "GROUP BY C.KPNUMBER, D.TRSN, D.STOREHOUSEID, D.LOCID, D.REMARK ";
        //    }
        //    return BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);


        //}


        ///// <summary>
        ///// 获取在仓库的钢网
        ///// </summary>
        ///// <returns></returns>
        //public System.Data.DataSet GetGangInfoInWare()
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "select trsn,vendercode,kpnumber,storehouseId,locId,case sstatus  when 0 then '仓库' when 1 then '线边仓' when 2 then '生产线' when 3 then '已使用' when 6 then '退回仓库'when 7 then '维修' when 8 then '外借' when 9 then '报废'else '未定义' end as sstatus,recdate,datecode,lotId,remark,userId from SFCR.T_PART_STOREHOUSE_HAD where trsn like '999999%' and sstatus in(0,6,9)";
        //    return BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}


        //public  string GetSeqTrSnInfo()
        //  {
        //      string C_SEQ = string.Empty;
        //      string PRGNAME = "SEQ_PARTID";
        //      MySqlCommand cmd = new MySqlCommand();
        //      cmd.CommandText = "select current_value from sfcb.sequence where name=@PRGNAME";
        //      cmd.Parameters.Add("PRGNAME", MySqlDbType.VarChar).Value = PRGNAME;
        //      DataTable dtSEQ = BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd).Tables[0];
        //      C_SEQ =  dtSEQ.Rows[0][0].ToString().PadLeft(7, '0');
        //      cmd = new MySqlCommand();
        //      cmd.CommandText = "update sfcb.sequence set current_value=current_value+increment where name=@PRGNAME";
        //      cmd.Parameters.Add("PRGNAME", MySqlDbType.VarChar).Value = PRGNAME;
        //      BLL.BllMsSqllib.Instance.ExecteNonQuery(cmd);

        //      return System.DateTime.Now.ToString("yyyyMMdd")+C_SEQ;


        //      //MySqlCommand cmd = new MySqlCommand();
        //      //cmd.CommandText = "SELECT TO_CHAR(SYSDATE(),'YYMMDD')||LPAD(TO_CHAR(SEQ_PARTID.NEXTVAL),7,'0') FROM DUAL";
        //      //return BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd).Tables[0].Rows[0][0].ToString();
        //  }

        //public  void InsertTrSn(Entity.tPartStorehousehad TrSnInfo, out string err)
        //{
        //    err = "";
        //     BLL.BllMsSqllib.Instance.SP_InsertStorehousehadRecount(TrSnInfo, out err);

        //}


        //#region 发料表
        ///// <summary>
        ///// 查询库存最早一天的物料
        ///// </summary>
        ///// <returns></returns>
        //public  System.Data.DataSet QueryKpnumberMoreThanDays(string KpNumber)
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "select  * from SFCR.T_PART_STOREHOUSE_HAD where kpnumber=@kpnumber and sstatus='0' " +
        //                               " and recdate<(select min(recdate) from SFCR.T_PART_STOREHOUSE_HAD  where kpnumber=@kpnumber and sstatus='0')+1  and LIMIT 1001";
        //    cmd.Parameters.Add("kpnumber", MySqlDbType.VarChar, 30).Value = KpNumber;
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);

        //}
        ///// <summary>
        ///// 由料号查询属于哪个工单
        ///// </summary>
        ///// <param name="kpnumber"></param>
        ///// <returns></returns>
        //public  System.Data.DataSet QueryWoid(string woid)
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "select woId from SFCR.T_WO_BOM_INFO where woId=@woid";
        //    cmd.Parameters.Add("woid", MySqlDbType.VarChar, 30).Value = woid;
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}
        //public  System.Data.DataSet QueryWoidByKpnumber(string kpnumber)
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "select WoId,qty from SFCR.T_WO_BOM_INFO where kpnumber=@kpnumber";
        //    cmd.Parameters.Add("kpnumber", MySqlDbType.VarChar, 30).Value = kpnumber;
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}
        ///// <summary>
        ///// 由工单号获取所有料号
        ///// </summary>
        ///// <param name="woid"></param>
        ///// <returns></returns>
        //public System.Data.DataSet GetKpnumberByWoid(string woid,string process)
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    if(process=="SMD")
        //    cmd.CommandText = " select kpnumber,qty,process from SFCR.T_WO_BOM_INFO where woId=@woid and (process=@process or kpdesc like 'PCB%')";
        //    else
        //        cmd.CommandText = " select kpnumber,qty,process from SFCR.T_WO_BOM_INFO where woId=@woid and process=@process";
        //    cmd.Parameters.Add("woid", MySqlDbType.VarChar, 30).Value = woid;
        //    cmd.Parameters.Add("process", MySqlDbType.VarChar, 30).Value = process;
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}
        //#endregion



        ///// <summary>
        ///// 原料出入库查询
        ///// </summary>
        ///// <param name="Flag"></param>
        ///// <param name="QryInOut"></param>
        ///// <returns></returns>
        //public System.Data.DataSet QueryMaterialInputOutQTY(string Flag, Entity.tPartStorehousehadRecount QryInOut)
        //{
        //    string sSQL = "";
        //    string sSQL2 = "";
        //    string sSQL3 = "";


        //    sSQL = "select ";
        //    MySqlCommand cmd = new MySqlCommand();
        //    Dictionary<string, string> nameAndVal = new Dictionary<string, string>();
        //    if (QryInOut.showworkdate)
        //    {
        //        sSQL = sSQL + " WorkDate as 工作日期, ";
        //        sSQL3 = sSQL3 + " WorkDate,";

        //    }
        //    if (QryInOut.showpn)
        //    {
        //        sSQL = sSQL + " kpnumber as 料号, ";
        //        sSQL3 = sSQL3 + " kpnumber,";
        //    }
        //    if (QryInOut.showvc)
        //    {
        //        sSQL = sSQL + " VenderCode as 厂商代码, ";
        //        sSQL3 = sSQL3 + " VenderCode,";
        //    }
        //    if (QryInOut.showdc)
        //    {
        //        sSQL = sSQL + " DateCode as 生产周期, ";
        //        sSQL3 = sSQL3 + " DateCode,";
        //    }
        //    if (QryInOut.showlc)
        //    {
        //        sSQL = sSQL + " LotId as 生产批次, ";
        //        sSQL3 = sSQL3 + " LotId,";
        //    }

        //    if (Flag == "0")
        //    {

        //        sSQL = sSQL + string.Format(" sum(INQTY) as 入库数量,sum(OUTQTY) as 出库数量 from SFCR.T_PART_STOREHOUSE_HAD_RECOUNT where kpnumber=@kpnumber ");
        //        nameAndVal.Add("kpnumber", QryInOut.kpnumber);//2012-11-18号加入
        //        if (!string.IsNullOrEmpty(QryInOut.vendercode))
        //        {
        //            sSQL = sSQL + string.Format(" and VenderCode=@VenderCode ");
        //            nameAndVal.Add("VenderCode", QryInOut.vendercode);//2012-11-18号加入
        //        }
        //        if (!string.IsNullOrEmpty(QryInOut.datecode))
        //        {
        //            sSQL = sSQL + string.Format(" and DateCode=@DateCode ");
        //            nameAndVal.Add("DateCode", QryInOut.datecode);//2012-11-18号加入
        //        }
        //        if (!string.IsNullOrEmpty(QryInOut.lotid))
        //        {
        //            sSQL = sSQL + string.Format(" and LotId=@LotId ");
        //            nameAndVal.Add("LotId", QryInOut.lotid);//2012-11-18号加入
        //        }
        //        sSQL = sSQL + " group by " + sSQL3.Substring(0, sSQL3.Length - 1);

        //        cmd.CommandText = sSQL;
        //        cmd.Parameters.Clear();
        //        foreach (string str in nameAndVal.Keys)
        //        {
        //            cmd.Parameters.Add("@" + str, MySqlDbType.VarChar, 50).Value = nameAndVal[str];
        //        }
        //    }
        //    if (Flag == "1")
        //    {
        //        sSQL2 = "";


        //        sSQL = sSQL + " sum(INQTY) as 入库数量,sum(OUTQTY) as 出库数量 from SFCR.T_PART_STOREHOUSE_HAD_RECOUNT where  ";

        //        if (!string.IsNullOrEmpty(QryInOut.kpnumber))
        //        {
        //            sSQL2 = sSQL2 + string.Format(" and kpnumber=@kpnumber ");
        //            nameAndVal.Add("kpnumber", QryInOut.kpnumber);//2012-11-18号加入
        //        }

        //        if (!string.IsNullOrEmpty(QryInOut.vendercode))
        //        {
        //            sSQL2 = sSQL2 + string.Format(" and VenderCode=@VenderCode ");
        //            nameAndVal.Add("VenderCode", QryInOut.vendercode);//2012-11-18号加入
        //        }
        //        if (!string.IsNullOrEmpty(QryInOut.datecode))
        //        {
        //            sSQL2 = sSQL2 + string.Format(" and DateCode=@DateCode ");
        //            nameAndVal.Add("DateCode", QryInOut.datecode);//2012-11-18号加入
        //        }
        //        if (!string.IsNullOrEmpty(QryInOut.lotid))
        //        {
        //            sSQL2 = sSQL2 + string.Format(" and LotId=@LotId ");
        //            nameAndVal.Add("LotId", QryInOut.lotid);//2012-11-18号加入
        //        }
        //        if (QryInOut.StartTime != "ALL" && QryInOut.EndTime != "ALL")
        //        {
        //            sSQL2 = sSQL2 + string.Format(" and workdate+right('00' + convert(varchar,worksection),2)>=@workdateA and workdate+right('00' + convert(varchar,worksection),2)<@workdateB ",
        //                QryInOut.StartDate + QryInOut.StartTime.Substring(0, 2),
        //                QryInOut.EndDate + QryInOut.EndTime.Substring(0, 2));
        //            nameAndVal.Add("workdateA", QryInOut.StartDate + QryInOut.StartTime.Substring(0, 2));//2012-11-18号加入
        //            nameAndVal.Add("workdateB", QryInOut.EndDate + QryInOut.EndTime.Substring(0, 2));//2012-11-18号加入
        //        }
        //        else
        //        {
        //            sSQL2 = sSQL2 + string.Format(" and WorkDate>=@workdateA and  WorkDate<=@workdateB ", QryInOut.StartDate, QryInOut.EndDate);
        //            nameAndVal.Add("workdateA", QryInOut.StartDate);//2012-11-18号加入
        //            nameAndVal.Add("workdateB", QryInOut.EndDate);//2012-11-18号加入
        //        }

        //        if (QryInOut.sclass != "ALL")
        //        {
        //            sSQL2 = sSQL2 + string.Format(" and class=@class ", QryInOut.sclass);
        //            nameAndVal.Add("class", QryInOut.sclass);//2012-11-18号加入
        //        }

        //        sSQL = sSQL + sSQL2.Substring(5, sSQL2.Length - 5) + " group by " + sSQL3.Substring(0, sSQL3.Length - 1);


        //        cmd.CommandText = sSQL;
        //        cmd.Parameters.Clear();
        //        foreach (string str in nameAndVal.Keys)
        //        {
        //            cmd.Parameters.Add("@" + str, MySqlDbType.VarChar, 50).Value = nameAndVal[str];
        //        }
        //    }
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}

        ///// <summary>
        ///// 查询库存
        ///// </summary>
        ///// <param name="QMS"></param>
        ///// <returns></returns>
        //public  System.Data.DataSet QueryMaterialStocks(Entity.tPartStorehousehad QMS)
        //{
        //    string sSQL = "";
        //    string sSQL2 = "";

        //    sSQL = "select  ";
        //    sSQL2 = " group by ";
        //    MySqlCommand cmd = new MySqlCommand();
        //    Dictionary<string, string> nameAndVal = new Dictionary<string, string>();

        //    if (QMS.ShowPN)
        //    {
        //        sSQL = sSQL + " kpnumber as 料号,";
        //        sSQL2 = sSQL2 + " kpnumber,";
        //    }
        //    if (QMS.ShowVC)
        //    {
        //        sSQL = sSQL + " vendercode as 厂商代码,";
        //        sSQL2 = sSQL2 + " vendercode,";
        //    }
        //    if (QMS.ShowDC)
        //    {
        //        sSQL = sSQL + " datecode as 生产周期,";
        //        sSQL2 = sSQL2 + " datecode,";
        //    }
        //    if (QMS.ShowLC)
        //    {
        //        sSQL = sSQL + " lotid as 生产批次,";
        //        sSQL2 = sSQL2 + " lotid,";
        //    }

        //    if (QMS.ShowLoc)
        //    {
        //        sSQL = sSQL + " locid as 库位,";
        //        sSQL2 = sSQL2 + " locid,";

        //    }

        //    sSQL = sSQL.Substring(0, sSQL.Length - 1);
        //    sSQL2 = sSQL2.Substring(0, sSQL2.Length - 1);


        //    sSQL = sSQL + string.Format(",sum(qty) as 库存数量 from SFCR.T_PART_STOREHOUSE_HAD where kpnumber=@kpnumber ", QMS.KpNumber);
        //    nameAndVal.Add("kpnumber", QMS.KpNumber);//2012-11-18号加入

        //    if (!string.IsNullOrEmpty(QMS.VenderCode))
        //    {
        //        sSQL = sSQL + string.Format(" and vendercode=@vendercode ", QMS.VenderCode);
        //        nameAndVal.Add("vendercode", QMS.VenderCode);//2012-11-18号加入
        //    }
        //    if (!string.IsNullOrEmpty(QMS.DateCode))
        //    {
        //        sSQL = sSQL + string.Format(" and datecode=@datecode ", QMS.DateCode);
        //        nameAndVal.Add("datecode", QMS.DateCode);//2012-11-18号加入
        //    }
        //    if (!string.IsNullOrEmpty(QMS.LotId))
        //    {
        //        sSQL = sSQL + string.Format(" and lotid=@lotid ", QMS.LotId);
        //        nameAndVal.Add("lotid", QMS.LotId);//2012-11-18号加入
        //    }

        //    sSQL = sSQL + " and (sstatus='0' or sstatus='6' ) " + sSQL2;

        //    cmd.CommandText = sSQL;
        //    cmd.Parameters.Clear();
        //    foreach (string str in nameAndVal.Keys)
        //    {
        //        cmd.Parameters.Add( str, MySqlDbType.VarChar, 30).Value = nameAndVal[str];
        //    }
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}

        //public System.Data.DataSet QueryTrsnDetail(string trsn) //查询唯一条码状态
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "select trsn ,userid , case when sstatus=0 then '仓库' " +
        //                      " when sstatus=1 then '线边仓'  when sstatus=2 then '生产线' " +
        //                      " when sstatus=3 then '已使用'  when sstatus=4 then '分盘' " +
        //                      " when sstatus=5 then '生产线待退料' when sstatus=6 then '线边仓退回仓库' else '未定义'  end " +
        //                     " as Location,recdate  from SFCR.T_PART_STOREHOUSE_DTA where trsn=@trsn ";
        //    cmd.Parameters.Add("trsn", MySqlDbType.VarChar, 30).Value = trsn;
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}

        //#region 仓储原料报表
        ///// <summary>
        ///// 获取料号的库存
        ///// </summary>
        ///// <returns></returns>
        //public System.Data.DataSet GetAllMaterialStocks()
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "select KpNumber,sum(INQTY) as INQTY,sum(OUTQTY) as OUTQTY,sum(INQTY)-sum(OUTQTY) as 库存 from SFCR.T_PART_STOREHOUSE_HAD_RECOUNT GROUP By KpNumber";
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}
        ///// <summary>
        ///// 获取料号的所有出入库记录
        ///// </summary>
        ///// <param name="kpnumber"></param>
        ///// <returns></returns>
        //public  System.Data.DataSet GetMaterialInfoByKpnumber(string kpnumber)
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "select b.kpnumber,case a.sstatus when 0 then '仓库' when 1 then '线边仓'when 2 then '生产线' when 3 then '已使用'  when 4 then '分盘' when 5 then '生产线待退料' when 6 then '线边仓退回仓库' else '未定义'end as sstatus,b.qty,a.recdate from SFCR.T_PART_STOREHOUSE_DTA a,SFCR.T_PART_STOREHOUSE_HAD b where a.trsn = b.trsn and b.kpnumber=@kpnumber";
        //    cmd.Parameters.Add("kpnumber", MySqlDbType.VarChar, 20).Value = kpnumber;
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}
        //#endregion*/



        //public  System.Data.DataSet GetGangInfoByVC(string vendercode)
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "select trsn,vendercode,kpnumber,storehouseId,locId,case sstatus  when 0 then '仓库' when 1 then '线边仓' when 2 then '生产线' when 3 then '已使用' when 6 then '退回仓库'when 7 then '维修' when 8 then '外借' when 9 then '报废' end as sstatus,recdate,datecode,lotId,remark,userId from SFCR.T_PART_STOREHOUSE_HAD where vendercode=@vendercode";
        //    cmd.Parameters.Add("vendercode", MySqlDbType.VarChar, 20).Value = vendercode;
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}
        //public  System.Data.DataSet GetGangInfoByKpnumber(string kpnumber)
        //{
        //    MySqlCommand cmd = new MySqlCommand();
        //    cmd.CommandText = "select trsn,vendercode,kpnumber,storehouseId,locId,case sstatus  when 0 then '仓库' when 1 then '线边仓' when 2 then '生产线' when 3 then '已使用' when 6 then '退回仓库'when 7 then '维修' when 8 then '外借' when 9 then '报废' end as sstatus,recdate,datecode,lotId,remark,userId from SFCR.T_PART_STOREHOUSE_HAD where kpnumber=@kpnumber";
        //    cmd.Parameters.Add("kpnumber", MySqlDbType.VarChar, 20).Value = kpnumber;
        //    return  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
        //}

        /// <summary>
        /// 删除一条钢网信息
        /// </summary>
        /// <param name="trsn"></param>
        /// <returns></returns>
        public string DeleteGangInfoByTrsn(string trsn)
        {
            //MySqlCommand cmd = new MySqlCommand();
            //cmd.CommandText = "delete from SFCR.T_PART_STOREHOUSE_DTA where trsn=@trsn ;" +
            //    "delete from SFCR.T_PART_STOREHOUSE_HAD where trsn=@trsn";
            //cmd.Parameters.Add("trsn", MySqlDbType.VarChar, 30).Value = trsn;
            //BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
            DbConnection  conn = ProviderHelper.GetConnection(ProConfiguration.GetConfig().DatabaseType, ProConfiguration.GetConfig().DatabaseConnect);
            DbTransaction tx   = ProviderHelper.BeginTransaction(conn);

            try
            {
                IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
                IDictionary <string, object> mst = new Dictionary <string, object>();
                mst.Add("TRSN", trsn);
                dp.DeleteData(tx, "SFCR.T_PART_STOREHOUSE_DTA", mst);

                mst = new Dictionary <string, object>();
                mst.Add("TRSN", trsn);
                dp.DeleteData(tx, "SFCR.T_PART_STOREHOUSE_HAD", mst);
                tx.Commit();
                return("OK");
            }
            catch (Exception ex)
            {
                tx.Rollback();
                return(ex.Message);
            }
        }
コード例 #4
0
        /// <summary>
        /// 整合了的流程添加方法
        /// </summary>
        /// <param name="routeatt"></param>
        /// <returns></returns>
        //public string InsertRouteAllItme(Entity.tRouteAtt routeatt)
        //{
        //    string _StrErr=InsertRouteAtt(routeatt);
        //    if (_StrErr!="OK")
        //        return "流程XML添加失败" + _StrErr;
        //    foreach (Entity.tRouteInfo routeinfo in routeatt.LsRouteInfo)
        //    {
        //        if (!string.IsNullOrEmpty(InsertRouteInfo(routeinfo)))
        //            return "流程添加失败";

        //        foreach (Entity.tRoutCraftparameter obj in routeinfo.LsRouteCraftparameter)
        //        {
        //            if (InsertRouteCraftParamerter(obj)!="OK")
        //                return "流程工艺及工艺项目添加失败";
        //        }
        //    }
        //    return null;
        //}
        #endregion
        #region

        public string GetRouteCode()
        {
            string num = "0";

            for (int x = 100; x < 1000; x++)
            {
                //MySqlCommand cmd = new MySqlCommand();
                //cmd.CommandText = "select COUNT(1) from SFCB.B_ROUTE_ATT WHERE ROUTGROUPID=@code";
                //cmd.Parameters.Add("code", MySqlDbType.VarChar).Value = x.ToString();
                //num = x.ToString();
                //if (int.Parse(BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd).Tables[0].Rows[0][0].ToString()) == 0)
                //    break;

                string         table            = "SFCB.B_ROUTE_ATT";
                string         fieldlist        = "COUNT(1)";
                int            count            = 0;
                IAdminProvider dp               = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
                Dictionary <string, object> mst = new Dictionary <string, object>();
                mst.Add("ROUTGROUPID", x.ToString());
                num = x.ToString();
                if (int.Parse(dp.GetData(table, fieldlist, mst, out count).Tables[0].Rows[0][0].ToString()) == 0)
                {
                    break;
                }
            }
            return(num);
        }
コード例 #5
0
        /// <summary>
        /// 获取所有的途程信息(routgroupId,craftId,nextrouteId,seq,station_flag,routedesc)
        /// </summary>
        /// <returns></returns>
        public System.Data.DataSet GetAllRouteInfo(string routgroupId)
        {
            //string sSQL = "select routgroupId,craftid,craftname,nextcraftname,seq,station_flag,routedesc from SFCB.B_ROUTE_INFO ";
            //MySqlCommand cmd = new MySqlCommand();

            //if (!string.IsNullOrEmpty(routgroupId))
            //{
            //    sSQL += " WHERE ROUTGROUPID =@ROUTEID ";
            //    cmd.Parameters.AddRange(new MySqlParameter[]
            //    {
            //        new MySqlParameter("ROUTEID",MySqlDbType.VarChar){Value=routgroupId}
            //    });
            //}
            //cmd.CommandText = sSQL;
            //return BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
            string         table             = "SFCB.B_ROUTE_INFO";
            string         fieldlist         = "routgroupId,craftid,craftname,nextcraftname,seq,station_flag,routedesc".ToUpper();
            int            count             = 0;
            IAdminProvider dp                = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = new Dictionary <string, object>();

            if (!string.IsNullOrEmpty(routgroupId))
            {
                mst.Add("ROUTGROUPID", routgroupId);
            }
            return(dp.GetData(table, fieldlist, mst, out count));
        }
コード例 #6
0
        /// <summary>
        /// 添加料站表数据
        /// </summary>
        /// <param name="kpmaster">料站表头数据</param>
        /// <param name="lskpdetalt">料站表身数据列表</param>
        public void InsertMaterTable(string kpmaster, string lskpdetalt)
        {
            string outmasteridTemp;
            string Err;
            IDictionary <string, object>          mst   = MapListConverter.JsonToDictionary(kpmaster);
            IList <IDictionary <string, object> > Lsmst = MapListConverter.JsonToListDictionary(lskpdetalt);

            mPro.PRO_INSERT_SMT_KP_MASTER(mst["LINEID"].ToString(), mst["USERID"].ToString(), mst["PARTNUMBER"].ToString(), mst["MODELNAME"].ToString(), mst["BOMVER"].ToString(), mst["PCBSIDE"].ToString(), mst["RESERVE1"].ToString(), "0", out outmasteridTemp, out Err);

            if (Err != "OK")
            {
                throw new Exception(Err + " 料站表头数据增加失败,请检查");
            }
            IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);

            foreach (Dictionary <string, object> item in Lsmst)
            {
                item["MASTERID"] = outmasteridTemp;
                try
                {
                    dp.AddData("SFCR.T_SMT_KP_DETALT", item);
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message + " 料站表身数据增加失败,请检查[" + item["STATIONNO"] + "]");
                }
            }
        }
コード例 #7
0
        public string CHECK_ROUTE_INFO(string C_ERRFLAG, string C_ROUTECODE, string C_LOCGROUP, string MYGROUP) //2014/12/30 存储过程翻译使用
        {
            //MySqlCommand cmd = new MySqlCommand();
            //cmd.CommandText = " SELECT NEXTCRAFTNAME FROM SFCB.B_ROUTE_INFO  WHERE STATION_FLAG = @C_ERRFLAG AND ROUTGROUPID = @C_ROUTECODE AND CRAFTNAME = @C_LOCGROUP AND NEXTCRAFTNAME = @MYGROUP   LIMIT 1";
            //cmd.Parameters.AddRange(new MySqlParameter[]
            //    {
            //        new MySqlParameter("C_ERRFLAG",MySqlDbType.VarChar){Value=C_ERRFLAG},
            //         new MySqlParameter("C_ROUTECODE",MySqlDbType.VarChar){Value=C_ROUTECODE},
            //              new MySqlParameter("C_LOCGROUP",MySqlDbType.VarChar){Value=C_LOCGROUP},
            //                   new MySqlParameter("MYGROUP",MySqlDbType.VarChar){Value=MYGROUP}
            //    });

            //DataTable dt = BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd).Tables[0];
            string         fieldlist         = "NEXTCRAFTNAME";
            int            count             = 0;
            IAdminProvider dp                = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = new Dictionary <string, object>();

            mst.Add("STATION_FLAG", C_ERRFLAG);
            mst.Add("ROUTGROUPID", C_ROUTECODE);
            mst.Add("CRAFTNAME", C_LOCGROUP);
            mst.Add("NEXTCRAFTNAME", MYGROUP);
            DataTable dt = dp.GetData("SFCB.B_ROUTE_INFO", fieldlist, mst, out count).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(dt.Rows[0]["NEXTCRAFTNAME"].ToString());
            }
            else
            {
                return(null);
            }
        }
コード例 #8
0
ファイル: tSmtKpMonitor.cs プロジェクト: fengyubox/SFIS
        /// <summary>
        /// 检测料站表是否经过确认并返回建立人和确认人
        /// </summary>
        /// <param name="masterId"></param>
        /// <returns></returns>
        public string GetKpMasterIdStatus(string masterId)
        {
            string         table             = "SFCR.T_SMT_KP_MASTER";
            string         fieldlist         = "userId,reserve2,Auditinguser";
            int            count             = 0;
            IAdminProvider dp                = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = new Dictionary <string, object>();

            mst.Add("masterId", masterId);
            DataTable _dt = dp.GetData(table, fieldlist, mst, out count).Tables[0];

            if (_dt != null && _dt.Rows.Count > 0)
            {
                if (int.Parse(_dt.Rows[0]["reserve2"].ToString()) == 1)
                {
                    return(string.Format("EditUser:{0},CheckUser:{1}", _dt.Rows[0]["userId"].ToString(), _dt.Rows[0]["Auditinguser"].ToString()));
                }
                else
                {
                    return("ERROR:QC NO CHECK");
                }
            }
            else
            {
                return("ERROR:NO MasterId");
            }
        }
コード例 #9
0
ファイル: tCraftInfo.cs プロジェクト: fengyubox/SFIS
 /// <summary>
 /// 获取所有的工艺项目及参数
 /// </summary>
 /// <returns></returns>
 public System.Data.DataSet GetAllCraftItme()
 {            
     string fieldlist = "craftId,craftItem,craftparameterdes,upperlimit,lowerlimit,other";
     int count = 0;
     IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
     return dp.GetData("SFCB.B_CRAFT_ITEM", fieldlist, null, out count);
 }
コード例 #10
0
        public void DeletePartKeyParts(string dicstring)
        {
            IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = MapListConverter.JsonToDictionary(dicstring);

            dp.DeleteData(table, mst);
        }
コード例 #11
0
ファイル: tSmtKpMonitor.cs プロジェクト: fengyubox/SFIS
        public void InsertSmtIoData(string dicskm)
        {
            IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = MapListConverter.JsonToDictionary(dicskm);

            dp.AddData("SFCR.T_SMT_KP_MONNITOR", mst);
        }
コード例 #12
0
ファイル: tCustomer.cs プロジェクト: fengyubox/SFIS
        //新建一条记录
        public void InserttCustomer(string Insp)
        {
            IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> dic = MapListConverter.JsonToDictionary(Insp);

            dp.AddData(table, dic);
        }
コード例 #13
0
        public string get_station_qty(string woid, string station, string line)
        {
            string         station_qty       = "0";
            string         wo_qty            = "0";
            string         table             = "SFCR.T_STATION_RECOUNT";
            string         fieldlist         = "CASE WHEN SUM(PASSQTY+FAILQTY) is null then 0 else SUM(PASSQTY+FAILQTY) END";
            int            count             = 0;
            IAdminProvider dp                = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = new Dictionary <string, object>();

            mst.Add("WOID", woid);
            mst.Add("LINEID", line);
            mst.Add("CRAFTID", station);
            DataSet ds = dp.GetData(table, fieldlist, mst, out count);

            if (ds.Tables[0].Rows.Count > 0)
            {
                station_qty = ds.Tables[0].Rows[0][0].ToString();
            }
            DataSet ds_wo = woinfo.GetWoInfo(woid, "", "QTY");

            if (ds_wo.Tables[0].Rows.Count > 0)
            {
                wo_qty = ds_wo.Tables[0].Rows[0]["qty"].ToString();
            }
            return(wo_qty + "/" + station_qty);
        }
コード例 #14
0
        public System.Data.DataSet GET_STN_REC(string C_WORKDATE, string C_WORKSECTION, string WO, string MYGROUP, string LINE)
        {
            //MySqlCommand cmd = new MySqlCommand();
            //cmd.CommandText = " SELECT WOID,CRAFTID,WORKDATE,PARTNUMBER,WORKSECTION,CLASS,CLASSDATE,LINEID,PASSQTY,FAILQTY,RPASSQTY,RFAILQTY,FLAG FROM SFCR.T_STATION_RECOUNT WHERE WORKDATE = @C_WORKDATE AND WORKSECTION = @C_WORKSECTION AND WOID = @WO AND CRAFTID = @MYGROUP AND LINEID = @LINE";
            //cmd.Parameters.AddRange(new MySqlParameter[] {
            //                  new MySqlParameter("C_WORKDATE",MySqlDbType.VarChar){Value=C_WORKDATE},
            //                  new MySqlParameter("C_WORKSECTION",MySqlDbType.VarChar){Value=C_WORKSECTION},
            //                  new MySqlParameter("WO",MySqlDbType.VarChar){Value=WO},
            //                  new MySqlParameter("MYGROUP",MySqlDbType.VarChar){Value=MYGROUP},
            //                  new MySqlParameter("LINE",MySqlDbType.VarChar){Value=LINE}
            //                  });

            //return BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd);
            string         table             = "SFCR.T_STATION_RECOUNT";
            string         fieldlist         = "WOID,CRAFTID,WORKDATE,PARTNUMBER,WORKSECTION,CLASS,CLASSDATE,LINEID,PASSQTY,FAILQTY,RPASSQTY,RFAILQTY,FLAG";
            int            count             = 0;
            IAdminProvider dp                = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = new Dictionary <string, object>();

            mst.Add("WORKDATE", C_WORKDATE);
            mst.Add("WORKSECTION", C_WORKSECTION);
            mst.Add("WOID", WO);
            mst.Add("CRAFTID", MYGROUP);
            mst.Add("LINEID", LINE);
            return(dp.GetData(table, fieldlist, mst, out count));
        }
コード例 #15
0
ファイル: tFacInfo.cs プロジェクト: fengyubox/SFIS
        /// <summary>
        /// 修改工厂信息
        /// </summary>
        /// <param name="facId"></param>
        /// <param name="facinfo"></param>
        public void EditFacInfo(string dicFacinfo)
        {
            IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = MapListConverter.JsonToDictionary(dicFacinfo);

            dp.UpdateData(table, new string[] { "FACID" }, mst);
        }
コード例 #16
0
ファイル: tCraftInfo.cs プロジェクト: fengyubox/SFIS
 /// <summary>
 /// 删除工艺项目
 /// </summary>
 /// <param name="craftId"></param>
 public void DeleteCraftItem(string craftId)
 {         
     IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
     IDictionary<string, object> mst = new Dictionary<string, object>();
     mst.Add("craftId", craftId);
     dp.DeleteData("SFCB.B_CRAFT_ITEM", mst);
 }
コード例 #17
0
ファイル: tReworkDetailInfo.cs プロジェクト: fengyubox/SFIS
        public string Rework_SN(IDictionary <string, object> mst, List <string> LsKeyParts)
        {
            DbConnection  conn   = ProviderHelper.GetConnection(ProConfiguration.GetConfig().DatabaseType, ProConfiguration.GetConfig().DatabaseConnect);
            DbTransaction tx     = ProviderHelper.BeginTransaction(conn);
            string        Colnum = "ESN,WOID,PARTNUMBER,PRODUCTNAME,VERSIONCODE,TYPE,LOCSTATION,STATIONNAME,WIPSTATION,NEXTSTATION,USERID,RECDATE," +
                                   "ERRFLAG,SCRAPFLAG,SN,MAC,IMEI,CARTONNUMBER,TRAYNO,PALLETNUMBER,MCARTONNUMBER,MPALLETNUMBER,LINE,SECTIONNAME,ROUTGROUPID," +
                                   "STORENUMBER,WEIGHTQTY,QA_NO,QA_RESULT,TRACK_NO,ATE_STATION_NO,IN_LINE_TIME,BOMNUMBER,REWORKNO";
            int count = 0;

            try
            {
                IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("ESN", mst["ESN"]);
                DataTable dt_wip_tracking = dp.GetData("SFCR.T_WIP_TRACKING_ONLINE", Colnum, dic, out count).Tables[0];
                if (count > 0)
                {
                    dp.AddListData(tx, "SFCR.T_WIP_UNDO", DataTableToDictionary(dt_wip_tracking));
                }

                if (LsKeyParts.Count > 0)
                {
                    string    colnumKeyPart      = "esn,woId,sntype,snval,station,kpno,recdate".ToUpper();
                    DataTable dt_KeyParts        = dp.GetData("SFCR.T_WIP_KEYPART_ONLINE", colnumKeyPart, dic, out count).Tables[0];
                    DataTable dt_Backup_KeyParts = new DataTable();
                    foreach (string str in colnumKeyPart.Split(','))
                    {
                        dt_Backup_KeyParts.Columns.Add(str, typeof(string));
                    }
                    if (dt_KeyParts.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt_KeyParts.Rows)
                        {
                            if (LsKeyParts.Contains(dr["SNTYPE"].ToString()))
                            {
                                dt_Backup_KeyParts.Rows.Add(dr["ESN"].ToString(), dr["WOID"].ToString(), dr["SNTYPE"].ToString(), dr["SNVAL"].ToString(), dr["STATION"].ToString(), dr["KPNO"].ToString(), dr["RECDATE"].ToString());
                            }
                        }
                    }
                    if (dt_Backup_KeyParts.Rows.Count > 0)
                    {
                        dp.AddListData(tx, "SFCR.T_WIP_KEYPART_UNDO", DataTableToDictionary(dt_Backup_KeyParts));
                        dp.DeleteListData(tx, "SFCR.T_WIP_KEYPART_ONLINE", DataTableToDictionary(dt_Backup_KeyParts));
                    }
                }
                dp.UpdateData(tx, "SFCR.T_WIP_TRACKING_ONLINE", new string[] { "ESN" }, mst);
                tx.Commit();
                return("OK");
            }
            catch (Exception ex)
            {
                tx.Rollback();
                return(ex.Message);
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
        }
コード例 #18
0
ファイル: tCraftInfo.cs プロジェクト: fengyubox/SFIS
        /// <summary>
        /// 添加整个工艺及对应的工艺项目
        /// </summary>
        /// <param name="craftinfo"></param>
        /// <param name="lsCraftItem"></param>
        /// <param name="err"></param>
        public string InsertRefCraftInfo(string craftinfo, string lsCraftItem, out string err)
        {
            err = "";
            try
            {
                IDictionary<string, object> mst = MapListConverter.JsonToDictionary(craftinfo);
               
                   DataTable dt = GetCraftInfoByCraftId(mst["CRAFTNAME"].ToString()).Tables[0];
                    if (dt != null && dt.Rows.Count > 0)
                    {                      

                        IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);

                        mst.Remove("CRAFTID");
                        mst.Remove("BEWORKSEG");
                        mst.Remove("CRAFTPARAMETERURL");                       
                        dp.UpdateData(table, new string[] { "CRAFTNAME" }, mst);
                        return "OK";
                    }
                    string RES = InsertCraftInfo_SP(craftinfo);
                    InsertCraftItem(craftinfo, lsCraftItem, out err);
                return RES;
            }
            catch (Exception EX)
            {
                return EX.Message;
            }
        }
コード例 #19
0
        /// <summary>
        /// 获取料站表头的一行信息
        /// </summary>
        /// <param name="partnumber">成品料号</param>
        /// <param name="machineId">机器编号</param>
        /// <param name="side">pcb面</param>
        /// <returns></returns>
        public System.Data.DataSet GetKpMasterInfo(string partnumber, string machineId, string side)
        {
            int            count             = 0;
            IAdminProvider dp                = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = new Dictionary <string, object>();

            mst.Add("partnumber", partnumber);
            mst.Add("lineId", machineId);
            mst.Add("pcbside", side);
            System.Data.DataSet _dt = dp.GetData("SFCR.T_SMT_KP_MASTER", " masterId,bomver,lineId", mst, out count);
            if (_dt != null && _dt.Tables[0].Rows.Count > 0)
            {
                if (_dt.Tables[0].Rows.Count > 1)
                {
                    //资料重复
                    throw new Exception("相同的资料存在多比,请联系管理员");
                }
                else
                {
                    return(_dt);
                }
            }
            else
            {
                //没有对应的料站表
                throw new Exception(string.Format("成品料号:[{0}]的PCB [{1}]面 在设备:[{2}]上没有料站信息,请重建料站信息",
                                                  partnumber, side, machineId));
            }
        }
コード例 #20
0
ファイル: tCraftInfo.cs プロジェクト: fengyubox/SFIS
 /// <summary>
 /// 获取所有类型的制程段
 /// </summary>
 /// <returns></returns>
 public DataSet GetAllWorksegment()
 {         
     string fieldlist = "beworkseg";
     int count = 0;
     IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
     return dp.GetData("SFCB.B_WORK_SEGMENT", fieldlist, null, out count);
 }
コード例 #21
0
        /// <summary>
        /// 获取指定流程编号的XML内容
        /// </summary>
        /// <param name="routgroupId"></param>
        /// <returns></returns>
        public string GetRouteAttBy(string routgroupId)
        {
            // MySqlCommand cmd = new MySqlCommand();
            // cmd.CommandText = "select routgroupxmlContent from SFCB.B_ROUTE_ATT where routgroupId=@routeId";
            // cmd.Parameters.Add("routeId", MySqlDbType.VarChar).Value = routgroupId;
            //// ((Oracle.DataAccess.Client.MySqlCommand)cmd).InitialLONGFetchSize = -1;
            // DataTable dt =  BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd).Tables[0];

            string         table            = "SFCB.B_ROUTE_ATT";
            string         fieldlist        = "ROUTGROUPXMLCONTENT";
            int            count            = 0;
            IAdminProvider dp               = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            Dictionary <string, object> mst = new Dictionary <string, object>();

            mst.Add("ROUTGROUPID", routgroupId);
            DataTable dt = dp.GetData(table, fieldlist, mst, out count).Tables[0];

            if (dt != null && dt.Rows.Count > 0)
            {
                //return new tRouteAtt()
                //{
                //    routgroupId = routgroupId,
                //   routgroupxmlContent =
                return(dt.Rows[0]["routgroupxmlContent"].ToString());
                //};
            }
            else
            {
                return(null);
            }
        }
コード例 #22
0
ファイル: tCraftInfo.cs プロジェクト: fengyubox/SFIS
 /// <summary>
 /// 增加制程段
 /// </summary>
 /// <param name="bworksegment"></param>
 /// <returns></returns>
 public void InsertWorkSegment(string bworksegment)
 {        
     IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);   
     IDictionary<string, object> mst = new Dictionary<string, object>();
     mst.Add("beworkseg", bworksegment);
     dp.AddData("SFCB.B_WORK_SEGMENT", mst);
 }
コード例 #23
0
        public string Delete_Route_Info(string routgroupId)
        {
            DbConnection  conn = ProviderHelper.GetConnection(ProConfiguration.GetConfig().DatabaseType, ProConfiguration.GetConfig().DatabaseConnect);
            DbTransaction tx   = ProviderHelper.BeginTransaction(conn);

            try
            {
                IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
                IDictionary <string, object> mst = new Dictionary <string, object>();
                mst.Add("ROUTGROUPID", routgroupId);
                dp.DeleteData(tx, "SFCB.B_ROUTE_INFO", mst);
                dp.DeleteData(tx, "SFCB.B_ROUTE_ATT", mst);

                tx.Commit();
                return("OK");
            }
            catch (Exception ex)
            {
                tx.Rollback();
                return(ex.Message);
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
        }
コード例 #24
0
ファイル: tCraftInfo.cs プロジェクト: fengyubox/SFIS
 /// <summary>
 /// 获取所有工艺名称,craftId,craftname,craftparamet,beworkseg
 /// </summary>
 /// <returns></returns>
 public System.Data.DataSet GetAllCraftInfo(IDictionary<string, object> mst)
 {          
     string fieldlist = "craftId,craftname,craftparameterurl,beworkseg,testflag,checktoolsflag".ToUpper();      
     int count = 0;
     IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
     return dp.GetData(table, fieldlist, mst, out count);
 }
コード例 #25
0
        public string Insert_T_WO_Material(string TrSn, string UserID, string STATUS)
        {
            try
            {
                IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);

                int count = 0;
                IDictionary <string, object> mst = new Dictionary <string, object>();
                mst.Add("TR_SN", TrSn);
                DataTable dt = dp.GetData("SFCR.R_TR_SN", "TR_SN,KP_NO,VENDER_ID,DATE_CODE,LOT_CODE,QTY,WOID", mst, out count).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    mst = new Dictionary <string, object>();
                    mst.Add("TR_SN", dt.Rows[0]["TR_SN"].ToString());
                    mst.Add("KP_NO", dt.Rows[0]["KP_NO"].ToString());
                    mst.Add("VENDER_ID", dt.Rows[0]["VENDER_ID"].ToString());
                    mst.Add("DATE_CODE", dt.Rows[0]["DATE_CODE"].ToString());
                    mst.Add("LOT_CODE", dt.Rows[0]["LOT_CODE"].ToString());
                    mst.Add("QTY", Convert.ToInt32(dt.Rows[0]["QTY"].ToString()));
                    mst.Add("WOID", dt.Rows[0]["WOID"].ToString());
                    mst.Add("USER_ID", UserID);
                    mst.Add("STATUS", STATUS);
                    dp.AddData(table, mst);
                }
                return("OK");
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
コード例 #26
0
ファイル: tCraftInfo.cs プロジェクト: fengyubox/SFIS
 public System.Data.DataSet GetAllCraftInfo2()
 {          
     string fieldlist = "0 as chk, craftId,craftname,craftparameterurl,beworkseg,checktoolsflag".ToUpper();         
     int count = 0;
     IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
     return dp.GetData(table, fieldlist, null, out count);
 }
コード例 #27
0
ファイル: tPartStorehousehad.cs プロジェクト: fengyubox/SFIS
        /// <summary>
        /// 更新钢网信息
        /// </summary>
        /// <param name="partstoremodel"></param>
        /// <param name="trsn"></param>
        /// <returns></returns>
        public void UpdateGangInfo(string dicstring)
        {
            IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = MapListConverter.JsonToDictionary(dicstring);

            dp.UpdateData("SFCR.T_PART_STOREHOUSE_HAD", new string[] { "TRSN" }, mst);
        }
コード例 #28
0
ファイル: tFacInfo.cs プロジェクト: fengyubox/SFIS
        /// <summary>
        /// 新增工厂信息
        /// </summary>
        /// <param name="facinfo"></param>
        public void InsertFacInfo(string dicFacinfo)
        {
            IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> dic = MapListConverter.JsonToDictionary(dicFacinfo);

            dp.AddData(table, dic);
        }
コード例 #29
0
ファイル: tFixtureInfo.cs プロジェクト: fengyubox/SFIS
        public void UpdateFixtureInfo(string dicFixtureinfo)
        {
            IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = MapListConverter.JsonToDictionary(dicFixtureinfo);

            dp.UpdateData("SFCR.T_FIXTURE_INFO", new string[] { "fixtureId" }, mst);
        }
コード例 #30
0
ファイル: tUserInfo.cs プロジェクト: fengyubox/SFIS
        /// <summary>
        /// 检查应用程序的功能是否存在
        /// </summary>
        /// <param name="progid"></param>
        /// <param name="funid"></param>
        /// <returns></returns>
        public bool ChkFunctionList(string progid, string funid)
        {
            //MySqlCommand cmd = new MySqlCommand();
            //cmd.CommandText = "select funname from SFCB.B_FUNCTION_LIST where funId=@funid and progid=@progid";
            //cmd.Parameters.Add("funid", MySqlDbType.VarChar, 25).Value = funid;
            //cmd.Parameters.Add("progid", MySqlDbType.VarChar, 25).Value = progid;
            // object obj = BLL.BllMsSqllib.Instance.sqlExecuteScalar(cmd);
            string         table             = "SFCB.B_FUNCTION_LIST";
            string         fieldlist         = "funname";
            int            count             = 0;
            IAdminProvider dp                = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN);
            IDictionary <string, object> mst = new Dictionary <string, object>();

            mst.Add("funId", funid);
            mst.Add("progid", progid);
            DataTable dt = dp.GetData(table, fieldlist, mst, out count).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }