public ActionResult BulkUpdate([Bind(Include = "Id,ConcurrencyKey,T_Name,T_Description,T_AssociatedScheduleTypeID,T_StartDateTime,T_AssociatedRecurringScheduleDetailsTypeID,T_RecurringRepeatFrequencyID,T_RepeatByID,T_RecurringTaskEndTypeID,T_EndDate,T_OccurrenceLimitCount,T_Summary,SelectedT_RecurrenceDays_T_RepeatOn,T_StartTime,T_EndTime,T_EntityName")] T_Schedule t_schedule, FormCollection collection, string UrlReferrer) { var bulkIds = collection["BulkUpdate"].Split(',').ToList(); var chkUpdate = collection["chkUpdate"]; if (!string.IsNullOrEmpty(chkUpdate)) { foreach (var id in bulkIds.Where(p => p != string.Empty)) { long objId = long.Parse(id); T_Schedule target = db.T_Schedules.Find(objId); EntityCopy.CopyValuesForSameObjectType(t_schedule, target, chkUpdate); db.Entry(target).State = EntityState.Modified; try { db.SaveChanges(); } catch { } } } if (!string.IsNullOrEmpty(UrlReferrer)) { return(Redirect(UrlReferrer)); } else { return(RedirectToAction("Index")); } }
public ActionResult BulkUpdate([Bind(Include = "Id,ConcurrencyKey,T_Name,T_Description")] T_MonthlyRepeatType t_monthlyrepeattype, FormCollection collection, string UrlReferrer) { var bulkIds = collection["BulkUpdate"].Split(',').ToList(); var chkUpdate = collection["chkUpdate"]; if (!string.IsNullOrEmpty(chkUpdate)) { foreach (var id in bulkIds.Where(p => p != string.Empty)) { long objId = long.Parse(id); T_MonthlyRepeatType target = db.T_MonthlyRepeatTypes.Find(objId); EntityCopy.CopyValuesForSameObjectType(t_monthlyrepeattype, target, chkUpdate); db.Entry(target).State = EntityState.Modified; try { db.SaveChanges(); } catch { } } } if (!string.IsNullOrEmpty(UrlReferrer)) { return(Redirect(UrlReferrer)); } else { return(RedirectToAction("Index")); } }
public ActionResult BulkUpdate([Bind(Include = "Id,ConcurrencyKey,EntityName,DataSource,SourceType,MethodType,Action,flag,other")] EntityDataSource entitydatasource, FormCollection collection, string UrlReferrer) { var bulkIds = collection["BulkUpdate"].Split(',').ToList(); var chkUpdate = collection["chkUpdate"]; if (!string.IsNullOrEmpty(chkUpdate)) { foreach (var id in bulkIds.Where(p => p != string.Empty)) { long objId = long.Parse(id); EntityDataSource target = db.EntityDataSources.Find(objId); EntityCopy.CopyValuesForSameObjectType(entitydatasource, target, chkUpdate); db.Entry(target).State = EntityState.Modified; try { db.SaveChanges(); } catch { } } } if (!string.IsNullOrEmpty(UrlReferrer)) { return(Redirect(UrlReferrer)); } else { return(RedirectToAction("Index")); } }
public ActionResult BulkUpdate([Bind(Include = "Id,ConcurrencyKey,T_EmployeePayDetailsID,T_PayDetailsJobAssignmentID,T_OtherPayDetailsTypeID,T_Amount,T_StartDate,T_EndDate,T_Notes")] T_PayDetails t_paydetails, FormCollection collection, string UrlReferrer) { var bulkIds = collection["BulkUpdate"].Split(',').ToList(); var chkUpdate = collection["chkUpdate"]; if (!string.IsNullOrEmpty(chkUpdate)) { bool customsave_hasissues = false; foreach (var id in bulkIds.Where(p => p != string.Empty)) { long objId = long.Parse(id); T_PayDetails target = db.T_PayDetailss.Find(objId); target.setDateTimeToClientTime(); EntityCopy.CopyValuesForSameObjectType(t_paydetails, target, chkUpdate); customsave_hasissues = false; CheckBeforeSave(target, "BulkUpdate"); if (ValidateModel(target) && !CustomSaveOnEdit(target, out customsave_hasissues, "BulkUpdate")) { db.Entry(target).State = EntityState.Modified; try { if (target.t_employeepaydetails != null) { db.Entry(target.t_employeepaydetails).State = EntityState.Unchanged; } if (target.t_paydetailsjobassignment != null) { db.Entry(target.t_paydetailsjobassignment).State = EntityState.Unchanged; } if (target.t_otherpaydetailstype != null) { db.Entry(target.t_otherpaydetailstype).State = EntityState.Unchanged; } db.SaveChanges(); } catch { } } } } RedirectToRouteResult customRedirectAction = CustomRedirectUrl(t_paydetails, "BulkUpdate", ""); if (customRedirectAction != null) { return(customRedirectAction); } if (!string.IsNullOrEmpty(UrlReferrer)) { return(Redirect(UrlReferrer)); } else { return(RedirectToAction("Index")); } }
public ActionResult BulkUpdate([Bind(Include = "Id,ConcurrencyKey,T_AddressLine1,T_AddressLine2,T_ZipCode,T_AddressCountryID,T_AddressStateID,T_AddressCityID")] T_Address t_address, FormCollection collection, string UrlReferrer) { var bulkIds = collection["BulkUpdate"].Split(',').ToList(); var chkUpdate = collection["chkUpdate"]; if (!string.IsNullOrEmpty(chkUpdate)) { bool customsave_hasissues = false; foreach (var id in bulkIds.Where(p => p != string.Empty)) { long objId = long.Parse(id); T_Address target = db.T_Addresss.Find(objId); target.setDateTimeToClientTime(); EntityCopy.CopyValuesForSameObjectType(t_address, target, chkUpdate); customsave_hasissues = false; CheckBeforeSave(target, "BulkUpdate"); if (ValidateModel(target) && !CustomSaveOnEdit(target, out customsave_hasissues, "BulkUpdate")) { db.Entry(target).State = EntityState.Modified; try { if (target.t_addresscountry != null) { db.Entry(target.t_addresscountry).State = EntityState.Unchanged; } if (target.t_addressstate != null) { db.Entry(target.t_addressstate).State = EntityState.Unchanged; } if (target.t_addresscity != null) { db.Entry(target.t_addresscity).State = EntityState.Unchanged; } db.SaveChanges(); } catch { } } } } RedirectToRouteResult customRedirectAction = CustomRedirectUrl(t_address, "BulkUpdate", ""); if (customRedirectAction != null) { return(customRedirectAction); } if (!string.IsNullOrEmpty(UrlReferrer)) { return(Redirect(UrlReferrer)); } else { return(RedirectToAction("Index")); } }
public ActionResult BulkUpdate([Bind(Include = "Id,ConcurrencyKey,T_EmployeeAccomodationID,T_AccommodationInjuryID,T_AccommodationStartDate,T_AccommodationEndDate,T_NinetyDaysSinceAccommodation,T_TemporaryAccommodation,T_DateLetterGivenToEmployee,T_Restriction,T_AccommodationNotes")] T_Accommodation t_accommodation, FormCollection collection, string UrlReferrer) { var bulkIds = collection["BulkUpdate"].Split(',').ToList(); var chkUpdate = collection["chkUpdate"]; if (!string.IsNullOrEmpty(chkUpdate)) { bool customsave_hasissues = false; foreach (var id in bulkIds.Where(p => p != string.Empty)) { long objId = long.Parse(id); T_Accommodation target = db.T_Accommodations.Find(objId); target.setDateTimeToClientTime(); EntityCopy.CopyValuesForSameObjectType(t_accommodation, target, chkUpdate); customsave_hasissues = false; CheckBeforeSave(target, "BulkUpdate"); if (ValidateModel(target) && !CustomSaveOnEdit(target, out customsave_hasissues, "BulkUpdate")) { db.Entry(target).State = EntityState.Modified; try { if (target.t_employeeaccomodation != null) { db.Entry(target.t_employeeaccomodation).State = EntityState.Unchanged; } if (target.t_accommodationinjury != null) { db.Entry(target.t_accommodationinjury).State = EntityState.Unchanged; } db.SaveChanges(); } catch { } } } } RedirectToRouteResult customRedirectAction = CustomRedirectUrl(t_accommodation, "BulkUpdate", ""); if (customRedirectAction != null) { return(customRedirectAction); } if (!string.IsNullOrEmpty(UrlReferrer)) { return(Redirect(UrlReferrer)); } else { return(RedirectToAction("Index")); } }
public ActionResult BulkUpdate([Bind(Include = "Id,ConcurrencyKey,T_SalaryBandSalaryRangeAssociationID,T_FacilitySalaryRangeAssociationID,T_Minimum,T_Maximum")] T_SalaryRange t_salaryrange, FormCollection collection, string UrlReferrer) { var bulkIds = collection["BulkUpdate"].Split(',').ToList(); var chkUpdate = collection["chkUpdate"]; if (!string.IsNullOrEmpty(chkUpdate)) { bool customsave_hasissues = false; foreach (var id in bulkIds.Where(p => p != string.Empty)) { long objId = long.Parse(id); T_SalaryRange target = db.T_SalaryRanges.Find(objId); target.setDateTimeToClientTime(); EntityCopy.CopyValuesForSameObjectType(t_salaryrange, target, chkUpdate); customsave_hasissues = false; CheckBeforeSave(target, "BulkUpdate"); if (ValidateModel(target) && !CustomSaveOnEdit(target, out customsave_hasissues, "BulkUpdate")) { db.Entry(target).State = EntityState.Modified; try { if (target.t_salarybandsalaryrangeassociation != null) { db.Entry(target.t_salarybandsalaryrangeassociation).State = EntityState.Unchanged; } if (target.t_facilitysalaryrangeassociation != null) { db.Entry(target.t_facilitysalaryrangeassociation).State = EntityState.Unchanged; } db.SaveChanges(); } catch { } } } } RedirectToRouteResult customRedirectAction = CustomRedirectUrl(t_salaryrange, "BulkUpdate", ""); if (customRedirectAction != null) { return(customRedirectAction); } if (!string.IsNullOrEmpty(UrlReferrer)) { return(Redirect(UrlReferrer)); } else { return(RedirectToAction("Index")); } }
public ActionResult BulkUpdate([Bind(Include = "Id,ConcurrencyKey,T_LicenseRecordsID,T_NameontheLicense,T_AssociatedLicensesTypeID,T_LicenseNumber,T_InitialLicenseDate,T_ExpiryDate,T_PrintDate,T_Notes")] T_Licenses t_licenses, FormCollection collection, string UrlReferrer) { var bulkIds = collection["BulkUpdate"].Split(',').ToList(); var chkUpdate = collection["chkUpdate"]; if (!string.IsNullOrEmpty(chkUpdate)) { bool customsave_hasissues = false; foreach (var id in bulkIds.Where(p => p != string.Empty)) { long objId = long.Parse(id); T_Licenses target = db.T_Licensess.Find(objId); target.setDateTimeToClientTime(); EntityCopy.CopyValuesForSameObjectType(t_licenses, target, chkUpdate); customsave_hasissues = false; CheckBeforeSave(target, "BulkUpdate"); if (ValidateModel(target) && !CustomSaveOnEdit(target, out customsave_hasissues, "BulkUpdate")) { db.Entry(target).State = EntityState.Modified; try { if (target.t_licenserecords != null) { db.Entry(target.t_licenserecords).State = EntityState.Unchanged; } if (target.t_associatedlicensestype != null) { db.Entry(target.t_associatedlicensestype).State = EntityState.Unchanged; } db.SaveChanges(); } catch { } } } } RedirectToRouteResult customRedirectAction = CustomRedirectUrl(t_licenses, "BulkUpdate", ""); if (customRedirectAction != null) { return(customRedirectAction); } if (!string.IsNullOrEmpty(UrlReferrer)) { return(Redirect(UrlReferrer)); } else { return(RedirectToAction("Index")); } }
/// <summary> /// 根据PriceRequestSysNo获取商品价格变动信息 /// </summary> /// <param name="productPriceRequest"></param> /// <returns></returns> private void UpdateProductPriceByRequestInfoSysNo(ProductPriceRequestInfo productPriceRequest) { if (productPriceRequest == null || productPriceRequest.SysNo == null || productPriceRequest.SysNo <= 0) { return; } InitProductPriceRequestInfo(productPriceRequest); var productSysNo = GetProductSysNoBySysNo(productPriceRequest.SysNo.Value); var productPrice = new ProductPriceInfo(); EntityCopy.CopyProperties(productPriceRequest, productPrice); productPrice.ProductWholeSalePriceInfo = productPriceRequest.ProductWholeSalePriceInfo; productPrice.ProductRankPrice = productPriceRequest.ProductRankPrice; var productPriceDA = ObjectFactory <IProductPriceDA> .Instance; productPriceDA.UpdateProductPrice(productSysNo, productPrice); }