/// <summary>
        /// 复制优惠方案
        /// </summary>
        /// <param name="promID">方案id</param>
        /// <param name="operateID">操作人id</param>
        /// <returns>1成功</returns>
        public int CopypPromotionProject(int promID, int operateID)
        {
            int resFlag = 0;

            //获取方案主表信息
            DataTable dtHead = NewObject <IOPPromotionProject>().GetPromotionProject(promID);
            ME_PromotionProjectHead headEntity = new ME_PromotionProjectHead();

            headEntity = ConvertExtend.ToObject <ME_PromotionProjectHead>(dtHead, 0);
            Random rd = new Random();

            headEntity.PromName    = headEntity.PromName + "-复制" + rd.Next(1, 999);
            headEntity.UseFlag     = 0;
            headEntity.PromID      = 0;
            headEntity.OperateDate = DateTime.Now;
            headEntity.OperateID   = operateID;
            this.BindDb(headEntity);
            resFlag = headEntity.save();     //保存主表,获取ID
            //获取明细表信息
            DataTable dtDetail = NewObject <IOPPromotionProject>().GetPromotionProjectDetail(promID);

            for (int i = 0; i < dtDetail.Rows.Count; i++)
            {
                ME_PromotionProjectDetail detailEntity = new ME_PromotionProjectDetail();
                detailEntity             = ConvertExtend.ToObject <ME_PromotionProjectDetail>(dtDetail, i);
                detailEntity.PromSunID   = 0;
                detailEntity.PromID      = headEntity.PromID;
                detailEntity.OperateDate = DateTime.Now;
                detailEntity.OperateID   = operateID;
                this.BindDb(detailEntity);
                resFlag = detailEntity.save();
            }

            return(resFlag);
        }
Beispiel #2
0
        public ServiceResponseData SaveHeadInfo()
        {
            ME_PromotionProjectHead headEntity = requestData.GetData <ME_PromotionProjectHead>(0);
            int res = NewObject <PromotionProjectManagement>().SaveHeadInfo(headEntity);

            responseData.AddData <int>(res);
            return(responseData);
        }
        public int SaveHeadInfo(int promID, string headName, string stDate, string endDate)
        {
            ME_PromotionProjectHead headEntity = new ME_PromotionProjectHead();

            headEntity.PromID    = promID;
            headEntity.PromName  = headName;
            headEntity.StartDate = Convert.ToDateTime(stDate);
            headEntity.EndDate   = Convert.ToDateTime(endDate);
            if (promID == 0)
            {
                headEntity.UseFlag = 0;
            }

            headEntity.OperateDate = DateTime.Now;
            headEntity.OperateID   = LoginUserInfo.UserId;
            Action <ClientRequestData> requestAction = ((ClientRequestData request) =>
            {
                request.AddData(headEntity);
            });

            ServiceResponseData retdata = InvokeWcfService("OPProject.Service", "PromotionProjectController", "SaveHeadInfo", requestAction);

            return(retdata.GetData <int>(0));
        }
 /// <summary>
 /// 保存头表信息
 /// </summary>
 /// <param name="headEntity">头信息</param>
 /// <returns>1成功</returns>
 public int SaveHeadInfo(ME_PromotionProjectHead headEntity)
 {
     this.BindDb(headEntity);
     return(headEntity.save());
 }