예제 #1
0
        public HttpResult AddProBarCode(string cBarCode, string cInvCode)
        {
            var mfun = new MSSQLFunction();
            var cmd  = new SqlCommand("spLocal_AddProBarCode")
            {
                CommandType = CommandType.StoredProcedure
            };

            cmd.Parameters.AddWithValue("@cBarCode", cBarCode);
            cmd.Parameters.AddWithValue("@cInvCode", cInvCode);

            if (mfun.ExecSqlCmdWithUsing(cmd) > 0)
            {
                var bR = new HttpResult
                {
                    IsSuccess    = true,
                    ErrorCode    = 1,
                    ErrorMessage = "成功"
                };
                return(bR);
            }
            else
            {
                var bR = new HttpResult
                {
                    IsSuccess    = false,
                    ErrorCode    = -1,
                    ErrorMessage = "条码已经存在"
                };

                return(bR);
            }
        }
예제 #2
0
        /// <summary>
        /// 获取所有物料档案
        /// </summary>
        /// <returns></returns>
        public DataTable QueryInventoryAll()
        {
            var mfun      = new MSSQLFunction();
            var cmd       = new SqlCommand("select * from Inventory");
            var tempTable = mfun.GetSqlTableWithUsing(cmd);

            return(tempTable);
        }
예제 #3
0
        public static DataTable GetStoreDetail()
        {
            var cmd = new SqlCommand("spLocal_GetStoreDetail");

            cmd.CommandType = CommandType.StoredProcedure;
            var msf = new MSSQLFunction();

            return(msf.GetSqlTableWithUsing(cmd));
        }
예제 #4
0
        public static DataTable GetStoreDetailByDate(DateTime dStart, DateTime dEnd)
        {
            var cmd = new SqlCommand("spLocal_GetStoreDetailByDate");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@dStart", dStart);
            cmd.Parameters.AddWithValue("@dEnd", dEnd);
            var msf = new MSSQLFunction();

            return(msf.GetSqlTableWithUsing(cmd));
        }
예제 #5
0
        public HttpResult UpdateInventory(string cInvCode, string cInvName, string cInvStd,
                                          decimal iWeight, int iBoxQty, string cMemo)
        {
            var mfun = new MSSQLFunction();
            var cmd  = new SqlCommand("spLocal_UpdateInventory")
            {
                CommandType = CommandType.StoredProcedure
            };

            cmd.Parameters.AddWithValue("@cInvCode", cInvCode);
            cmd.Parameters.AddWithValue("@cInvName", cInvName);
            cmd.Parameters.AddWithValue("@cInvStd", cInvStd);
            cmd.Parameters.AddWithValue("@iWeight", iWeight);
            cmd.Parameters.AddWithValue("@iBoxQty", iBoxQty);
            cmd.Parameters.AddWithValue("@cMemo", cMemo);

            if (mfun.ExecSqlCmdWithUsing(cmd) > 0)
            {
                var bR = new HttpResult
                {
                    IsSuccess    = true,
                    ErrorCode    = 1,
                    ErrorMessage = "成功"
                };
                return(bR);
            }
            else
            {
                var bR = new HttpResult
                {
                    IsSuccess    = false,
                    ErrorCode    = -1,
                    ErrorMessage = "更新失败"
                };

                return(bR);
            }
        }
예제 #6
0
        public DataTable QueryInventory(int iPageIndex, int iPageSize, ref int pageCount, ref int recordCount)
        {
            var mfun = new MSSQLFunction();
            var cmd  = new SqlCommand("GetRecordPage")
            {
                CommandType = CommandType.StoredProcedure
            };

            cmd.Parameters.AddWithValue("@PageIndex", iPageIndex);
            cmd.Parameters.AddWithValue("@TableRecord", "Inventory");
            cmd.Parameters.AddWithValue("@fldName", "I_id");
            cmd.Parameters.AddWithValue("@PageSize", iPageSize);
            cmd.Parameters.AddWithValue("@strWhere", "");



            var pageCountPara = new SqlParameter("@PageCount", SqlDbType.Int);

            pageCountPara.Direction = ParameterDirection.Output;


            var recordCountPara = new SqlParameter("@RecordCount", SqlDbType.Int);

            recordCountPara.Direction = ParameterDirection.Output;

            cmd.Parameters.Add(pageCountPara);
            cmd.Parameters.Add(recordCountPara);

            var tempTable = mfun.GetSqlTableWithUsing(cmd);

            pageCount   = (int)pageCountPara.Value;
            recordCount = (int)recordCountPara.Value;


            return(tempTable);
        }