/// <summary>
 /// 盘点单审核
 /// </summary>
 /// <param name="model">盘点单实体</param>
 /// <returns></returns>
 public bool UnApprove(Models.ys_CheckOrder model)
 {
     UnAddDicByOrder(model);
     foreach (Models.ys_CheckOrderDeail d in model.Details)
     {
         KeyValuePair <SqlParameter[], string> item = StatusChangeSerivce.AddNew("盘点反审", model.CheckNo, d.AssetsId, model.OperatorId.ToString(), model.OperatorName, model.OperatorId.ToString(), model.OperatorName);
         UnsqlDic.Add(item.Key, item.Value);
         UnAddDicByUpdateAssets(d);
     }
     return(Models.SqlHelper.ExecuteTransaction1(UnsqlDic, false) > 0 ? true : false);
 }
        /// <summary>
        /// 新增维修记录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddNew(IList <Models.ys_RepairOrder> listModel)
        {
            foreach (Models.ys_RepairOrder r in listModel)
            {
                KeyValuePair <SqlParameter[], string> item = StatusChangeSerivce.AddNew("维修", r.RepairNo, r.AssetsId, r.OperatorId.ToString(), r.OperatorName, r.RepairUserId.ToString(), r.RepairUserName);
                dicCmd.Add(item.Key, item.Value);

                AddDicByRepairOrder(r);
                AddDicByUpdateAssets(r);
            }
            return(Models.SqlHelper.ExecuteTransaction1(dicCmd) > 0 ? true : false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 新增退库信息
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        public bool AddNew(Models.ys_RefundOrder model)
        {
            AddDicByOrder(model);
            foreach (Models.ys_RefundOrderDetail d in model.Detail)
            {
                KeyValuePair <SqlParameter[], string> item = StatusChangeSerivce.AddNew("退库", model.RefundNo, d.AssetsId, model.OperatorId.ToString(), model.OperatorName, model.RefundUserId.ToString(), model.RefundUserName);
                sqlDic.Add(item.Key, item.Value);

                AddDicByOrderDetail(d);
                AddDicByUpdateAssets(d.AssetsId);
            }
            return(Models.SqlHelper.ExecuteTransaction1(sqlDic, false) > 0 ? true :false);
        }
    {  /// <summary>
       /// 新增
       /// </summary>
       /// <param name="model">实体</param>
       /// <returns></returns>
        public bool AddNew(Models.ys_Assets model)
        {
            Dictionary<SqlParameter[], string> sqlDic = new Dictionary<SqlParameter[], string>();
            string sqlText = @"INSERT INTO [AssetsSys].[dbo].[ys_Assets]
           ([Id]
           ,[Barcode]
           ,[Name]
           ,[Model]
           ,[CompanyId]
           ,[CategoryId]
           ,[DepartmentId]
           ,[UserId]
           ,[Buyday]
           ,[Location]
           ,[StockId]
           ,[Price]
           ,[Description]
           ,[CreateTime]
           ,[XmlInf]
           ,[StatusId]
           ,[IsRemoved])
     VALUES
           (@Id
           ,@Barcode
           ,@Name
           ,@Model
           ,@CompanyId
           ,@CategoryId
           ,@DepartmentId
           ,@UserId
           ,@Buyday
           ,@Location
           ,@StockId
           ,@Price
           ,@Description
           ,@CreateTime
           ,@XmlInf
           ,@StatusId
           ,@IsRemoved)";

            SqlParameter s1 = new SqlParameter("@Id", model.Id);
            SqlParameter s2 = new SqlParameter("@Barcode", model.Barcode);
            SqlParameter s3 = new SqlParameter("@Name", model.Name);
            SqlParameter s4 = new SqlParameter("@Model", model.Model);
            SqlParameter s5 = new SqlParameter("@CategoryId", model.CategoryId);
            SqlParameter s6 = new SqlParameter("@CompanyId", model.CompanyId);
            SqlParameter s7 = new SqlParameter("@DepartmentId", model.DepartmentId);
            SqlParameter s8 = new SqlParameter("@UserId", model.UserId);
            SqlParameter s9 = new SqlParameter("@Buyday", model.Buyday);
            SqlParameter s10 = new SqlParameter("@Location", model.Location);
            SqlParameter s16 = new SqlParameter("@StockId", model.StockId);
            SqlParameter s17 = new SqlParameter("@Price", model.Price);
            SqlParameter s11 = new SqlParameter("@Description", model.Description);
            SqlParameter s12= new SqlParameter("@CreateTime", model.CreateTime);
            SqlParameter s13 = new SqlParameter("@XmlInf", model.XmlInf);
            SqlParameter s14 = new SqlParameter("@StatusId", model.StatusId);
            SqlParameter s15 = new SqlParameter("@IsRemoved", model.IsRemoved);

            SqlParameter[] cmdPara = new SqlParameter[] { s1, s2, s3, s4,s5, s6, s7, s8,s9,s10,s11,s12,s13,s14,s15,s16,s17};

            KeyValuePair<SqlParameter[], string> item = StatusChangeSerivce.AddNew("登记", "LK"+DateTime.Now.ToString("yyyyMMdd"), model.Id,model.OperatorId.ToString(),model.OperatorName);
            sqlDic.Add(item.Key, item.Value);
            sqlDic.Add(cmdPara, sqlText);

            return Models.SqlHelper.ExecuteTransaction1(sqlDic,false) > 0 ? true : false;

        }