/// <summary>
        /// 获取指定产品的总成名称
        /// </summary>
        /// <param name="productCode">产品编码</param>
        /// <param name="names">获取到的总成名称</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>操作是否成功的标志</returns>
        public bool GetAssemblyName(string productCode, List <string> names, out string error)
        {
            error = null;

            Hashtable paramTable = new Hashtable();

            paramTable.Add("@ProductCode", productCode);

            DataSet ds = new DataSet();
            Dictionary <OperateCMD, object> dicOperateCMD = m_dbOperate.RunProc_CMD("SelP_AssemblyName", ds, paramTable);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);
                return(false);
            }

            if (ds.Tables == null || ds.Tables[0].Rows.Count == 0)
            {
                error = "没有找到总成信息";
                return(false);
            }

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                names.Add(ds.Tables[0].Rows[i][0].ToString());
            }

            return(true);
        }
示例#2
0
        /// <summary>
        /// 获取某一版本的Bom信息
        /// </summary>
        /// <param name="edition">总成型号</param>
        /// <param name="sysVersion">版本号</param>
        /// <param name="dataTable">Bom 数据表</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>操作成功返回true</returns>
        public bool GetBom(string edition, string sysVersion, out DataTable dataTable, out string error)
        {
            dataTable = null;
            error     = null;

            Hashtable paramTable = new Hashtable();
            DataSet   ds         = new DataSet();

            paramTable.Add("@Edition", edition);
            paramTable.Add("@SysVersion", sysVersion);

            Dictionary <OperateCMD, object> dicOperateCMD = m_dbOperate.RunProc_CMD("SelAllP_ProductBom", ds, paramTable);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);

                if (error != "没有找到任何数据")
                {
                    return(false);
                }
            }

            dataTable = ds.Tables[0];
            return(true);
        }
        /// <summary>
        /// 添加初始化收发存汇总表初始的上月结存记录
        /// </summary>
        /// <param name="goodsCode">图号型号</param>
        /// <param name="goodsName">物品名称</param>
        /// <param name="spec">规格</param>
        /// <param name="counts">数量</param>
        /// <param name="materialType">领料类型</param>
        /// <param name="dateTimes">日期</param>
        /// <param name="returnBill">返回table 数据集</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>操作成功返回True,操作失败返回False</returns>
        public bool AddReceiveSendSaveBalanceTable(string goodsCode, string goodsName, string spec,
                                                   int counts, string dateTimes, string materialType, out DataTable returnBill, out string error)
        {
            returnBill = null;
            error      = null;

            Hashtable paramTable = new Hashtable();

            paramTable.Add("@GoodsCode", goodsCode);
            paramTable.Add("@Spec", spec);
            paramTable.Add("@GoodsName", goodsName);
            paramTable.Add("@Counts", counts);
            paramTable.Add("@DateTimes", dateTimes);
            paramTable.Add("@MaterialType", materialType);

            DataSet ReceiveSendSaveGatherBillDetailBillDataSet = new DataSet();

            Dictionary <OperateCMD, object> dicOperateCMD =
                m_dbOperate.RunProc_CMD("AddS_ReceiveSendSaveBalanceTable",
                                        ReceiveSendSaveGatherBillDetailBillDataSet, paramTable);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);
                return(false);
            }

            returnBill = ReceiveSendSaveGatherBillDetailBillDataSet.Tables[0];
            return(true);
        }
示例#4
0
        /// <summary>
        /// 执行带参数的查询存储过程
        /// </summary>
        /// <param name="procedureName">存储过程名称</param>
        /// <param name="paramTable">参数表</param>
        /// <param name="ds">返回的数据集</param>
        /// <param name="err">错误信息, 没有错误该值为null</param>
        /// <returns>成功返回true</returns>
        public static bool ExecuteDbProcedure(string procedureName, Hashtable paramTable, DataSet ds, out string err)
        {
            err = null;

            if (m_dboperate == null)
            {
                GetIDBOperate();
            }

            Dictionary <OperateCMD, object> dicOperateCMD = m_dboperate.RunProc_CMD(procedureName, ds, paramTable);

            return(GetResult(dicOperateCMD, out err));
        }
        /// <summary>
        /// 检测是否能进行试验
        /// </summary>
        /// <param name="productCode">箱号</param>
        /// <param name="error">出错时返回错误信息</param>
        /// <returns>允许试验返回true</returns>
        public bool CanOffLineTest(string productCode, out string error)
        {
            error = null;

            Hashtable paramTable = new Hashtable();
            DataSet   ds         = new DataSet();

            paramTable.Add("@ProductNumber", productCode);

            IDBOperate dbOperate = CommentParameter.GetDBOperatorOfDepotManagement();

            Dictionary <OperateCMD, object> dicOperateCMD = dbOperate.RunProc_CMD("ZPX_AllowOffLineTest", ds, paramTable);

            DataTable dataTable = ds.Tables[0];

            if (dataTable.Rows[0][0].ToString() == "允许")
            {
                return(true);
            }

            error = dataTable.Rows[0][0].ToString();

            if (dataTable.Columns.Count == 1)
            {
                return(false);
            }

            return(false);
        }
示例#6
0
        /// <summary>
        /// 检测是否能进行试验
        /// </summary>
        /// <param name="productCode">箱号</param>
        /// <param name="error">出错时返回错误信息</param>
        /// <returns>允许试验返回true</returns>
        public bool CanOffLineTest(string productCode, out string error)
        {
            error = null;

            Hashtable paramTable = new Hashtable();
            DataSet   ds         = new DataSet();

            paramTable.Add("@ProductNumber", productCode);

            IDBOperate dbOperate = CommentParameter.GetDBOperatorOfDepotManagement();

            Dictionary <OperateCMD, object> dicOperateCMD = dbOperate.RunProc_CMD("ZPX_AllowOffLineTest", ds, paramTable);

            DataTable dataTable = ds.Tables[0];

            if (dataTable.Rows[0][0].ToString() == "允许")
            {
                return(true);
            }

            error = dataTable.Rows[0][0].ToString();

            if (dataTable.Columns.Count == 1)
            {
                return(false);
            }

            DepotManagementDataContext ctx = CommentParameter.DepotDataContext;

            var varData = from a in ctx.ZPX_CVTOffLineTestResultLog
                          where a.ProdutCode == productCode
                          select a;

            if (varData.Count() == 0)
            {
                ZPX_CVTOffLineTestResultLog lnqLog = new ZPX_CVTOffLineTestResultLog();

                lnqLog.ProdutCode    = productCode;
                lnqLog.Z08FinishTime = Convert.ToDateTime(dataTable.Rows[0][1]);

                ctx.ZPX_CVTOffLineTestResultLog.InsertOnSubmit(lnqLog);
            }
            else if (varData.Count() == 1)
            {
                ZPX_CVTOffLineTestResultLog lnqLog = varData.Single();

                lnqLog.Z08FinishTime = Convert.ToDateTime(dataTable.Rows[0][1]);
            }

            ctx.SubmitChanges();

            return(false);
        }
示例#7
0
        /// <summary>
        /// 获取与营销有关的所有产品信息
        /// </summary>
        /// <param name="error">出错时输出的错误信息</param>
        /// <returns>成功返回获取到的产品信息,失败返回null</returns>
        public DataTable GetAllProductList(out string error)
        {
            error = null;

            DataSet ds = new DataSet();
            Dictionary <OperateCMD, object> dicOperateCMD = m_dbOperate.RunProc_CMD("", ds);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);
                return(null);
            }

            return(ds.Tables[0]);
        }
        /// <summary>
        /// 判断某零件是否属于AB类零件
        /// </summary>
        /// <param name="goodsCode">图号型号</param>
        /// <param name="spec">规格</param>
        /// <param name="returnTable">返回的AB类零件数据集</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>操作成功返回True,操作失败返回False</returns>
        public bool JudgeGoodsGrade(string goodsCode, string spec, out DataTable returnTable, out string error)
        {
            returnTable = null;
            error       = null;

            Hashtable paramTable = new Hashtable();

            paramTable.Add("@GoodsCode", goodsCode);
            paramTable.Add("@Spec", spec);

            DataSet goodsGradeDataSet = new DataSet();

            Dictionary <OperateCMD, object> dicOperateCMD =
                m_dbOperate.RunProc_CMD("JudgeGoodsGradeFromQ_GoodsGradeTable", goodsGradeDataSet, paramTable);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);
                return(false);
            }

            returnTable = goodsGradeDataSet.Tables[0];
            return(true);
        }
        /// <summary>
        /// 获得所有三包外返修零件单价信息
        /// </summary>
        /// <returns>返回获得的三包外返修零件单价信息</returns>
        public DataTable GetGoodsUnitPriceInfo()
        {
            Hashtable paramTable = new Hashtable();

            DataSet ds = new DataSet();

            Dictionary <OperateCMD, object> dicOperateCMD = m_dbDate.RunProc_CMD("YX_Select_ThreePacketsOfTheRepairGoodsUnitPrice",
                                                                                 ds, paramTable);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                return(null);
            }

            return(ds.Tables[0]);
        }
        /// <summary>
        /// 获取供应商信息表
        /// </summary>
        /// <param name="table">供应商信息表</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>返回是否成功获取供应商信息表</returns>
        public bool GetAllProvider(out DataTable table, out string error)
        {
            table = null;
            error = null;

            DataSet dsProviderInfo = new DataSet();
            Dictionary <OperateCMD, object> dicOperateCMD = m_dbOperate.RunProc_CMD("SelAllProvider", dsProviderInfo);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);
                return(false);
            }

            table = dsProviderInfo.Tables[0];
            return(true);
        }
示例#11
0
        public void Check_LeaveType(string typeCode, decimal hours, int?billID)
        {
            DepotManagementDataContext ctx = CommentParameter.DepotDataContext;
            IDBOperate m_dbOperate         = CommentParameter.GetDBOperatorOfDepotManagement();

            HR_LeaveType leaveType = GetLeaveType(ctx, typeCode);

            Hashtable paramTable = new Hashtable();

            paramTable.Add("@TypeCode", leaveType.TypeCode);
            paramTable.Add("@Hours", hours);
            paramTable.Add("@WorkID", BasicInfo.LoginID);
            paramTable.Add("@BillID", billID == null ? 0 : billID);

            Dictionary <OperateCMD, object> dicOperateCMD = m_dbOperate.RunProc_CMD("HR_LeaveBill_Type_Check", paramTable);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                throw new Exception(Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]));
            }
        }
        /// <summary>
        /// 获取选配表表头所有信息
        /// </summary>
        /// <param name="table">返回查询的数据信息</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>获取成功返回True,获取失败返回False</returns>
        public bool GetAllChoseConfectTableHead(out DataTable table, out string error)
        {
            table = null;
            error = null;

            DataSet tempDataSet = new DataSet();

            Dictionary <OperateCMD, object> dicOperateCMD = m_dbOperate.RunProc_CMD("SelAllP_ChoseConfectTableHead", tempDataSet);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);
                return(false);
            }

            table = tempDataSet.Tables[0];

            return(true);
        }
        /// <summary>
        /// 台帐
        /// </summary>
        /// <param name="productName">查询方式</param>
        /// <param name="startDate">开始时间</param>
        /// <param name="endDate">结束时间</param>
        /// <param name="storageID">库房ID</param>
        /// <param name="showTable">返回table数据集</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>操作成功返回True,操作失败返回False</returns>
        public bool GetAllGather(string productName, DateTime startDate, DateTime endDate, string storageID,
                                 out DataTable showTable, out string error)
        {
            IDBOperate dbOperate = CommentParameter.GetDBOperatorOfDepotManagement();

            error     = null;
            showTable = null;

            try
            {
                Hashtable paramTable = new Hashtable();

                if (productName == "pro_B_GoodsListGather")
                {
                    paramTable.Add("@StartDate", startDate);
                    paramTable.Add("@EndDate", endDate);
                }

                DataSet ds = new DataSet();
                Dictionary <OperateCMD, object> dicOperateCMD = dbOperate.RunProc_CMD(productName, ds, paramTable);

                if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
                {
                    error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);
                    return(false);
                }

                showTable = ds.Tables[0];

                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }