Exemplo n.º 1
0
        public List<AlarmDiagnoseModel> GetAlarmDiagnose(QueryAlarm query)
        {
            try
            {
                var cmd = new DataCommand("getAlarmDiagnose", new SqlCustomDbCommand());
                IList<string> objectIds = new AlarmAccess().GetAlarmListAreaId(query.ObjectId, query.ObjType);
                StringBuilder sb = new StringBuilder();
                foreach (string s in objectIds)
                {
                    sb.Append(s);
                    sb.Append(",");
                }
                sb.Remove(sb.Length - 1, 1);
                cmd.ReplaceParameterValue("#ObjectId#", sb.ToString());
                cmd.SetParameterValue("@StartTime", query.StartTime);
                cmd.SetParameterValue("@EndTime", query.EndTime);

                return cmd.ExecuteEntityList<AlarmDiagnoseModel>();
            }
            catch(Exception ee)
            {
                throw ee;
                //return null;
            }
        }
Exemplo n.º 2
0
        public List<CostQueryModel> GetCostQuery(QueryCost query)
        {
            try
            {
                var cmd = new DataCommand("getCostQuery", new SqlCustomDbCommand());
                string table = "";
                switch (query.Particle)
                {
                    case Particle.Month:
                        table = string.Format("TS_FEE_DAY_{0}", query.StartTime.Year);
                        break;
                    case Particle.Year:
                        table = string.Format("TS_FEE_MONTH_{0}", query.StartTime.Year);
                        break;
                    default:
                        table = string.Format("TS_FEE_DAY_{0}", query.StartTime.Year);
                        break;
                }
                cmd.ReplaceParameterValue("#TableName#", table);
                cmd.SetParameterValue("@OBJECTID", query.ObjectId.ToString());
                cmd.SetParameterValue("@ITEMCODE", query.ItemCode);
                cmd.SetParameterValue("@StartTime", query.StartTime);
                cmd.SetParameterValue("@EndTime", query.EndTime);

                return cmd.ExecuteEntityList<CostQueryModel>();
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Exemplo n.º 3
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();
 }
Exemplo n.º 4
0
 public int UpdateUser(Model.User user)
 {
     var cmd = new DataCommand("UpDateUser", 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();
 }
Exemplo n.º 5
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;
 }
Exemplo n.º 6
0
        /// <summary>
        /// 获取表的基础数据集
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static DataTable GetBaseData(BaseDataModel model)
        {
            var dtold = new DataTable();
            var tcount = new List<string>();
            var cmdName = string.Empty;
            tcount = GetTcountNames(model, tcount);
            switch (model.Unit)
            {
                case ChartUnit.unit_hour:
                    cmdName = "getBaseDataByHour";
                    break;
                case ChartUnit.unit_day:
                    cmdName = "getBaseDataByDate";
                    break;
                case ChartUnit.unit_month:
                    cmdName = "getBaseDataByMonth";
                    break;
                default:
                    cmdName = "getBaseDataByMonth";
                    break;
            }
            //var cmd = new DataCommand(cmdName, new SqlCustomDbCommand());
            //cmd.SetParameterValue("@countid", model.ObjectId);
            //cmd.SetParameterValue("@itemcode", model.ItemCode);
            for (var i = 0; i < tcount.Count; i++)
            {
                var cmd = new DataCommand(cmdName, new SqlCustomDbCommand());
                cmd.SetParameterValue("@countid", model.ObjectId);
                cmd.SetParameterValue("@itemcode", model.ItemCode);

                cmd.ReplaceParameterValue("#TableName#", tcount[i]);
                //cmd.SetParameterValue("#TableName#", tcount[i]);
                //object param = cmd.GetParameterValue("#TableName#");
                //cmd.SetParameterValue("@tname", tcount[i]);
                DataTable dts;
                if (model.Unit == ChartUnit.unit_hour)
                {
                    cmd.SetParameterValue("@cdate", model.Starttime.ToString("yyyy-MM-dd"));
                }
                try
                {
                    dts = cmd.ExecuteDataSet().Tables[0];

                    dtold = i.Equals(0) ? dts.Clone() : dtold;
                    dtold = UniteDataTable(dtold, dts.Copy());
                }
                catch (Exception e)
                {
                    //throw new Exception(e.Message);
                }
            }
            return MakerData(dtold, model);
        }
Exemplo n.º 7
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;
 }
Exemplo n.º 8
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;
 }
Exemplo n.º 9
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();
        }
Exemplo n.º 10
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;
 }
Exemplo n.º 11
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();
        }
Exemplo n.º 12
0
        /// <summary>
        /// 获取告警触发事件
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public Model.TB_AlarmEvent GetAlarmEventById(int Id)
        {
            var cmd = new DataCommand("getAlarmEventById", new SqlCustomDbCommand());
            cmd.SetParameterValue("@Id", Id);

            return cmd.ExecuteEntity<Model.TB_AlarmEvent>();
        }
Exemplo n.º 13
0
 public List<TB_Alloction_Config> GetAlloctionConfig(Queryfeeapportion feeApport)
 {
     try
     {
         var cmd = new DataCommand("GetAlloctionConfig", new SqlCustomDbCommand());
         cmd.SetParameterValue("@OBJECTID", feeApport.ObjectId);
         cmd.SetParameterValue("@ITEMCODE", feeApport.ItemCode);
         cmd.SetParameterValue("@YEAR", feeApport.StartTime.Year);
         cmd.SetParameterValue("@MONTH", feeApport.StartTime.Month);
         return cmd.ExecuteEntityList<TB_Alloction_Config>();
     }
     catch (Exception ee)
     {
         throw ee;
     }
 }
Exemplo n.º 14
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};
            }
        }
Exemplo n.º 15
0
        public List<CostQueryModel> GetCostQuery(Queryfeeapportion query, DateTime dtBegin, DateTime dtEnd)
        {
            try
            {
                var cmd = new DataCommand("getCostQuery2", new SqlCustomDbCommand());
                string table = "TS_FEE_DAY_" + query.StartTime.Year;
                cmd.ReplaceParameterValue("#TableName#", table);
                cmd.SetParameterValue("@OBJECTID", query.ObjectId.ToString());
                cmd.SetParameterValue("@ITEMCODE", query.ItemCode);
                cmd.SetParameterValue("@StartTime", dtBegin);
                cmd.SetParameterValue("@EndTime", dtEnd);

                return cmd.ExecuteEntityList<CostQueryModel>();
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Exemplo n.º 16
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;
 }
Exemplo n.º 17
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();
 }
Exemplo n.º 18
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;
        }
Exemplo n.º 19
0
 public TB_AreaInfo GetAreaInfo(int areaId)
 {
     try
     {
         var cmd = new DataCommand("GetAreaInfo", new SqlCustomDbCommand());
         cmd.SetParameterValue("@ID", areaId);
         return cmd.ExecuteEntity<TB_AreaInfo>();
     }
     catch (Exception ee)
     {
         throw ee;
     }
 }
Exemplo n.º 20
0
 public int GetUserGroupID(string username)
 {
     try
     {
         var cmd = new DataCommand("GetUserGroupID", new SqlCustomDbCommand());
         cmd.SetParameterValue("@cname", username);
         return int.Parse(cmd.ExecuteScalar().ToString());
     }
     catch (Exception ee)
     {
         throw ee;
     }
 }
Exemplo n.º 21
0
 public List<StepSettingModel> GetStepSetting(string itemcode)
 {
     try
     {
         var cmd = new DataCommand("getStepSetting", new SqlCustomDbCommand());
         cmd.SetParameterValue("@ITEMCODE", itemcode);
         return cmd.ExecuteEntityList<StepSettingModel>();
     }
     catch (Exception ee)
     {
         throw ee;
     }
 }
Exemplo n.º 22
0
 public Model.TB_BECM_COUNTTYPE GetCountType(string energyId)
 {
     try
     {
         var cmd = new DataCommand("getCountType", new SqlCustomDbCommand());
         cmd.SetParameterValue("@energyId", energyId);
         return cmd.ExecuteEntity<Model.TB_BECM_COUNTTYPE>();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemplo n.º 23
0
 public string GetUserGroupName(int userGroupId)
 {
     try
     {
         var cmd = new DataCommand("GetUserGroupName", new SqlCustomDbCommand());
         cmd.SetParameterValue("@Id", userGroupId);
         return cmd.ExecuteScalar().ToString();
     }
     catch (Exception)
     {
         return string.Empty;
     }
 }
Exemplo n.º 24
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();
 }
Exemplo n.º 25
0
        //        public DataTable GetMenuTree(string username)
        //        {
        //            try
        //            {
        //                string SQL = string.Format(@"select A.ID MenuID,A.MenuName,A.LinkName,A.IconClass,A.ParentID from dbo.TB_MENU A
        //JOIN TB_USERGROUPMENURIGHT B ON A.ID=B.MENUID
        //JOIN TB_USER C ON B.USERGROUPID=C.GROUPS
        //WHERE C.CNAME='{0}'
        //order by A.ID", username);
        //                return SqlHelper.Query(SQL).Tables[0];
        //            }
        //            catch (Exception ex)
        //            {
        //                throw new Exception(ex.Message);
        //            }
        //        }
        public List<MenuModel> GetMenus(string username)
        {
            try
            {

                var cmd = new DataCommand("getMenus", new SqlCustomDbCommand());
                cmd.SetParameterValue("@CNAME", username);
                return cmd.ExecuteEntityList<MenuModel>();
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Exemplo n.º 26
0
        public List<TB_AreaInfo> GetAreaList(List<int> areaId )
        {
            try
            {
                string strArea = listToString(areaId);
                var cmd = new DataCommand("GetAreaList", new SqlCustomDbCommand());
                cmd.SetParameterValue("@AREAID", strArea);

                return cmd.ExecuteEntityList<TB_AreaInfo>();
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Exemplo n.º 27
0
 public HistoryImport GetResultImportList(HistoryQuery import, int action)
 {
     var result = new HistoryImport { HistoryItem = new List<ResultImport>(), PageInfo = new PageInfo() };
     var cmd = new DataCommand("SearchImportData", new SqlCustomDbCommand());
     var whereStr = new StringBuilder();
     if (import.DeviceId == null || import.DeviceId==0)
     {
         if (!string.IsNullOrEmpty(import.ObjectId.ToString()))
         {
             whereStr.Append(string.Format(" and import.ObjectID={0}", import.ObjectId));
         }
     }
     else
     {
         whereStr.Append(string.Format(" and import.ObjectID={0}", import.DeviceId));
     }
     if (!string.IsNullOrEmpty(import.Starttime.ToString()))
     {
         whereStr.Append(string.Format(" and import.Starttime>='{0}'", import.Starttime));
     }
     if (!string.IsNullOrEmpty(import.Endtime.ToString()))
     {
         whereStr.Append(string.Format(" and import.Starttime<='{0}'", import.Endtime));
     }
     if (!string.IsNullOrEmpty(import.ItemCode))
     {
         whereStr.Append(string.Format(" and import.ItemCode='{0}'", import.ItemCode));
     }
     if (!string.IsNullOrEmpty(import.DateUnit.ToString(CultureInfo.InvariantCulture)))
     {
         whereStr.Append(string.Format(" and import.MonthType={0}", import.DateUnit));
     }
     cmd.SetParameterValue("@action", action);
     cmd.ReplaceParameterValue("#whereStr#", whereStr.ToString());
     cmd.ReplaceParameterValue("#pagesize#",import.PaddingInfo.PageSize.ToString(CultureInfo.InvariantCulture));
     cmd.ReplaceParameterValue("#pagenums#", ((import.PaddingInfo.Page - 1) * import.PaddingInfo.PageSize).ToString(CultureInfo.InvariantCulture));
     result.HistoryItem = cmd.ExecuteEntityList<ResultImport>();
     foreach (var item in result.HistoryItem)
     {
         item.ObjectName = GetObjectName(item.IsArea, item.ObjectId);
     }
     result.PageInfo.Total = (int)cmd.GetParameterValue("@Count");
     return result;
 }
Exemplo n.º 28
0
        public decimal GetFeePrice(string itemcode)
        {
            try
            {
                var cmd = new DataCommand("GetFeePrice", new SqlCustomDbCommand());
                cmd.SetParameterValue("@itemcode", itemcode);
                object result = cmd.ExecuteScalar();
                if (result != null)
                {
                    return Convert.ToDecimal(result);
                }
                throw new Exception("该分项未设置费率");

            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// 提交审核
        /// </summary>
        /// <param name="info"></param>
        public void InsertBrandRequest(BrandRequestInfo info)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("InsertBrandRequest");

            cmd.SetParameterValue("@ManufacturerSysno", info.Manufacturer.SysNo);
            cmd.SetParameterValue("@BrandName_Ch", info.BrandNameLocal.Content);
            cmd.SetParameterValue("@BrandName_En", info.BrandNameGlobal);
            cmd.SetParameterValue("@Reason", info.Reason);
            cmd.SetParameterValue("@Status", info.ReustStatus);
            cmd.SetParameterValue("@InUser", info.User.UserName);
            cmd.SetParameterValue("@EditUser", info.User.UserName);
            cmd.SetParameterValue("@CompanyCode", info.CompanyCode);
            cmd.SetParameterValue("@LanguageCode", info.LanguageCode);
            cmd.SetParameterValue("@ProductLine", info.ProductLine);
            cmd.SetParameterValue("@BrandCode", info.BrandCode);
            cmd.ExecuteNonQuery();
        }
Exemplo n.º 30
0
 /// <summary>
 /// 根据能源类型获取平价信息
 /// </summary>
 /// <param name="energyType"></param>
 /// <returns></returns>
 public Model.TB_Price_CommBill GetCommPriceByEnergyCode(string energyCode)
 {
     var cmd = new DataCommand("getCommPriceByEnergyCode", new SqlCustomDbCommand());
     cmd.SetParameterValue("@EnergyCode", energyCode);
     return cmd.ExecuteEntity<Model.TB_Price_CommBill>();
 }
Exemplo n.º 31
0
        /// <summary>
        /// 根据CategoryType 更新
        /// </summary>
        /// <param name="type"></param>
        /// <param name="entity"></param>
        public void UpdateCategoryByType(CategoryType type, CategoryInfo entity)
        {
            DataCommand cmd = null;

            switch (type)
            {
            case CategoryType.CategoryType1:
                cmd = DataCommandManager.GetDataCommand("UpdateCategory1");
                cmd.SetParameterValue("@SysNo", entity.SysNo);
                cmd.SetParameterValue("@C1Name", entity.CategoryName.Content);
                cmd.SetParameterValue("@Status", entity.Status);
                break;

            case CategoryType.CategoryType2:
                cmd = DataCommandManager.GetDataCommand("UpdateCategory2");
                cmd.SetParameterValue("@SysNo", entity.SysNo);
                cmd.SetParameterValue("@C2Name", entity.CategoryName.Content);
                cmd.SetParameterValue("@C1SysNo", entity.ParentSysNumber);
                cmd.SetParameterValue("@Status", entity.Status);
                break;

            case CategoryType.CategoryType3:
                cmd = DataCommandManager.GetDataCommand("UpdateCategory3");
                cmd.SetParameterValue("@SysNo", entity.SysNo);
                cmd.SetParameterValue("@C3Name", entity.CategoryName.Content);
                cmd.SetParameterValue("@C2SysNo", entity.ParentSysNumber);
                cmd.SetParameterValue("@Status", entity.Status);
                cmd.SetParameterValue("@C3Code", entity.C3Code);
                break;

            default:
                break;
            }
            cmd.ExecuteNonQuery();
        }
Exemplo n.º 32
0
        public void Insert(CommissionToCashInfo commissionToCashInfo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("InsertCommissionToCashInfo");

            cmd.SetParameterValue("@UserSysNo", commissionToCashInfo.CPSUserInfo.SysNo);
            cmd.SetParameterValue("@Status", commissionToCashInfo.Status);
            cmd.SetParameterValue("@ToCashAmt", commissionToCashInfo.ToCashAmt);
            cmd.SetParameterValue("@AfterTaxAmt", commissionToCashInfo.AfterTaxAmt);
            cmd.SetParameterValue("@BankCode", commissionToCashInfo.BankCode);
            cmd.SetParameterValue("@BankName", commissionToCashInfo.BankName);
            cmd.SetParameterValue("@BranchBank", commissionToCashInfo.BranchBank);
            cmd.SetParameterValue("@BankCardNumber", commissionToCashInfo.BankCardNumber);
            cmd.SetParameterValue("@ReceivableName", commissionToCashInfo.ReceivableName);
            cmd.SetParameterValue("@IsHasInvoice", commissionToCashInfo.CanProvideInvoice);
            cmd.SetParameterValue("@InUser", commissionToCashInfo.CPSUserInfo.SysNo);
            cmd.ExecuteNonQuery();
        }
Exemplo n.º 33
0
        public int UpdateConsignSettlementRulesInfo(ConsignSettlementRulesInfo entity, BizEntity.PO.ConsignSettleRuleActionType actionType)
        {
            DataCommand command = DataCommandManager.GetDataCommand("UpdateConsignSettleRule");

            if (actionType == BizEntity.PO.ConsignSettleRuleActionType.Audit)
            {
                command.SetParameterValue("@ApprovedDate", DateTime.Now);
                command.SetParameterValue("@ApprovedUser", entity.EditUser);
            }
            else
            {
                command.SetParameterValue("@ApprovedDate", DBNull.Value);
                command.SetParameterValue("@ApprovedUser", DBNull.Value);
            }

            command.SetParameterValue("@BeginDate", entity.BeginDate);
            command.SetParameterValue("@CurrencyCode", entity.CurrencyCode);
            command.SetParameterValue("@EditDate", DateTime.Now);
            command.SetParameterValue("@EditUser", entity.EditUser);
            command.SetParameterValue("@EndDate", entity.EndDate);
            command.SetParameterValue("@LanguageCode", "zh-CN");
            command.SetParameterValue("@NewSettlePrice", entity.NewSettlePrice);
            command.SetParameterValue("@OldSetttlePrice", entity.OldSettlePrice);
            command.SetParameterValue("@ProductSysNo", entity.ProductSysNo);
            command.SetParameterValue("@SettleedQuantity", DBNull.Value);
            command.SetParameterValue("@SettleRuleName", entity.SettleRulesName);
            command.SetParameterValue("@SettleRuleQuantity", entity.SettleRulesQuantity);
            command.SetParameterValue("@SettleRulesCode", entity.SettleRulesCode);
            command.SetParameterValue("@Status", (char)entity.Status);
            if (actionType == BizEntity.PO.ConsignSettleRuleActionType.Stop)
            {
                command.SetParameterValue("@StopDate", DateTime.Now);
                command.SetParameterValue("@StopUser", entity.EditUser);
            }
            else
            {
                command.SetParameterValue("@StopDate", DBNull.Value);
                command.SetParameterValue("@StopUser", DBNull.Value);
            }
            command.SetParameterValue("@VendorSysNo", entity.VendorSysNo);
            command.SetParameterValue("@SysNo", entity.RuleSysNo);
            return(command.ExecuteNonQuery());
        }
Exemplo n.º 34
0
        /// <summary>
        /// 创建损益单
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual AdjustRequestInfo CreateAdjustRequest(AdjustRequestInfo entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("Inventory_CreateAdjustRequest");

            command.SetParameterValue("@RequestSysNo", entity.SysNo.Value);
            command.SetParameterValue("@RequestID", entity.RequestID);
            command.SetParameterValue("@StockSysNo", entity.Stock.SysNo);
            command.SetParameterValue("@CreateDate", entity.CreateDate);
            command.SetParameterValue("@CreateUserSysNo", entity.CreateUser.SysNo);
            command.SetParameterValue("@AuditDate", entity.AuditDate);
            command.SetParameterValue("@AuditUserSysNo", entity.AuditUser.SysNo);
            command.SetParameterValue("@OutStockDate", entity.OutStockDate);
            command.SetParameterValue("@OutStockUserSysNo", entity.OutStockUser.SysNo);
            command.SetParameterValue("@RequestStatus", (int?)entity.RequestStatus);
            command.SetParameterValue("@AdjustProperty", (int?)entity.AdjustProperty);
            command.SetParameterValue("@ConsignFlag", (int?)entity.ConsignFlag);
            command.SetParameterValue("@Note", entity.Note);
            command.SetParameterValue("@CompanyCode", "8601");//[Mark][Alan.X.Luo 硬编码]
            command.SetParameterValue("@ProductLineSysno", entity.ProductLineSysno);
            return(command.ExecuteEntity <AdjustRequestInfo>());
        }
Exemplo n.º 35
0
        public static QueryResult <RMARequestInfo> QueryRMARequest(RMAQueryInfo queryInfo)
        {
            if (queryInfo == null)
            {
                return(null);
            }

            DataCommand dataCommand = DataCommandManager.GetDataCommand("QueryRequests");

            dataCommand.SetParameterValue("@CustomerSysNo", queryInfo.CustomerSysNo);
            dataCommand.SetParameterValue("@SOSysNo", queryInfo.SOSysNo);
            dataCommand.SetParameterValue("@RequestID", queryInfo.RequestID);
            dataCommand.SetParameterValue("@SysNo", queryInfo.SysNo);
            if (!String.IsNullOrEmpty(queryInfo.ProductName))
            {
                queryInfo.ProductName = string.Format("%{0}%", queryInfo.ProductName.Trim());
            }

            dataCommand.SetParameterValue("@PageSize", queryInfo.PagingInfo.PageSize);
            dataCommand.SetParameterValue("@PageIndex", queryInfo.PagingInfo.PageIndex);

            DataSet dsResult = dataCommand.ExecuteDataSet();

            if (dsResult != null && dsResult.Tables.Count > 1)
            {
                DataTable              requestTable  = dsResult.Tables[0];
                DataTable              registerTable = dsResult.Tables[1];
                int                    totalCount    = Convert.ToInt32(dataCommand.GetParameterValue("@TotalCount"));
                List <RMARequestInfo>  requestList   = null;
                List <RMARegisterInfo> registerList  = null;

                if (registerTable.Rows != null && registerTable.Rows.Count > 0)
                {
                    registerList = DataMapper.GetEntityList <RMARegisterInfo, List <RMARegisterInfo> >(registerTable.Rows);
                }
                else
                {
                    registerList = new List <RMARegisterInfo>();
                }

                if (requestTable.Rows != null && requestTable.Rows.Count > 0)
                {
                    requestList = DataMapper.GetEntityList <RMARequestInfo, List <RMARequestInfo> >(requestTable.Rows);

                    requestList.ForEach(request =>
                    {
                        request.Registers = registerList.FindAll(register => register.RequestSysNo == request.SysNo);
                        //单件拆分到最细粒度
                        //if (request.Registers != null && request.Registers.Count > 0)
                        //{
                        //    IEnumerable<IGrouping<int?, RMARegisterInfo>> group = request.Registers.GroupBy(item => item.ProductSysNo);
                        //    List<RMARegisterInfo> list = new List<RMARegisterInfo>();
                        //    foreach (var item in group)
                        //    {
                        //        RMARegisterInfo info = item.First();
                        //        if (info != null)
                        //        {
                        //            info.Quantity = item.Count();
                        //            list.Add(info);
                        //        }
                        //    }
                        //    request.Registers = list;
                        //}
                    });
                }
                else
                {
                    requestList = new List <RMARequestInfo>();
                }


                int pageIndex = queryInfo.PagingInfo.PageIndex;

                if ((pageIndex * queryInfo.PagingInfo.PageSize) > totalCount)
                {
                    if (totalCount != 0 && (totalCount % queryInfo.PagingInfo.PageSize) == 0)
                    {
                        pageIndex = totalCount / queryInfo.PagingInfo.PageSize;
                    }
                    else
                    {
                        pageIndex = totalCount / queryInfo.PagingInfo.PageSize + 1;
                    }
                }

                QueryResult <RMARequestInfo> result = new QueryResult <RMARequestInfo>();
                result.ResultList          = requestList;
                result.PageInfo            = new PageInfo();
                result.PageInfo.TotalCount = totalCount;
                result.PageInfo.PageIndex  = pageIndex;
                result.PageInfo.PageSize   = queryInfo.PagingInfo.PageSize;
                result.PageInfo.SortBy     = queryInfo.PagingInfo.SortBy;
                return(result);
            }
            return(new QueryResult <RMARequestInfo>()
            {
                ResultList = new List <RMARequestInfo>(), PageInfo = new PageInfo()
            });
        }
Exemplo n.º 36
0
        /// <summary>
        /// 保存基本指标信息
        /// </summary>
        /// <param name="categoryBasicInfo"></param>
        /// <returns></returns>
        public CategoryBasic UpdateCategoryBasic(CategoryBasic categoryBasicInfo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateCategoryBasic");

            cmd.SetParameterValue("@SysNo", categoryBasicInfo.CategorySysNo);
            cmd.SetParameterValue("@IsValuableProduct", categoryBasicInfo.IsValuableProduct);
            cmd.SetParameterValue("@DMSRate", 0);
            cmd.SetParameterValue("@IsMemberArea", 0);
            categoryBasicInfo.VirtualRate = categoryBasicInfo.VirtualRate / 100;
            cmd.SetParameterValue("@VirtualRate", categoryBasicInfo.VirtualRate);
            cmd.SetParameterValue("@VirtualCount", categoryBasicInfo.VirtualCount);
            cmd.SetParameterValue("@CheapenRisk", categoryBasicInfo.CheapenRiskInfo);
            cmd.SetParameterValue("@OOSQty", categoryBasicInfo.OOSQty);
            categoryBasicInfo.OOSRate = categoryBasicInfo.OOSRate / 100;
            cmd.SetParameterValue("@OOSRate", categoryBasicInfo.OOSRate);
            cmd.SetParameterValue("@PayPeriodType", categoryBasicInfo.PayPeriodTypeInfo);
            cmd.SetParameterValue("@SafetyInventoryDay", categoryBasicInfo.SafetyInventoryDay);
            cmd.SetParameterValue("@SafetyInventoryQty", categoryBasicInfo.SafetyInventoryQty);
            cmd.SetParameterValue("@IsRequired", categoryBasicInfo.IsRequired);
            cmd.SetParameterValue("@LargeFlag", categoryBasicInfo.IsLargeInfo);
            cmd.SetParameterValue("@Quota", categoryBasicInfo.Quota);
            cmd.SetParameterValue("@MinCommission", categoryBasicInfo.MinCommission);

            cmd.ExecuteNonQuery();
            return(categoryBasicInfo);
        }
Exemplo n.º 37
0
        /// <summary>
        /// 更新类别2的基本指标信息
        /// </summary>
        /// <param name="categoryBasicInfo"></param>
        /// <returns></returns>
        public void UpdateCategory2Basic(CategoryBasic categoryBasicInfo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateCategoryKpi2");

            cmd.SetParameterValue("@SysNo", categoryBasicInfo.PropertySysNO);
            cmd.SetParameterValue("@AvgDailySalesCycle", categoryBasicInfo.AvgDailySalesCycle);
            cmd.SetParameterValue("@IsValuableProduct", categoryBasicInfo.IsValuableProduct);
            cmd.SetParameterValue("@CategorySysNo", categoryBasicInfo.Category2SysNo);
            cmd.SetParameterValue("@InStockDays", categoryBasicInfo.InStockDays);
            categoryBasicInfo.VirtualRate = categoryBasicInfo.VirtualRate / 100;
            cmd.SetParameterValue("@VirtualRate", categoryBasicInfo.VirtualRate);
            cmd.SetParameterValue("@VirtualCount", categoryBasicInfo.VirtualCount);
            cmd.SetParameterValue("@CheapenRisk", categoryBasicInfo.CheapenRiskInfo);
            cmd.SetParameterValue("@OOSQty", categoryBasicInfo.OOSQty);
            categoryBasicInfo.OOSRate = categoryBasicInfo.OOSRate / 100;
            cmd.SetParameterValue("@OOSRate", categoryBasicInfo.OOSRate);
            cmd.SetParameterValue("@LogUserName", "IPPSystemAdmin");
            cmd.SetParameterValue("@Quota", categoryBasicInfo.Quota);
            cmd.SetParameterValue("@MinCommission", categoryBasicInfo.MinCommission);
            cmd.ExecuteNonQuery();
        }
Exemplo n.º 38
0
        /// <summary>
        /// 创建厂商信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual ManufacturerInfo CreateManufacturer(ManufacturerInfo entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("CreateManufacturer");

            cmd.SetParameterValue("@ManufacturerName", entity.ManufacturerNameLocal != null ? entity.ManufacturerNameLocal.Content : null);
            cmd.SetParameterValue("@BriefName", entity.ManufacturerNameGlobal);
            cmd.SetParameterValue("@Note", entity.ManufacturerDescription != null ? entity.ManufacturerDescription.Content : null);
            cmd.SetParameterValue("@Status", entity.Status);
            cmd.SetParameterValue("@ManufacturerWebSite", entity.SupportInfo.ManufacturerUrl);
            cmd.SetParameterValue("@SupportEmail", entity.SupportInfo.ServiceEmail);
            cmd.SetParameterValue("@SupportURL", entity.SupportInfo.ServiceUrl);
            cmd.SetParameterValue("@Type", 0);
            cmd.SetParameterValue("@CustomerServicePhone", entity.SupportInfo.ServicePhone);
            cmd.SetParameterValue("@CompanyCode", entity.CompanyCode);
            cmd.SetParameterValue("@LanguageCode", entity.LanguageCode);
            cmd.ExecuteNonQuery();
            if (entity.SysNo == 0 || entity.SysNo == null)
            {
                entity.SysNo = (int)cmd.GetParameterValue("@SysNo");
            }
            return(entity);
        }
Exemplo n.º 39
0
        /// <summary>
        /// 修改厂商信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual ManufacturerInfo UpdateManufacturer(ManufacturerInfo entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateManufacturer");

            cmd.SetParameterValue("@SysNo", entity.SysNo);
            cmd.SetParameterValue("@ManufacturerID", entity.ManufacturerID);
            cmd.SetParameterValue("@ManufacturerName", entity.ManufacturerNameLocal.Content);
            cmd.SetParameterValue("@BriefName", entity.ManufacturerNameGlobal);
            cmd.SetParameterValue("@Note", entity.ManufacturerDescription != null ? entity.ManufacturerDescription.Content : null);
            cmd.SetParameterValue("@Status", entity.Status);
            cmd.SetParameterValue("@ManufacturerWebSite", entity.SupportInfo.ManufacturerUrl);
            cmd.SetParameterValue("@SupportEmail", entity.SupportInfo.ServiceEmail);
            cmd.SetParameterValue("@SupportURL", entity.SupportInfo.ServiceUrl);
            cmd.SetParameterValue("@Type", entity.BrandStoreType);
            cmd.SetParameterValue("@CustomerServicePhone", entity.SupportInfo.ServicePhone);
            cmd.SetParameterValue("@IsLogo", entity.IsLogo);
            cmd.SetParameterValue("@IsShowZone", entity.IsShowZone);
            cmd.SetParameterValue("@AdImage", entity.BrandImage);
            cmd.SetParameterValue("@NeweggUrl", entity.ShowUrl);
            cmd.ExecuteNonQuery();
            return(entity);
        }
Exemplo n.º 40
0
        private void InsertProductCommonInfoStatus(ProductCommonInfo productCommonInfo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("InsertProductCommonInfoStatus");

            cmd.SetParameterValue("@CommonSKUNumber", productCommonInfo.ProductBasicInfo.CommonSkuNumber);
            cmd.SetParameterValue("@IsChangeStyleWithTemplate", "Y");
            cmd.SetParameterValue("@IsExtendWarrantyDisuse", "N");
            cmd.SetParameterValue("@IsBasicInformationCorrect", "Y");
            cmd.SetParameterValue("@IsAccessoriesShow", productCommonInfo.ProductBasicInfo.IsAccessoryShow);
            cmd.SetParameterValue("@IsAccessoriesCorrect", "Y");
            cmd.SetParameterValue("@IsVirtualPic", productCommonInfo.ProductBasicInfo.IsVirtualPic);
            cmd.SetParameterValue("@IsPictureCorrect", "Y");
            cmd.SetParameterValue("@IsWarrantyCorrect", "Y");
            cmd.SetParameterValue("@IsWarrantyShow", productCommonInfo.ProductWarrantyInfo.WarrantyShow);
            cmd.SetParameterValue("@IsWeightCorrect", "Y");
            cmd.ExecuteNonQuery();
        }
Exemplo n.º 41
0
        private void InsertProductCommonInfo(int productGroupSysNo, ProductInfo productCommonInfo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("InsertProductCommonInfo");

            cmd.SetParameterValue("@CommonSKUNumber", productCommonInfo.ProductBasicInfo.CommonSkuNumber);
            cmd.SetParameterValue("@ProductGroupSysno", productGroupSysNo);
            cmd.SetParameterValue("@UPCCode", productCommonInfo.ProductBasicInfo.UPCCode);
            cmd.SetParameterValue("@BMCode", productCommonInfo.ProductBasicInfo.BMCode);
            cmd.SetParameterValue("@ProductName", productCommonInfo.ProductBasicInfo.ProductTitle.Content);
            cmd.SetParameterValue("@BriefName", productCommonInfo.ProductBasicInfo.ProductBriefName);
            cmd.SetParameterValue("@Keywords", productCommonInfo.ProductBasicInfo.Keywords.Content);
            cmd.SetParameterValue("@PMUserSysNo", productCommonInfo.ProductBasicInfo.ProductManager.SysNo);
            cmd.SetParameterValue("@ProductModel", productCommonInfo.ProductBasicInfo.ProductModel.Content);
            cmd.SetParameterValue("@ProductType", productCommonInfo.ProductBasicInfo.ProductType);
            cmd.SetParameterValue("@IsTakePictures", productCommonInfo.ProductBasicInfo.IsTakePicture);
            cmd.SetParameterValue("@PackageList", productCommonInfo.ProductBasicInfo.PackageList.Content);
            cmd.SetParameterValue("@ProductLink", productCommonInfo.ProductBasicInfo.ProductLink);
            cmd.SetParameterValue("@Attention", productCommonInfo.ProductBasicInfo.Attention.Content);
            cmd.SetParameterValue("@Note", productCommonInfo.ProductBasicInfo.Note);
            cmd.SetParameterValue("@CompanyBelongs", "N");//Newegg产品
            cmd.SetParameterValue("@OnlyForRank", 0);
            cmd.SetParameterValue("@PicNumber", 0);
            cmd.SetParameterValue("@HostWarrantyDay", productCommonInfo.ProductWarrantyInfo.HostWarrantyDay);
            cmd.SetParameterValue("@PartWarrantyDay", productCommonInfo.ProductWarrantyInfo.PartWarrantyDay);
            cmd.SetParameterValue("@Warranty", productCommonInfo.ProductWarrantyInfo.Warranty.Content);
            cmd.SetParameterValue("@ServicePhone", productCommonInfo.ProductWarrantyInfo.ServicePhone);
            cmd.SetParameterValue("@ServiceInfo", productCommonInfo.ProductWarrantyInfo.ServiceInfo);
            cmd.SetParameterValue("@IsOfferInvoice", productCommonInfo.ProductWarrantyInfo.OfferVATInvoice);
            cmd.SetParameterValue("@Weight", productCommonInfo.ProductBasicInfo.ProductDimensionInfo.Weight);
            cmd.SetParameterValue("@IsLarge", productCommonInfo.ProductBasicInfo.ProductDimensionInfo.LargeFlag);
            cmd.SetParameterValue("@Length", productCommonInfo.ProductBasicInfo.ProductDimensionInfo.Length);
            cmd.SetParameterValue("@Width", productCommonInfo.ProductBasicInfo.ProductDimensionInfo.Width);
            cmd.SetParameterValue("@Height", productCommonInfo.ProductBasicInfo.ProductDimensionInfo.Height);
            cmd.SetParameterValue("@MinPackNumber", productCommonInfo.ProductPOInfo.MinPackNumber);
            cmd.SetParameterValue("@InUser", productCommonInfo.OperateUser.UserDisplayName);
            cmd.SetParameterValue("@CompanyCode", productCommonInfo.CompanyCode);
            cmd.SetParameterValue("@StoreCompanyCode", productCommonInfo.CompanyCode);
            cmd.SetParameterValue("@LanguageCode", productCommonInfo.LanguageCode);
            cmd.SetParameterValue("@ProductDesc", productCommonInfo.ProductBasicInfo.ShortDescription.Content);
            cmd.ExecuteNonQuery();
            productCommonInfo.ProductCommonInfoSysNo = (int)cmd.GetParameterValue("@SysNo");
        }
Exemplo n.º 42
0
        /// <summary>
        /// 保存毛利率指标信息
        /// </summary>
        /// <param name="categoryBasicInfo"></param>
        /// <returns></returns>
        public CategoryMinMargin UpdateCategoryMinMargin(CategoryMinMargin categoryBasicInfo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateCategoryMinMargin");

            cmd.SetParameterValue("SysNo", categoryBasicInfo.CategorySysNo);
            cmd.SetParameterValue("@CompanyCode", "8601");
            if (categoryBasicInfo.Margin.ContainsKey(MinMarginDays.Thirty))
            {
                cmd.SetParameterValue("@M1", categoryBasicInfo.Margin[MinMarginDays.Thirty].MinMargin / 100);
                cmd.SetParameterValue("@M1H", categoryBasicInfo.Margin[MinMarginDays.Thirty].MaxMargin / 100);
            }
            else
            {
                cmd.SetParameterValue("@M1", 0);
                cmd.SetParameterValue("@M1H", 0);
            }
            if (categoryBasicInfo.Margin.ContainsKey(MinMarginDays.Sixty))
            {
                cmd.SetParameterValue("@M2", categoryBasicInfo.Margin[MinMarginDays.Sixty].MinMargin / 100);
                cmd.SetParameterValue("@M2H", categoryBasicInfo.Margin[MinMarginDays.Sixty].MaxMargin / 100);
            }
            else
            {
                cmd.SetParameterValue("@M2", 0);
                cmd.SetParameterValue("@M2H", 0);
            }
            if (categoryBasicInfo.Margin.ContainsKey(MinMarginDays.Ninety))
            {
                cmd.SetParameterValue("@M3", categoryBasicInfo.Margin[MinMarginDays.Ninety].MinMargin / 100);
                cmd.SetParameterValue("@M3H", categoryBasicInfo.Margin[MinMarginDays.Ninety].MaxMargin / 100);
            }
            else
            {
                cmd.SetParameterValue("@M3", 0);
                cmd.SetParameterValue("@M3H", 0);
            }
            if (categoryBasicInfo.Margin.ContainsKey(MinMarginDays.OneHundredAndTwenty))
            {
                cmd.SetParameterValue("@M4", categoryBasicInfo.Margin[MinMarginDays.OneHundredAndTwenty].MinMargin / 100);
                cmd.SetParameterValue("@M4H", categoryBasicInfo.Margin[MinMarginDays.OneHundredAndTwenty].MaxMargin / 100);
            }
            else
            {
                cmd.SetParameterValue("@M4", 0);
                cmd.SetParameterValue("@M4H", 0);
            }
            if (categoryBasicInfo.Margin.ContainsKey(MinMarginDays.OneHundredAndEighty))
            {
                cmd.SetParameterValue("@M5", categoryBasicInfo.Margin[MinMarginDays.OneHundredAndEighty].MinMargin / 100);
                cmd.SetParameterValue("@M5H", categoryBasicInfo.Margin[MinMarginDays.OneHundredAndEighty].MaxMargin / 100);
            }
            else
            {
                cmd.SetParameterValue("@M5", 0);
                cmd.SetParameterValue("@M5H", 0);
            }
            if (categoryBasicInfo.Margin.ContainsKey(MinMarginDays.Other))
            {
                cmd.SetParameterValue("@M6", categoryBasicInfo.Margin[MinMarginDays.Other].MinMargin / 100);
                cmd.SetParameterValue("@M6H", categoryBasicInfo.Margin[MinMarginDays.Other].MaxMargin / 100);
            }
            else
            {
                cmd.SetParameterValue("@6", 0);
                cmd.SetParameterValue("@M6H", 0);
            }
            cmd.ExecuteNonQuery();
            return(categoryBasicInfo);
        }
Exemplo n.º 43
0
        /// <summary>
        /// 更新 订单更近日志
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public void UpdateSOInternalMemoInfo(SOInternalMemoInfo info)
        {
            DataCommand command = DataCommandManager.GetDataCommand("UpdateSO_InternalMemo");

            command.SetParameterValue("@SysNo", info.SysNo);
            command.SetParameterValue("@SOSysNo", info.SOSysNo);
            command.SetParameterValue("@Content", info.Content);
            command.SetParameterValue("@UpdateUserSysNo", info.OperatorSysNo);//处理人
            command.SetParameterValue("@Status", info.Status);
            command.SetParameterValue("@UpdateTime", DateTime.Now);
            command.SetParameterValue("@RemindTime", info.RemindTime);
            if (info.Status == SOInternalMemoStatus.Complete)
            {
                command.SetParameterValue("@RemindTime", DBNull.Value);
                command.SetParameterValue("@UpdateTime", DBNull.Value);
            }
            command.SetParameterValue("@Note", info.Note);
            command.SetParameterValue("@CallType", info.CallType);
            command.SetParameterValue("@ResponsibleDepCode", info.DepartmentCode);
            command.SetParameterValue("@Importance", info.Importance);
            command.ExecuteNonQuery();
        }
Exemplo n.º 44
0
        /// <summary>
        /// 更新APInvoice Master信息
        /// </summary>
        /// <param name="entity"></param>
        public virtual void UpdateAPInvoiceMaster(APInvoiceInfo entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("UpdateAPInvoiceMaster");

            command.SetParameterValue("@WareHouseNo", entity.StockSysNo);
            command.SetParameterValue("@VendorSysNo", entity.VendorSysNo);
            command.SetParameterValue("@VendorName", entity.VendorName);
            command.SetParameterValue("@VendorTaxRate", entity.VendorTaxRate);
            command.SetParameterValue("@Memo", entity.Memo);
            if (entity.DiffMemo == null)
            {
                entity.DiffMemo = "";
            }
            command.SetParameterValue("@DiffMemo", entity.DiffMemo);
            command.SetParameterValue("@PoNetAmt", entity.PoNetAmt);
            command.SetParameterValue("@PoNetTaxAmt", entity.PoNetTaxAmt);
            command.SetParameterValue("@InvoiceAmt", entity.InvoiceAmt);
            command.SetParameterValue("@InvoiceTaxAmt", entity.InvoiceTaxAmt);
            command.SetParameterValue("@DiffTaxAmt", entity.DiffTaxAmt);
            command.SetParameterValue("@DiffTaxTreatmentType", entity.DiffTaxTreatmentType);
            command.SetParameterValue("@Status", entity.Status);
            command.SetParameterValue("@EditDate", DateTime.Now);
            command.SetParameterValueAsCurrentUserAcct("@EditUser");
            command.SetParameterValue("@DocNo", entity.SysNo);

            command.ExecuteNonQuery();
        }
Exemplo n.º 45
0
        /// <summary>
        /// 记录日志
        /// </summary>
        /// <param name="log"></param>
        public void WriteLog(BizEntity.ExternalSYS.VendorPortalLog log)
        {
            DataCommand command = DataCommandManager.GetDataCommand("WriteVendorPortalLog");

            command.SetParameterValue("@RegionName", log.RegionName);
            command.SetParameterValue("@CategoryName", log.CategoryName);
            command.SetParameterValue("@CategoryDescription", log.CategoryDescription);
            command.SetParameterValue("@InUser", log.LogUserName);
            command.SetParameterValue("@Content", log.Content);
            command.SetParameterValue("@LogUserName", log.LogUserName);
            command.SetParameterValue("@ServerIP", log.ServerIP);
            command.SetParameterValue("@ServerName", log.ServerName);
            command.SetParameterValue("@ExtendedProperties", log.ExtendedProperties);
            command.SetParameterValue("@ReferenceKey", log.ReferenceKey);
            command.SetParameterValue("@LogType", log.LogType);

            command.ExecuteNonQuery();
        }
Exemplo n.º 46
0
        public static QueryResultList <ArticleData> GetItems(QueryRequest <ArticleQueryData> query)
        {
            var         result = new QueryResultList <ArticleData>();
            DataCommand cmd    = DataCommandManager.GetDataCommand("Article_GetItems");

            cmd.SetParameterValue("@ArtStatus", query.Body.ArtStatus);
            cmd.SetParameterValue("@Publisher", query.Body.Publisher + "%");
            cmd.SetParameterValue("@Publisher", query.Body.EndDate);
            cmd.SetParameterValue("@Title", query.Body.Title + "%");
            cmd.SetParameterValue("@ArtType", query.Body.ArtType);
            cmd.SetParameterValue("@StartDate", query.Body.StartDate);
            cmd.SetParameterValue("@EndDate", query.Body.EndDate);

            cmd.SetParameterValue("@PageCurrent", query.PageInfo.PageIndex);
            cmd.SetParameterValue("@PageSize", query.PageInfo.PageSize);
            cmd.SetParameterValue("@SortType", query.PageInfo.SortType);
            cmd.SetParameterValue("@SortField", query.PageInfo.SortField);
            result.Body       = cmd.ExecuteEntityList <ArticleData>();
            result.TotalCount = (int)cmd.GetParameterValue("@TotalCount");
            return(result);
        }
Exemplo n.º 47
0
        /// <summary>
        /// 添加订单跟进日志
        /// </summary>
        /// <param name="info"></param>
        /// <param name="companyCode"></param>
        public void AddSOInternalMemoInfo(SOInternalMemoInfo info, string companyCode)
        {
            DataCommand command = DataCommandManager.GetDataCommand("CreateSO_InternalMemo");

            command.SetParameterValue("@SOSysNo", info.SOSysNo);
            command.SetParameterValue("@CreateUserSysNo", ServiceContext.Current.UserSysNo);
            command.SetParameterValue("@CreateTime", DateTime.Now);
            command.SetParameterValue("@SourceSysNo", info.SourceSysNo);
            command.SetParameterValue("@ReasonCodeSysNo", info.ReasonCodeSysNo);
            command.SetParameterValue("@Content", info.Content);
            command.SetParameterValue("@UpdateUserSysNo", DBNull.Value);
            command.SetParameterValue("@UpdateTime", DBNull.Value);
            command.SetParameterValue("@Status", info.Status);
            command.SetParameterValue("@RemindTime", info.RemindTime);
            command.SetParameterValue("@Note", info.Note);
            command.SetParameterValue("@CallType", DBNull.Value);
            command.SetParameterValue("@ResponsibleDepCode", DBNull.Value);
            command.SetParameterValue("@Importance", info.Importance);
            command.SetParameterValue("@CompanyCode", companyCode);
            command.ExecuteNonQuery();
        }
Exemplo n.º 48
0
        /// <summary>
        /// 修改三级延保信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public CategoryExtendWarranty UpdateCategoryExtendWarranty(CategoryExtendWarranty entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateCategoryExtendWarranty");

            cmd.SetParameterValue("@BrandSysNo", entity.Brand.SysNo ?? -1);
            cmd.SetParameterValue("@C3SysNo", entity.CategoryInfo.SysNo);
            cmd.SetParameterValue("@EditUser", entity.EditUser.UserDisplayName);
            cmd.SetParameterValue("@ProductCode", entity.ProductCode);
            cmd.SetParameterValue("@Status", entity.Status);
            cmd.SetParameterValue("@Years", entity.Years);
            cmd.SetParameterValue("@MinUnitPrice", entity.MinUnitPrice);
            cmd.SetParameterValue("@MaxUnitPrice", entity.MaxUnitPrice);
            cmd.SetParameterValue("@UnitPrice", entity.UnitPrice);
            cmd.SetParameterValue("@Cost", entity.Cost);
            cmd.SetParameterValue("@SysNo", entity.SysNo);
            cmd.SetParameterValue("@CompanyCode", entity.CompanyCode);
            cmd.SetParameterValue("@IsECSelected", entity.IsECSelected);

            cmd.ExecuteNonQuery();
            return(entity);
        }
Exemplo n.º 49
0
        public static DataSet GetJobProductRequest(JobProductRequestEntity entity)
        {
            DataSet     dsResult = null;
            DataCommand cmd      = DataCommandManager.GetDataCommand("GetJobProductRequest");

            cmd.SetParameterValue("@SysNo", entity.SysNo);
            cmd.SetParameterValue("@ProductName", entity.ProductName);
            cmd.SetParameterValue("@ProductID", entity.ProductID);
            cmd.SetParameterValue("@ProductLink", entity.ProductLink);
            cmd.SetParameterValue("@HostWarrantyDay", entity.HostWarrantyDay);
            cmd.SetParameterValue("@PartWarrantyDay", entity.PartWarrantyDay);
            cmd.SetParameterValue("@Warranty", entity.Warranty);
            cmd.SetParameterValue("@ServicePhone", entity.ServicePhone);
            cmd.SetParameterValue("@ServiceInfo", entity.ServiceInfo);
            cmd.SetParameterValue("@Note", entity.Note);
            cmd.SetParameterValue("@Weight", entity.Weight);
            cmd.SetParameterValue("@IsLarge", entity.IsLarge);
            cmd.SetParameterValue("@Length", entity.Length);
            cmd.SetParameterValue("@Width", entity.Width);
            cmd.SetParameterValue("@Height", entity.Height);
            cmd.SetParameterValue("@MinPackNumber", entity.MinPackNumber);
            cmd.SetParameterValue("@Status", entity.Status);
            cmd.SetParameterValue("@Type", entity.Type);
            cmd.SetParameterValue("@PromotionTitle", entity.PromotionTitle);
            cmd.SetParameterValue("@Auditor", entity.Auditor);
            cmd.SetParameterValue("@AuditDate", entity.AuditDate);
            cmd.SetParameterValue("@CompanyCode", entity.CompanyCode);
            cmd.SetParameterValue("@StoreCompanyCode", entity.StoreCompanyCode);
            cmd.SetParameterValue("@LanguageCode", entity.LanguageCode);
            cmd.SetParameterValue("@InDate", entity.InDate);
            cmd.SetParameterValue("@InUser", entity.InUser);
            cmd.SetParameterValue("@EditDate", entity.EditDate);
            cmd.SetParameterValue("@EditUser", entity.EditUser);

            dsResult = cmd.ExecuteDataSet();
            return(dsResult);
        }
Exemplo n.º 50
0
        /// <summary>
        /// 得到商品和条件选项值bing的信息
        /// </summary>
        /// <param name="query"></param>
        /// <param name="totalCoutn"></param>
        /// <returns></returns>
        public DataTable QueryAccessoriesQueryConditionBind(ProductAccessoriesQueryConditionPreViewQueryFilter query, out int totalCount)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("QueryAccessoriesQueryConditionBind");

            cmd.SetParameterValue("@MasterSysNo", query.MasterSysNo);
            cmd.SetParameterValue("@ProductID", query.ProductID);
            cmd.SetParameterValue("@ConditionValueSysNo1", query.ConditionValueSysNo1);
            cmd.SetParameterValue("@ConditionValueSysNo2", query.ConditionValueSysNo2);
            cmd.SetParameterValue("@ConditionValueSysNo3", query.ConditionValueSysNo3);
            cmd.SetParameterValue("@ConditionValueSysNo4", query.ConditionValueSysNo4);
            cmd.SetParameterValue("@Category1SysNo", query.Category1SysNo);
            cmd.SetParameterValue("@Category2SysNo", query.Category2SysNo);
            cmd.SetParameterValue("@Category3SysNo", query.Category3SysNo);
            cmd.SetParameterValue("@SortField", query.PagingInfo.SortBy);
            cmd.SetParameterValue("@PageSize", query.PagingInfo.PageSize);
            cmd.SetParameterValue("@PageCurrent", query.PagingInfo.PageIndex);
            DataTable dt = new DataTable();

            dt         = cmd.ExecuteDataTable();
            totalCount = (int)cmd.GetParameterValue("@TotalCount");

            return(dt);
        }
Exemplo n.º 51
0
        public int CreateConsignSettlementRule(ConsignSettlementRulesInfo entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("InsertConsignSettleRule");

            command.SetParameterValue("@ApprovedDate", DBNull.Value);
            command.SetParameterValue("@ApprovedUser", DBNull.Value);
            command.SetParameterValue("@BeginDate", entity.BeginDate);
            command.SetParameterValue("@CompanyCode", entity.CompanyCode);
            command.SetParameterValue("@CreateDate", DateTime.Now);
            command.SetParameterValue("@CreateUser", entity.CreateUser);
            command.SetParameterValue("@CurrencyCode", entity.CurrencyCode);
            command.SetParameterValue("@EditDate", DateTime.Now);
            command.SetParameterValue("@EditUser", entity.CreateUser);
            command.SetParameterValue("@EndDate", entity.EndDate);
            command.SetParameterValue("@LanguageCode", "zh-CN");
            command.SetParameterValue("@NewSettlePrice", entity.NewSettlePrice);
            command.SetParameterValue("@OldSetttlePrice", entity.OldSettlePrice);
            command.SetParameterValue("@ProductSysNo", entity.ProductSysNo);
            command.SetParameterValue("@SettleedQuantity", DBNull.Value);
            command.SetParameterValue("@SettleRuleName", entity.SettleRulesName);
            command.SetParameterValue("@SettleRuleQuantity", entity.SettleRulesQuantity);
            command.SetParameterValue("@SettleRulesCode", entity.SettleRulesCode);
            command.SetParameterValue("@Status", (char)entity.Status);
            command.SetParameterValue("@StopDate", DBNull.Value);
            command.SetParameterValue("@StopUser", DBNull.Value);
            command.SetParameterValue("@StoreCompanyCode", entity.CompanyCode);
            command.SetParameterValue("@VendorSysNo", entity.VendorSysNo);

            int sysNo = Convert.ToInt32(command.ExecuteScalar());

            return(sysNo);
        }
Exemplo n.º 52
0
        /// <summary>
        ///根据CategoryType 添加CeateCategory
        /// </summary>
        /// <param name="type"></param>
        /// <param name="entity"></param>
        public void CeateCategoryByType(CategoryType type, CategoryInfo entity)
        {
            DataCommand cmd = null;

            switch (type)
            {
            case CategoryType.CategoryType1:
                cmd = DataCommandManager.GetDataCommand("CreateCategory1");
                cmd.SetParameterValue("@SysNo", entity.SysNo);
                cmd.SetParameterValue("@C1ID", entity.CategoryID);
                cmd.SetParameterValue("@C1Name", entity.CategoryName.Content);
                cmd.SetParameterValue("@Status", entity.Status);
                cmd.SetParameterValue("@CompanyCode", entity.CompanyCode);
                cmd.SetParameterValue("@LanguageCode", entity.LanguageCode);
                break;

            case CategoryType.CategoryType2:
                cmd = DataCommandManager.GetDataCommand("CreateCategory2");
                cmd.SetParameterValue("@SysNo", entity.SysNo);
                cmd.SetParameterValue("@C2ID", entity.CategoryID);
                cmd.SetParameterValue("@C2Name", entity.CategoryName.Content);
                cmd.SetParameterValue("@C1SysNo", entity.ParentSysNumber);
                cmd.SetParameterValue("@Status", entity.Status);
                cmd.SetParameterValue("@CompanyCode", entity.CompanyCode);
                cmd.SetParameterValue("@LanguageCode", entity.LanguageCode);
                break;

            case CategoryType.CategoryType3:
                cmd = DataCommandManager.GetDataCommand("CreateCategory3");
                cmd.SetParameterValue("@SysNo", entity.SysNo);
                cmd.SetParameterValue("@C3ID", entity.CategoryID);
                cmd.SetParameterValue("@C3Name", entity.CategoryName.Content);
                cmd.SetParameterValue("@C2SysNo", entity.ParentSysNumber);
                cmd.SetParameterValue("@Status", entity.Status);
                cmd.SetParameterValue("@MinMargin", 0);
                cmd.SetParameterValue("@MinMarginPMD", 0);
                cmd.SetParameterValue("@CompanyCode", entity.CompanyCode);
                cmd.SetParameterValue("@LanguageCode", entity.LanguageCode);
                cmd.SetParameterValue("@C3Code", entity.C3Code);
                break;

            default:
                cmd = DataCommandManager.GetDataCommand("CreateCategory1");
                cmd.SetParameterValue("@SysNo", entity.SysNo);
                cmd.SetParameterValue("@C1ID", entity.CategoryID);
                cmd.SetParameterValue("@C1Name", entity.CategoryName.Content);
                cmd.SetParameterValue("@Status", entity.Status);
                cmd.SetParameterValue("@CompanyCode", entity.CompanyCode);
                cmd.SetParameterValue("@LanguageCode", entity.LanguageCode);
                break;
            }
            cmd.ExecuteNonQuery();
        }
Exemplo n.º 53
0
        /// <summary>
        /// 添加配送方式-产品
        /// </summary>
        /// <param name="ShipTypeProductInfo"></param>
        /// <returns></returns>
        public void CreateShipTypeProduct(ShipTypeProductInfo ShipTypeProductInfo)
        {
            object      obj = null;
            DataCommand cmd = DataCommandManager.GetDataCommand("ShipTypeProduct_Master_Create");

            cmd.SetParameterValue("@StockSysNo", ShipTypeProductInfo.WareHouse);
            cmd.SetParameterValue("@ShipTypeSysNo", ShipTypeProductInfo.ShippingType);
            if (!ShipTypeProductInfo.CitySysNo.HasValue && !ShipTypeProductInfo.ProvinceSysNo.HasValue)
            {
                cmd.SetParameterValue("@AreaSysNo", null);
            }
            if (!ShipTypeProductInfo.CitySysNo.HasValue && ShipTypeProductInfo.ProvinceSysNo.HasValue)
            {
                cmd.SetParameterValue("@AreaSysNo", ShipTypeProductInfo.ProvinceSysNo);
            }
            if (ShipTypeProductInfo.CitySysNo.HasValue && !ShipTypeProductInfo.DistrictSysNo.HasValue)
            {
                cmd.SetParameterValue("@AreaSysNo", ShipTypeProductInfo.CitySysNo);
            }
            if (ShipTypeProductInfo.DistrictSysNo.HasValue)
            {
                cmd.SetParameterValue("@AreaSysNo", ShipTypeProductInfo.AreaSysNo);
            }
            cmd.SetParameterValue("@InUser", ServiceContext.Current.UserSysNo);
            cmd.SetParameterValue("@EditUser", ServiceContext.Current.UserSysNo);
            cmd.SetParameterValue("@Status", "A");
            cmd.SetParameterValue("@CompanyCode", ShipTypeProductInfo.CompanyCode);
            cmd.SetParameterValue("@StoreCompanyCode", ShipTypeProductInfo.CompanyCode);
            cmd.SetParameterValue("@LanguageCode", "zh-CN");
            cmd.ExecuteNonQuery();
            ShipTypeProductInfo.SysNo = (int)cmd.GetParameterValue("@SysNo");
            CustomDataCommand cmd_item  = DataCommandManager.CreateCustomDataCommandFromConfig("ShipTypeProduct_Item_Create");
            StringBuilder     builersql = new StringBuilder();;

            if (ShipTypeProductInfo.ListProductInfo == null && ShipTypeProductInfo.ListCategoryInfo == null)
            {
                return;
            }
            if (ShipTypeProductInfo.ListProductInfo != null && ShipTypeProductInfo.ListCategoryInfo == null)
            {
                for (int i = 0; i < ShipTypeProductInfo.ListProductInfo.Count; i++)
                {
                    cmd_item.SetParameterValue("@MasterSysNo", ShipTypeProductInfo.SysNo);

                    cmd_item.SetParameterValue("@CompanyCode", ShipTypeProductInfo.CompanyCode);
                    cmd_item.SetParameterValue("@Status", "A");
                    cmd_item.SetParameterValue("@Description", ShipTypeProductInfo.Description);
                    if (EnumCodeMapper.TryGetCode(ShipTypeProductInfo.ShipTypeProductType, out obj))
                    {
                        cmd_item.SetParameterValue("@Type", obj);
                    }
                    if (EnumCodeMapper.TryGetCode(ShipTypeProductInfo.ProductRange, out obj))
                    {
                        cmd_item.SetParameterValue("@ItemRange", obj);
                    }
                    cmd_item.SetParameterValue("@InUser", ServiceContext.Current.UserSysNo);
                    cmd_item.SetParameterValue("@EditUser", ServiceContext.Current.UserSysNo);
                    cmd_item.SetParameterValue("@StoreCompanyCode", ShipTypeProductInfo.CompanyCode);
                    cmd_item.SetParameterValue("@LanguageCode", "zh-CN");
                    cmd_item.SetParameterValue("@CompanyCustomer", 0);
                    builersql.Append(cmd_item.CommandText.Replace("#DynamicData#", ShipTypeProductInfo.ListProductInfo[i].SysNo.ToString() + ",'" + ShipTypeProductInfo.ListProductInfo[i].ProductID.ToString() + "'"));
                }
                cmd_item.CommandText = builersql.ToString();
                cmd_item.ExecuteNonQuery();
            }
            if (ShipTypeProductInfo.ListProductInfo == null && ShipTypeProductInfo.ListCategoryInfo != null)
            {
                for (int i = 0; i < ShipTypeProductInfo.ListCategoryInfo.Count; i++)
                {
                    cmd_item.SetParameterValue("@MasterSysNo", ShipTypeProductInfo.SysNo);

                    cmd_item.SetParameterValue("@CompanyCode", ShipTypeProductInfo.CompanyCode);
                    cmd_item.SetParameterValue("@Status", "A");
                    cmd_item.SetParameterValue("@Description", ShipTypeProductInfo.Description);
                    if (EnumCodeMapper.TryGetCode(ShipTypeProductInfo.ShipTypeProductType, out obj))
                    {
                        cmd_item.SetParameterValue("@Type", obj);
                    }
                    if (EnumCodeMapper.TryGetCode(ShipTypeProductInfo.ProductRange, out obj))
                    {
                        cmd_item.SetParameterValue("@ItemRange", obj);
                    }
                    cmd_item.SetParameterValue("@InUser", ServiceContext.Current.UserSysNo);
                    cmd_item.SetParameterValue("@EditUser", ServiceContext.Current.UserSysNo);
                    cmd_item.SetParameterValue("@StoreCompanyCode", ShipTypeProductInfo.CompanyCode);
                    cmd_item.SetParameterValue("@LanguageCode", "zh-CN");
                    cmd_item.SetParameterValue("@CompanyCustomer", 0);
                    builersql.Append(cmd_item.CommandText.Replace("#DynamicData#", ShipTypeProductInfo.ListCategoryInfo[i].SysNo + ",null"));
                }
                cmd_item.CommandText = builersql.ToString();
                cmd_item.ExecuteNonQuery();
            }
        }
Exemplo n.º 54
0
        /// <summary>
        /// 新建APInvoice Master信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual int InsertAPInvoiceMaster(APInvoiceInfo entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("InsertMaster");

            //command.SetParameterValue("@DocDate", entity.DocDate);
            command.SetParameterValue("@WareHouseNo", entity.StockSysNo);
            command.SetParameterValue("@VendorSysNo", entity.VendorSysNo);
            command.SetParameterValue("@VendorName", entity.VendorName);
            command.SetParameterValue("@VendorTaxRate", entity.VendorTaxRate);
            command.SetParameterValue("@Memo", entity.Memo);
            command.SetParameterValue("@DiffMemo", entity.DiffMemo);
            command.SetParameterValue("@PoNetAmt", entity.PoNetAmt);
            command.SetParameterValue("@PoNetTaxAmt", entity.PoNetTaxAmt);
            command.SetParameterValue("@InvoiceAmt", entity.InvoiceAmt ?? 0);
            command.SetParameterValue("@InvoiceTaxAmt", entity.InvoiceTaxAmt ?? 0);
            command.SetParameterValue("@DiffTaxAmt", entity.DiffTaxAmt);
            command.SetParameterValue("@DiffTaxTreatmentType", entity.DiffTaxTreatmentType);
            command.SetParameterValueAsCurrentUserAcct("@InUser");
            //command.SetParameterValue("@InDate", entity.InDate);
            command.SetParameterValue("@ConfirmUser", entity.ConfirmUser);
            command.SetParameterValue("@ConfirmDate", entity.ConfirmDate);
            command.SetParameterValue("@Status", entity.Status);
            //command.SetParameterValue("LanguageCode", entity.LanguageCode);
            //command.SetParameterValue("CurrencyCode", entity.CurrencyCode);
            command.SetParameterValue("CompanyCode", entity.CompanyCode);
            //command.SetParameterValue("StoreCompanyCode", entity.StoreCompanyCode);

            return(Convert.ToInt32(command.ExecuteScalar()));
        }
Exemplo n.º 55
0
        public static int GetLocationSysno(int pagetype, int positionID, int pageID)
        {
            int         locationsysno = 0;
            DataCommand command       = DataCommandManager.GetDataCommand("CheckOnlineListLocation");

            command.SetParameterValue("@PageType", pagetype);
            command.SetParameterValue("@PositionID", positionID);
            command.SetParameterValue("@PageID", pageID);
            command.SetParameterValue("@CompanyCode", ConfigurationManager.AppSettings["CompanyCode"]);
            try
            {
                locationsysno = command.ExecuteScalar <int>();
            }
            catch
            {
                locationsysno = 0;
            }
            if (locationsysno == 0)
            {
                DataCommand dc = DataCommandManager.GetDataCommand("InsertOnlineListlocation");

                dc.SetParameterValue("@PageType", pagetype);
                dc.SetParameterValue("@PositionID", positionID);
                dc.SetParameterValue("@Priority", 0);
                dc.SetParameterValue("@PageID", pageID);
                dc.SetParameterValue("@Description", "系统添加位置");
                dc.SetParameterValue("@InDate", DateTime.Now);
                dc.SetParameterValue("@InUser", "System");
                dc.SetParameterValue("@EditDate", DateTime.Now);
                dc.SetParameterValue("@EditUser", "System");
                dc.SetParameterValue("@Status", "A");
                dc.SetParameterValue("@CompanyCode", ConfigurationManager.AppSettings["CompanyCode"]);
                dc.SetParameterValue("@LanguageCode", ConfigurationManager.AppSettings["LanguageCode"]);
                dc.SetParameterValue("@StoreCompanyCode", ConfigurationManager.AppSettings["CompanyCode"]);

                dc.ExecuteNonQuery();
                locationsysno = (int)dc.GetParameterValue("@OnlineListlocationSysNo");
            }
            return(locationsysno);
        }
Exemplo n.º 56
0
        public static OnlineList Insert(OnlineList entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("InsertOnlineList");

            command.SetParameterValue("@OnlineListlocationSysNo", entity.OnlineLocationSysNo);
            command.SetParameterValue("@ProductID", entity.ProductID);
            command.SetParameterValue("@Priority", entity.Priority);
            command.SetParameterValue("@BeginDate", DateTime.Now);
            command.SetParameterValue("@EndDate", DateTime.Now.AddDays(1));
            command.SetParameterValue("@InDate", DateTime.Now);
            command.SetParameterValue("@InUser", "System");
            command.SetParameterValue("@EditDate", DateTime.Now);
            command.SetParameterValue("@EditUser", "System");
            command.SetParameterValue("@Status", "A");
            command.SetParameterValue("@CompanyCode", ConfigurationManager.AppSettings["CompanyCode"]);
            command.SetParameterValue("@LanguageCode", ConfigurationManager.AppSettings["LanguageCode"]);
            command.SetParameterValue("@StoreCompanyCode", ConfigurationManager.AppSettings["CompanyCode"]);

            command.ExecuteNonQuery();
            entity.SysNo = (int)command.GetParameterValue("@SysNo");
            return(entity);
        }
Exemplo n.º 57
0
        public DataTable GetProductNotifyByQuery(ProductNotifyQueryFilter query, out int totalCount)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("GetProductNotifyList");

            dc.SetParameterValue("@C1SysNo1", query.Category1SysNo);
            dc.SetParameterValue("@C2SysNo1", query.Category2SysNo);
            dc.SetParameterValue("@C3SysNo1", query.Category3SysNo);
            dc.SetParameterValue("@Status", query.Status);
            dc.SetParameterValue("@ProductSysNo", query.ProductSysNo);
            dc.SetParameterValue("@StartTime", query.StartTime);
            dc.SetParameterValue("@EndTime", query.EndTime);
            dc.SetParameterValue("@Email", query.Email);
            dc.SetParameterValue("@CustomerID", query.CustomserID);
            dc.SetParameterValue("@PMSysNo", query.PMSysNo);
            dc.SetParameterValue("@PageSize", query.PageInfo.PageSize);
            dc.SetParameterValue("@PageCurrent", query.PageInfo.PageIndex);

            dc.SetParameterValue("@SortField", query.PageInfo.SortBy);
            DataTable dt = new DataTable();

            dt         = dc.ExecuteDataTable(3, typeof(NotifyStatus));
            totalCount = (int)dc.GetParameterValue("@TotalCount");
            return(dt);
        }
Exemplo n.º 58
0
        /// <summary>
        /// 更新POItems
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="docNo"></param>
        public virtual void UpdatePOItem(APInvoicePOItemInfo entity, int docNo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("UpdateAPInvoicePOItem");

            command.SetParameterValue("@DocNo", docNo);
            command.SetParameterValue("@PoNo", entity.PoNo);
            command.SetParameterValue("@PoWarehouseNo", entity.PoStockSysNo ?? 0);
            command.SetParameterValue("@PoCurrency", 1);
            command.SetParameterValue("@PoAmt", entity.PoAmt ?? 0);
            command.SetParameterValue("@EIMSNo", entity.EIMSNo);
            if (entity.EIMSAmt == null)
            {
                entity.EIMSAmt = 0;
            }
            command.SetParameterValue("@EIMSAmt", entity.EIMSAmt);
            if (entity.EIMSNetAmt == null)
            {
                entity.EIMSNetAmt = 0;
            }
            command.SetParameterValue("@EIMSNetAmt", entity.EIMSNetAmt);
            command.SetParameterValue("@EIMSNetTaxAmt", entity.EIMSNetTaxAmt);
            command.SetParameterValue("@PoNetAmt", entity.PoNetAmt);
            command.SetParameterValue("@PaymentAmt", entity.PaymentAmt ?? 0);
            command.SetParameterValue("@PoBaselineDate", entity.PoBaselineDate);
            command.SetParameterValue("@PoPaymentTerm", entity.PoPaymentTerm);
            command.SetParameterValue("@Status", entity.Status);
            command.SetParameterValue("@EditDate", DateTime.Now);
            command.SetParameterValueAsCurrentUserAcct("@EditUser");
            command.SetParameterValue("@OrderType", (int)entity.OrderType);
            command.SetParameterValue("@BatchNumber", entity.BatchNumber);
            command.SetParameterValue("@PayableTaxAmt", entity.PayableTaxAmt);

            command.ExecuteNonQuery();
        }
Exemplo n.º 59
0
 public List<Model.TB_MULTI_STEP> GetMultiStepListByTypeID(string typeId)
 {
     var cmd = new DataCommand("getMultiStepListByTypeID", new SqlCustomDbCommand());
     cmd.SetParameterValue("@TYPEID", typeId);
     return cmd.ExecuteEntityList<Model.TB_MULTI_STEP>();
 }
Exemplo n.º 60
0
        public void UpdateProductCommonInfoBasicInfo(ProductCommonInfo productCommonInfo, UserInfo operationUser)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("UpdateProductCommonInfoBasicInfo");

            dc.SetParameterValue("@ProductCommonInfoSysNo", productCommonInfo.ProductCommonInfoSysNo);
            dc.SetParameterValue("@ProductTitle", productCommonInfo.ProductBasicInfo.ProductTitle.Content);
            dc.SetParameterValue("@ProductBriefName", productCommonInfo.ProductBasicInfo.ProductBriefName);
            dc.SetParameterValue("@Keywords", productCommonInfo.ProductBasicInfo.Keywords.Content);
            dc.SetParameterValue("@ProductModel", productCommonInfo.ProductBasicInfo.ProductModel.Content);
            dc.SetParameterValue("@ProductType", productCommonInfo.ProductBasicInfo.ProductType);
            dc.SetParameterValue("@PMUserSysNo", productCommonInfo.ProductBasicInfo.ProductManager.SysNo);
            dc.SetParameterValue("@ProductDescription", productCommonInfo.ProductBasicInfo.ShortDescription.Content);
            dc.SetParameterValue("@PackageList", productCommonInfo.ProductBasicInfo.PackageList.Content);
            dc.SetParameterValue("@ProductLink", productCommonInfo.ProductBasicInfo.ProductLink);
            dc.SetParameterValue("@Attention", productCommonInfo.ProductBasicInfo.Attention.Content);
            dc.SetParameterValue("@IsTakePicture", productCommonInfo.ProductBasicInfo.IsTakePicture);
            dc.SetParameterValue("@UPCCode", productCommonInfo.ProductBasicInfo.UPCCode);
            dc.SetParameterValue("@BMCode", productCommonInfo.ProductBasicInfo.BMCode);
            dc.SetParameterValue("@EditUser", operationUser.UserDisplayName);
            dc.SetParameterValue("@EditUserSysNo", operationUser.SysNo);
            dc.ExecuteNonQuery();
        }