Esempio n. 1
0
        /// <summary>
        /// 删除告警触发事件
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public int DeleteAlarmEventById(int Id)
        {
            var cmd = new DataCommand("deleteAlarmEventById", new SqlCustomDbCommand());
            cmd.SetParameterValue("@Id", Id);

            return cmd.ExecuteNonQuery();
        }
Esempio n. 2
0
        public void MaintainCountdownStatus(CountdownInfo entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("MaintainCountdownStatus");

            command.SetParameterValue("@SysNo", entity.SysNo);
            command.SetParameterValue("@Status", entity.Status);
            command.SetParameterValue("@CompanyCode", entity.CompanyCode);
            command.SetParameterValueAsCurrentUserAcct("@EditUser");
            command.ExecuteNonQuery();
        }
Esempio n. 3
0
 /// <summary>
 ///  删除阶梯数据
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public bool DeleteStepByID(int id)
 {
     var cmd = new DataCommand("deleteStepByID", new SqlCustomDbCommand());
     cmd.SetParameterValue("@ID", id);
     int result = cmd.ExecuteNonQuery();
     if (result > 0)
         return true;
     else
         return false;
 }
Esempio n. 4
0
        public void InsertVendorUser_VendorExForUpdate(VendorUserMapping entity)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("External_InsertVendorUser_VendorExForUpdate");

            dc.SetParameterValue("@UserSysNo", entity.UserSysNo);
            dc.SetParameterValue("@ManufacturerSysNo", entity.ManufacturerSysNo);
            dc.SetParameterValue("@IsAuto", entity.IsAuto);

            dc.ExecuteNonQuery();
        }
Esempio n. 5
0
        public static void CloseRequestWithOutAdjustInventory(VirtualRequestEntity request)
        {
            DataCommand command = DataCommandManager.GetDataCommand("CloseRequestWithOutAdjustInventory");

            command.SetParameterValue("@ProductSysNo", request.ProductSysNo);
            command.SetParameterValue("@StockSysNo", request.StockSysNo);
            command.SetParameterValue("@CompanyCode", request.CompanyCode);

            command.ExecuteNonQuery();
        }
Esempio n. 6
0
        public static void UpdateExtendPOInfo(int sysNO, string companyCode, int productSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateExtendPOInfo");

            cmd.SetParameterValue("@SysNo", sysNO);
            cmd.SetParameterValue("@Companycode", companyCode);
            cmd.SetParameterValue("@ProductSysNo", productSysNo);

            cmd.ExecuteNonQuery();
        }
Esempio n. 7
0
        public static void UpdateLocalWHMark(int soSysNo, string localWH, int targetStatus)
        {
            DataCommand command = DataCommandManager.GetDataCommand("UpdateLocalWHMark");

            command.SetParameterValue("@SOSysNo", soSysNo);
            command.SetParameterValue("@LocalWH", localWH);
            command.SetParameterValue("@TargetStatus", targetStatus);

            command.ExecuteNonQuery();
        }
Esempio n. 8
0
        public static int ChangeGroupBuySettlement(int groupBuyingSysNo, string isSettlement, string companyCode)
        {
            DataCommand command = DataCommandManager.GetDataCommand("ChangeGroupBuySettlement");

            command.SetParameterValue("@GroupBuyingSysNo", groupBuyingSysNo);
            command.SetParameterValue("@IsSettlement", isSettlement);
            command.SetParameterValue("@CompanyCode", companyCode);

            return(command.ExecuteNonQuery());
        }
Esempio n. 9
0
        public CustomerContactInfo Insert(CustomerContactInfo entity)
        {
            DataCommand insertCommand = DataCommandManager.GetDataCommand("InsertCustomerContact");

            insertCommand.SetParameterValue <CustomerContactInfo>(entity);

            insertCommand.ExecuteNonQuery();
            entity.SysNo = (int)insertCommand.GetParameterValue("@SysNo");
            return(entity);
        }
Esempio n. 10
0
        /// <summary>
        /// 审核补偿退款单
        /// </summary>
        /// <param name="SysNo"></param>
        /// <param name="Status"></param>
        /// <param name="RefundUserSysNo"></param>
        /// <returns></returns>
        public bool AuditRefundAdjust(int SysNo, RefundAdjustStatus Status, int?RefundUserSysNo, DateTime?AuditTime)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("Customer_Audit_RequestAdjust");

            cmd.SetParameterValue("@Status", (int)Status);
            cmd.SetParameterValue("@SysNo", SysNo);
            cmd.SetParameterValue("@RefundUserSysNo", RefundUserSysNo);
            cmd.SetParameterValue("@RefundTime", AuditTime);
            return(cmd.ExecuteNonQuery() > 0 ? true : false);
        }
Esempio n. 11
0
        public override object OnDelete(ProductDetail request)
        {
            ResultEntity <int> result = new ResultEntity <int>
            {
                Result     = ResultStatic.ResultString.ERROR,
                ResultCode = ResultStatic.ResultCode.PARAMERROR
            };

            try
            {
                List <string> split     = new List <string>();
                int           affectRow = 0;
                dataCommand = DataCommandManager.GetDataCommand("DeleteProduct_Amber");
                if (request.SplitArr != null)
                {
                    split = new SplitString().bySplit(request.SplitArr, ',');
                    foreach (string i in split)
                    {
                        affectRow = dataCommand.ExecuteNonQuery(new[] { new{
                                                                            ProductID = i
                                                                        } });
                    }
                }
                else
                {
                    affectRow = dataCommand.ExecuteNonQuery(new[] { new{
                                                                        ProductID = request.ProductID
                                                                    } });
                }
                result.Result        = ResultStatic.ResultString.SUCCESS;
                result.ResultCode    = ResultStatic.ResultCode.OK;
                result.ResultContent = affectRow;
                return(result);
            }
            catch (Exception ex)
            {
                result.Result     = ResultStatic.ResultString.SERVERERROR;
                result.ResultCode = ResultStatic.ResultCode.SERVERERROR;
                result.Error      = ex.Message;
                return(result);
                //throw;
            }
        }
Esempio n. 12
0
 public int InsertQuotaLog(Model.TS_Quota_Log quotaLogData)
 {
     var cmd = new DataCommand("InsertQuotaLog", new SqlCustomDbCommand());
     cmd.SetParameterValue("@QuotaId", quotaLogData.QuotaId);
     cmd.SetParameterValue("@LogTime", quotaLogData.LogTime);
     cmd.SetParameterValue("@UserName", quotaLogData.UserName);
     cmd.SetParameterValue("@QuotaValue", quotaLogData.QuotaValue);
     cmd.SetParameterValue("@Reserved", quotaLogData.Reserved);
     return cmd.ExecuteNonQuery();
 }
Esempio n. 13
0
        /// <summary>
        /// 咨询回复之批准拒绝
        /// </summary>
        /// <param name="item"></param>
        public int RejectProductConsultRelease(ProductConsultReply item)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("ProductConsult_UpdateFactoryRefuseStatus");

            dc.SetParameterValue("@SysNo", item.SysNo.Value);
            dc.SetParameterValue("@CompanyCode", item.CompanyCode);

            dc.ExecuteNonQuery();
            return(Convert.ToInt32(dc.GetParameterValue("@IsSuccess")));
        }
Esempio n. 14
0
        public void InsertCategoryTemplate(CategoryTemplateInfo info)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("InsertCategoryTemplate");

            dc.SetParameterValue("@C3SysNo", info.TargetSysNo);
            dc.SetParameterValue("@LastEditUserSysNo", info.User.SysNo);
            dc.SetParameterValue("@TemplateType", info.TemplateType);
            dc.SetParameterValue("@Description", info.Templates);
            dc.ExecuteNonQuery();
        }
Esempio n. 15
0
        public static void UpdateGiftIsGlobal(int promotionSysNo, bool isGlobal, string userName)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("SaleGift_UpdateGiftIsGlobal");

            cmd.SetParameterValue("@PromotionSysNo", promotionSysNo);
            cmd.SetParameterValue("@IsGlobal", isGlobal ? "Y" : "N");
            cmd.SetParameterValue("@EditUser", userName);

            cmd.ExecuteNonQuery();
        }
Esempio n. 16
0
        public RefundInfo InsertMaster(RefundInfo entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("InsertRefundMaster");

            command.SetParameterValue <RefundInfo>(entity);

            command.ExecuteNonQuery();

            return(entity);
        }
Esempio n. 17
0
        public static int UpdateStatus(SettingCustomerEntity entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("Promotion_SetSettingCustomerStatus");

            command.SetParameterValue("EditUser", ConstValues.EditUser);
            command.SetParameterValue("Status", entity.Status);
            command.SetParameterValue("SysNo", entity.SysNo);
            command.SetParameterValue("CompanyCode", ConstValues.CompanyCode);
            return(command.ExecuteNonQuery());
        }
Esempio n. 18
0
        public void CreateGiftRules(ProductItemInfo productItem, BatchCreateGiftRuleInfo ruleInfo)
        {
            DataCommand dataCommand = DataCommandManager.GetDataCommand("SaleGift_CreateGiftRules");

            dataCommand.SetParameterValue("@PromotionSysNo", ruleInfo.PromotionSysNo);
            dataCommand.SetParameterValue("@ProductSysNo", productItem.ProductSysNo);
            dataCommand.SetParameterValue("@Count", productItem.HandselQty);
            dataCommand.SetParameterValue("@Priority", productItem.Priority);
            dataCommand.ExecuteNonQuery();
        }
Esempio n. 19
0
        public void UpdateGiftIsGlobal(int promotionSysNo, string isGlobal, string companyCode, string user)
        {
            DataCommand dataCommand = DataCommandManager.GetDataCommand("BatchCreateSaleGift_UpdateGiftIsGlobal");

            dataCommand.SetParameterValue("@PromotionSysNo", promotionSysNo);
            dataCommand.SetParameterValue("@IsGlobal", isGlobal);
            dataCommand.SetParameterValue("@CompanyCode", companyCode);
            dataCommand.SetParameterValue("@EditUser", user);
            dataCommand.ExecuteNonQuery();
        }
Esempio n. 20
0
        /// <summary>
        /// 删除模板
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public ProductProfileTemplateInfo DeleteProductProfileTemplate(ProductProfileTemplateInfo entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("DeleteProductProfileTemplate");

            cmd.SetParameterValue("@TemplateName", entity.TemplateName);
            cmd.SetParameterValue("@TemplateType", entity.TemplateType);
            cmd.SetParameterValue("@UserId", entity.UserId);
            cmd.ExecuteNonQuery();
            return(entity);
        }
Esempio n. 21
0
        /// <summary>
        /// 更新承运商信息
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public int UpdateOrderCarrier(OrderInfo order)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(OrderStatement.UpdateOrderCarrier, "Text"));

            command.AddInputParameter("@CarrierID", DbType.Int32, order.CarrierID);
            command.AddInputParameter("@PlanID", DbType.Int32, order.PlanID);
            command.AddInputParameter("@DeliveryStatus", DbType.String, order.DeliveryStatus);//是否安排物流计划  T是/F否
            command.AddInputParameter("@OrderID", DbType.Int32, order.OrderID);
            return(command.ExecuteNonQuery());
        }
Esempio n. 22
0
        /// <summary>
        /// 将该位置系统之前添加的数据标记为待删除
        /// </summary>
        /// <param name="pagetype"></param>
        /// <param name="positionid"></param>
        /// <param name="pageID"></param>
        public static void UpdateInvalidData(int pagetype, int positionid, int pageID)
        {
            DataCommand command = DataCommandManager.GetDataCommand("UpdateInvalidData");

            command.ReplaceParameterValue("@PageType", pagetype.ToString());
            command.ReplaceParameterValue("@PageID", pageID.ToString());
            command.ReplaceParameterValue("@PositionID", positionid.ToString());
            command.ReplaceParameterValue("@CompanyCode", CompanyCode);
            command.ExecuteNonQuery();
        }
Esempio n. 23
0
        /// <summary>
        /// 删除作废已标记数据
        /// </summary>
        /// <param name="pagetype"></param>
        /// <param name="positionid"></param>
        /// <param name="pageID"></param>
        public static void DeleteOnlineListItem(int pagetype, int positionid, int pageID)
        {
            DataCommand command = DataCommandManager.GetDataCommand("DeleteOnlineListSystem");

            command.ReplaceParameterValue("@PageType", pagetype.ToString());
            command.ReplaceParameterValue("@PageID", pageID.ToString());
            command.ReplaceParameterValue("@PositionID", positionid.ToString());
            command.ReplaceParameterValue("@CompanyCode", CompanyCode);
            command.ExecuteNonQuery();
        }
Esempio n. 24
0
 public int InsertUser(Model.User user)
 {
     var cmd = new DataCommand("InsertUser", new SqlCustomDbCommand());
     cmd.SetParameterValue("@ID", user.Id);
     cmd.SetParameterValue("@Name", user.UserName);
     cmd.SetParameterValue("@PassWord", user.PassWord);
     cmd.SetParameterValue("@Status", user.Status);
     cmd.SetParameterValue("@GroupId", user.GroupId);
     return cmd.ExecuteNonQuery();
 }
Esempio n. 25
0
        /// <summary>
        /// 添加商家订单出库日志
        /// </summary>
        /// <param name="soSysNo">订单系统编号</param>
        /// <param name="inUserSysNo"></param>
        /// <param name="metShipViaCode"></param>
        /// <param name="metPackpageNumber"></param>
        public void InsertMerchantShippingLog(int soSysNo, int inUserSysNo, string metShipViaCode, string metPackpageNumber)
        {
            DataCommand command = DataCommandManager.GetDataCommand("SO_Insert_MerchantShippingLog");

            command.SetParameterValue("@SOSysNo", soSysNo);
            command.SetParameterValue("@METShipViaCode", metShipViaCode);
            command.SetParameterValue("@METPackageNumber", metPackpageNumber);
            command.SetParameterValue("@InUser", inUserSysNo);
            command.ExecuteNonQuery();
        }
Esempio n. 26
0
        public static void UpdateGiftItemCount(int promotionSysNo, SaleGiftGiftItemType giftComboType, int?itemGiftCount, string userName)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("SaleGift_UpdateGiftItemCount");

            cmd.SetParameterValue("@PromotionSysNo", promotionSysNo);
            cmd.SetParameterValue("@GiftComboType", giftComboType == SaleGiftGiftItemType.AssignGift ? "A" : "O");
            cmd.SetParameterValue("@ItemGiftCount", itemGiftCount);
            cmd.SetParameterValue("@InUser", userName);
            cmd.ExecuteNonQuery();
        }
Esempio n. 27
0
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="info"></param>
        public void ActiveCategoryRequest(CategoryRequestApprovalInfo info)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("ActiveCategoryRequest");

            dc.SetParameterValue("@SysNo", info.SysNo);
            dc.SetParameterValue("@Status", info.Status);
            dc.SetParameterValue("@AuditUserSysNo", ServiceContext.Current.UserSysNo);
            dc.SetParameterValue("@CategorySysNo", info.CategorySysNo);
            dc.ExecuteNonQuery();
        }
Esempio n. 28
0
        public void UpdateRefundPayTypeAndReason(int sysNo, int refundPayType, int refundReason)
        {
            DataCommand command = DataCommandManager.GetDataCommand("UpdateRefundPayTypeAndReason");

            command.SetParameterValue("@SysNo", sysNo);
            command.SetParameterValue("@RefundPayType", refundPayType);
            command.SetParameterValue("@RefundReason", refundReason);

            command.ExecuteNonQuery();
        }
Esempio n. 29
0
        public void UpdateInventory(int wareshouseSysNo, int productSysNo, bool isRecv, string companyCode)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateInventory");

            cmd.SetParameterValue("@WHSysNo", wareshouseSysNo);
            cmd.SetParameterValue("@ProductSysNo", productSysNo);
            cmd.SetParameterValue("@IsRecv", isRecv ? 1 : 0);
            cmd.SetParameterValue("@CompanyCode", companyCode);
            cmd.ExecuteNonQuery();
        }
Esempio n. 30
0
        public VendorStoreInfo Update(VendorStoreInfo entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("UpdateVendorStore");

            command.SetParameterValue(entity);

            command.ExecuteNonQuery();

            return(Load(entity.SysNo.Value));
        }
Esempio n. 31
0
 public bool SaveAlloctionAndLog(string sql)
 {
     var cmd = new DataCommand("saveAlloctionAndLog", new SqlCustomDbCommand());
     cmd.ReplaceParameterValue("#sql#", sql);
     int result = cmd.ExecuteNonQuery();
     if (result > 0)
         return true;
     else
         return false;
 }
Esempio n. 32
0
        /// <summary>
        /// 创建品牌报备
        /// </summary>
        public int InsertStoreBrandFiling(StoreBrandFilingInfo entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("InsertStoreBrandFiling");

            cmd.SetParameterValue <StoreBrandFilingInfo>(entity);
            cmd.ExecuteNonQuery();
            int sysNo = (int)cmd.GetParameterValue("@SysNo");

            return(sysNo);
        }
Esempio n. 33
0
        /// <summary>
        /// 设置付款单凭证号
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public PayItemInfo SetReferenceID(int sysNo, string referenceID)
        {
            DataCommand command = DataCommandManager.GetDataCommand("UpdatePayItemReferenceID");

            command.SetParameterValue("@SysNo", sysNo);
            command.SetParameterValue("@ReferenceID", referenceID);

            command.ExecuteNonQuery();
            return(Load(sysNo));
        }
Esempio n. 34
0
 public void LockProductCostInList(List <ProductCostIn> list)
 {
     foreach (var item in list)
     {
         DataCommand cmd = DataCommandManager.GetDataCommand("Inventory_LockProductCostInList");
         cmd.SetParameterValue("@SysNo", item.SysNo);
         cmd.SetParameterValue("@LockQuantity", item.LockQuantity);
         cmd.ExecuteNonQuery();
     }
 }
Esempio n. 35
0
        public static int WriteProcessLog(int sysNumber, string type, string memo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("WriteProcessLog");

            command.SetParameterValue("@Number", sysNumber);
            command.SetParameterValue("@Type", type);
            command.SetParameterValue("@Memo", memo);

            return(command.ExecuteNonQuery());
        }
Esempio n. 36
0
 public bool AddCommPrice(Model.TB_Price_CommBill model)
 {
     var cmd = new DataCommand("addCommPrice", new SqlCustomDbCommand());
     cmd.SetParameterValue("@EnergyCode", model.EnergyCode);
     cmd.SetParameterValue("@Price", model.Price);
     int result = cmd.ExecuteNonQuery();
     if (result > 0)
         return true;
     else
         return false;
 }
Esempio n. 37
0
 public int SaveQuotaAlarm(Model.QuotaAlarmDataContact quotaAlarmData)
 {
     var cmd = new DataCommand("SaveQuotaAlarmData", new SqlCustomDbCommand());
     cmd.SetParameterValue("@AlarmType", quotaAlarmData.AlarmType);
     cmd.SetParameterValue("@ObjectDesc", quotaAlarmData.ObjectDesc);
     cmd.SetParameterValue("@ObjectType", quotaAlarmData.ObjectType);
     cmd.SetParameterValue("@ObjectId", quotaAlarmData.ObjectId);
     cmd.SetParameterValue("@QuotaType", quotaAlarmData.QuotaType);
     cmd.SetParameterValue("@ItemCode", quotaAlarmData.ItemCode);
     cmd.SetParameterValue("@Percent", quotaAlarmData.Percent);
     return cmd.ExecuteNonQuery();
 }
Esempio n. 38
0
 public int SetBussinessLog(BussinessLogModel bussinessLog)
 {
     // add something to database
     DataCommand command = new DataCommand("InsertSystemLog", new SqlCustomDbCommand());
     command.SetParameterValue("@modelname", bussinessLog.ModelName);
     command.SetParameterValue("@logtime", bussinessLog.OperatorTime);
     command.SetParameterValue("@logcontent", string.IsNullOrEmpty(bussinessLog.OperatorContent) ? (bussinessLog.ModelName + "执行了操作。") : bussinessLog.OperatorContent);
     command.SetParameterValue("@optype", bussinessLog.ModelType);
     command.SetParameterValue("@username", bussinessLog.UserName);
     command.ExecuteNonQuery();
     return 0;
 }
Esempio n. 39
0
 public int SaveImportEneryValue(ImportTemp import)
 {
     var cmd = new DataCommand("ImportData", new SqlCustomDbCommand());
     cmd.SetParameterValue("@ObjectID", import.ObjectId);
     cmd.SetParameterValue("@IsArea", import.IsArea);
     cmd.SetParameterValue("@StartTime", import.StartTime);
     cmd.SetParameterValue("@EndTime", import.EndTime);
     cmd.SetParameterValue("@ItemCode", import.ItemCode);
     cmd.SetParameterValue("@ImportValue", import.ImportValue);
     cmd.SetParameterValue("@MonthType", import.MonthType);
     cmd.SetParameterValue("@ExcelId", import.ExcelId);
     return cmd.ExecuteNonQuery();
 }
Esempio n. 40
0
 public bool AddParValue(Model.TB_PAR_VALUE_SET model)
 {
     var cmd = new DataCommand("addParValue", new SqlCustomDbCommand());
     cmd.SetParameterValue("@CNAME", model.CNAME);
     cmd.SetParameterValue("@DATE", model.DATE);
     cmd.SetParameterValue("@PRICE", model.PRICE);
     cmd.SetParameterValue("@TYPEID", model.TYPEID);
     int result = cmd.ExecuteNonQuery();
     if (result > 0)
         return true;
     else
         return false;
 }
Esempio n. 41
0
        public int InsertQuota(Model.TB_Quota quotaData, Model.TS_Quota_Log quotaLogData)
        {
            var cmd = new DataCommand("InsertQuota", new SqlCustomDbCommand());
            cmd.SetParameterValue("@QuotaId", quotaData.QuotaId);
            cmd.SetParameterValue("@ObjectDesc", quotaData.ObjectDesc);
            cmd.SetParameterValue("@ObjectType", quotaData.ObjectType);
            cmd.SetParameterValue("@ObjectId", quotaData.ObjectId);
            cmd.SetParameterValue("@QuotaTime", quotaData.QuotaTime);
            cmd.SetParameterValue("@QuotaValue", quotaData.QuotaValue);
            cmd.SetParameterValue("@Reserved", quotaData.Reserved);
            cmd.SetParameterValue("@QuotaType", quotaData.QuotaType);
            cmd.SetParameterValue("@ItemCode", quotaData.ItemCode);

            cmd.SetParameterValue("@LogTime", quotaLogData.LogTime);
            cmd.SetParameterValue("@UserName", quotaLogData.UserName);
               return cmd.ExecuteNonQuery();
        }
Esempio n. 42
0
        public ResultExcelImport SaveImportExcel(int monthType, int isArea, string excelPath)
        {
            try
            {
                var cmd = new DataCommand("SaveImportExcel", new SqlCustomDbCommand());
                cmd.SetParameterValue("@monthType", monthType);
                cmd.SetParameterValue("@isArea", isArea);
                cmd.SetParameterValue("@excelPath", excelPath);
                cmd.ExecuteNonQuery();
                return new ResultExcelImport() {Success = true,MsgContent = "文件批量上传成功,后台系统在努力处理,根据您上传的数据量,可能会花费几分钟或几个小时。"};
            }
            catch (Exception e)
            {

                return new ResultExcelImport() {Success = false, MsgContent = e.Message};
            }
        }
Esempio n. 43
0
        /// <summary>
        /// 更新设备属性
        /// </summary>
        /// <param name="areaId"></param>
        /// <param name="itemCodeId"></param>
        /// <param name="areaType"></param>
        /// <param name="deviceIds"></param>
        /// <returns></returns>
        public int UpdateDeviceProp(int areaId, int itemCodeId, int areaType, List<int> deviceIds)
        {
            string sql = string.Empty;
            string columName = "areaid1";
            if (areaType == 2)
            {
                columName = "areaid2";
            }
            // sql = string.Format("update tb_device_property set {0}=null where device_itemcode in (select ID from dbo.GetAllChildren({1}))  or device_itemcode={2} ", columName, itemCodeId, itemCodeId);

            foreach (var item in deviceIds)
            {
                sql += string.Format(" update tb_device_property set {0}={1} where id= {2} ", columName, areaId, item);
            }
            if (string.IsNullOrEmpty(sql))
            {
                return 0;
            }
            var cmd = new DataCommand("updateDeviceProp", new SqlCustomDbCommand());
            cmd.ReplaceParameterValue("#sql#", sql);
            int result = cmd.ExecuteNonQuery();
            return result;
        }
Esempio n. 44
0
 /// <summary>
 /// 更新设备itemCode
 /// </summary>
 /// <param name="itemCodeId"></param>
 /// <param name="deviceIds"></param>
 /// <returns></returns>
 public int UpdateDeviceProp(int itemCodeId, List<int> deviceIds, string columnName)
 {
     string sql = string.Empty;
     foreach (var item in deviceIds)
     {
         sql += string.Format(" update tb_device_property set {0}={1} where id= {2} ", columnName, itemCodeId, item);
     }
     if (string.IsNullOrEmpty(sql))
     {
         return 0;
     }
     var cmd = new DataCommand("updateDeviceProp", new SqlCustomDbCommand());
     cmd.ReplaceParameterValue("#sql#", sql);
     return cmd.ExecuteNonQuery();
 }
Esempio n. 45
0
 /// <summary>
 /// 阶梯模式保存 (新增、修改)
 /// </summary>
 /// <param name="sql"></param>
 /// <returns></returns>
 public bool SaveRatePrice(string sql)
 {
     var cmd = new DataCommand("addRatePrice", new SqlCustomDbCommand());
     //cmd.SetParameterValue("@sql", sql);
     cmd.ReplaceParameterValue("#sql#", sql);
     int result = cmd.ExecuteNonQuery();
     if (result > 0)
         return true;
     else
         return false;
 }
Esempio n. 46
0
        public bool InsertAlarmScale(int alarmType, int scale)
        {
            var cmd = new DataCommand("insertAlarmScale", new SqlCustomDbCommand());
            cmd.SetParameterValue("@alarmType", alarmType);
            cmd.SetParameterValue("@scale", scale);

            int result = cmd.ExecuteNonQuery();
            if (result > 0)
                return true;
            else
                return false;
        }
Esempio n. 47
0
        /// <summary>
        /// 更新告警类型等级
        /// </summary>
        /// <param name="levelId">告警等级Id</param>
        /// <param name="Id">告警类型Id</param>
        /// <returns></returns>
        public int UpdateAlarmTypeLevelById(int levelId, int Id)
        {
            var cmd = new DataCommand("updateAlarmTypeLevelById", new SqlCustomDbCommand());
            cmd.SetParameterValue("@alarmLevelId", levelId);
            cmd.SetParameterValue("@Id", Id);

            return cmd.ExecuteNonQuery();
        }
Esempio n. 48
0
        public int UpdateAlarmEventByID(Model.QueryFile.QueryAlarmEvent alarmEvent)
        {
            var cmd = new DataCommand("updateAlarmEventByID", new SqlCustomDbCommand());

            cmd.SetParameterValue("@TrigMode", alarmEvent.TrigMode);
            cmd.SetParameterValue("@RunMode", alarmEvent.RunMode);
            cmd.SetParameterValue("@RunCount", alarmEvent.RunCount);
            cmd.SetParameterValue("@RunTime", alarmEvent.RunTime);
            cmd.SetParameterValue("@Options", alarmEvent.Options);
            cmd.SetParameterValue("@Id", alarmEvent.ID);
            return cmd.ExecuteNonQuery();
        }
Esempio n. 49
0
        public bool UpdateAlarmScaleByID(int id, int scale)
        {
            var cmd = new DataCommand("updateAlarmScaleByID", new SqlCustomDbCommand());
            cmd.SetParameterValue("@id", id);
            cmd.SetParameterValue("@scale", scale);

            int result = cmd.ExecuteNonQuery();
            if (result > 0)
                return true;
            else
                return false;
        }
Esempio n. 50
0
        /// <summary>
        /// 更新告警触发事件表
        /// </summary>
        /// <param name="alarmEvent"></param>
        /// <returns></returns>
        public int UpdateAlarmEvent(Model.QueryFile.QueryAlarmEvent alarmEvent)
        {
            var aeEntity = this.GetAlarmEventById(alarmEvent.ID);
            if (aeEntity == null)
            {//insert
                var cmd = new DataCommand("insertAlarmEvent", new SqlCustomDbCommand());
                cmd.SetParameterValue("@AlarmTypeId", alarmEvent.AlarmTypeId);
                cmd.SetParameterValue("@PlugIn", alarmEvent.PlugIn);
                cmd.SetParameterValue("@TrigMode", alarmEvent.TrigMode);
                cmd.SetParameterValue("@RunMode", alarmEvent.RunMode);
                cmd.SetParameterValue("@RunCount", alarmEvent.RunCount);
                cmd.SetParameterValue("@RunTime", alarmEvent.RunTime);
                cmd.SetParameterValue("@Options", alarmEvent.Options);
                cmd.SetParameterValue("@PROJECTID", alarmEvent.PROJECTID);
                cmd.SetParameterValue("@SYSTEMID", alarmEvent.SYSTEMID);

                return cmd.ExecuteNonQuery();
            }
            else
            {//update
                aeEntity.AlarmTypeId = (aeEntity.AlarmTypeId != alarmEvent.AlarmTypeId) ? alarmEvent.AlarmTypeId : aeEntity.AlarmTypeId;
                aeEntity.PlugIn = string.IsNullOrEmpty(alarmEvent.PlugIn) ? aeEntity.PlugIn : alarmEvent.PlugIn;
                aeEntity.TrigMode = (aeEntity.TrigMode != alarmEvent.TrigMode) ? alarmEvent.TrigMode : aeEntity.TrigMode;
                aeEntity.RunMode = (aeEntity.RunMode != alarmEvent.RunMode) ? alarmEvent.RunMode : aeEntity.RunMode;
                aeEntity.RunCount = (aeEntity.RunCount != alarmEvent.RunCount) ? alarmEvent.RunCount : aeEntity.RunCount;
                aeEntity.RunTime = (aeEntity.RunTime != alarmEvent.RunTime) ? alarmEvent.RunTime : aeEntity.RunTime;
                aeEntity.Options = string.IsNullOrEmpty(alarmEvent.Options) ? aeEntity.Options : alarmEvent.Options;
                aeEntity.ProjectId = (aeEntity.ProjectId != alarmEvent.PROJECTID) ? alarmEvent.PROJECTID : aeEntity.ProjectId;
                aeEntity.SystemId = (aeEntity.SystemId != alarmEvent.SYSTEMID) ? alarmEvent.SYSTEMID : aeEntity.SystemId;

                var cmd = new DataCommand("updateAlarmEvent", new SqlCustomDbCommand());
                cmd.SetParameterValue("@AlarmTypeId", aeEntity.AlarmTypeId);
                cmd.SetParameterValue("@PlugIn", aeEntity.PlugIn);
                cmd.SetParameterValue("@TrigMode", aeEntity.TrigMode);
                cmd.SetParameterValue("@RunMode", aeEntity.RunMode);
                cmd.SetParameterValue("@RunCount", aeEntity.RunCount);
                cmd.SetParameterValue("@RunTime", aeEntity.RunTime);
                cmd.SetParameterValue("@Options", aeEntity.Options);
                cmd.SetParameterValue("@PROJECTID", aeEntity.ProjectId);
                cmd.SetParameterValue("@SYSTEMID", aeEntity.SystemId);
                cmd.SetParameterValue("@Id", aeEntity.ID);

                return cmd.ExecuteNonQuery();
            }
        }
Esempio n. 51
0
        public int UpdateQuota(Model.TB_Quota quotaData, Model.TS_Quota_Log quotaLogData)
        {
            var cmd = new DataCommand("UpdateQuota", new SqlCustomDbCommand());
            cmd.SetParameterValue("@QuotaId", quotaData.QuotaId);
            cmd.SetParameterValue("@QuotaTime", quotaData.QuotaTime);
            cmd.SetParameterValue("@QuotaValue", quotaData.QuotaValue);
            cmd.SetParameterValue("@Reserved", quotaData.Reserved);
            cmd.SetParameterValue("@QuotaType", quotaData.QuotaType);

            cmd.SetParameterValue("@LogTime", quotaLogData.LogTime);
            cmd.SetParameterValue("@UserName", quotaLogData.UserName);
            return cmd.ExecuteNonQuery();
        }
Esempio n. 52
0
 public int DeleteUser(int id)
 {
     var cmd = new DataCommand("DeleteUser", new SqlCustomDbCommand());
     cmd.SetParameterValue("@Id", id);
     return cmd.ExecuteNonQuery();
 }
Esempio n. 53
0
 public int DeleteUserGroup(int userGroupId)
 {
     var cmd = new DataCommand("DeleteUserGroup", new SqlCustomDbCommand());
     cmd.SetParameterValue("@UserGroupId", userGroupId);
     return cmd.ExecuteNonQuery();
 }
Esempio n. 54
0
 public int SaveUserGroupInfo(Model.UserGroup userGroup, string menuIds, string objectIds, string objectTypes)
 {
     var cmd = new DataCommand("SaveUserGroupInfo", new SqlCustomDbCommand());
     cmd.SetParameterValue("@Id", userGroup.Id);
     cmd.SetParameterValue("@Name", userGroup.Name);
     cmd.SetParameterValue("@Description", userGroup.Description);
     cmd.SetParameterValue("@Groups", string.Empty);
     cmd.SetParameterValue("@MenuRightIds", menuIds);
     cmd.SetParameterValue("@ObjectRightIds", objectIds);
     cmd.SetParameterValue("@ObjectTypes", objectTypes);
     var result = cmd.ExecuteNonQuery();
     return result;
 }