private void DeleteML(int queryId) { try { using (TransactionScope ts = new TransactionScope()) { MeasurementLocationBO objMeasurementLocation = new MeasurementLocationBO(this.ObjContext); if (queryId > 0) { objMeasurementLocation.ID = queryId; objMeasurementLocation.GetObject(); foreach (SizeChartBO schart in objMeasurementLocation.SizeChartsWhereThisIsMeasurementLocation) { SizeChartBO objSizeChart = new SizeChartBO(this.ObjContext); objSizeChart.ID = schart.ID; objSizeChart.GetObject(); objSizeChart.Delete(); this.ObjContext.SaveChanges(); } objMeasurementLocation.Delete(); } this.ObjContext.SaveChanges(); ts.Complete(); } } catch (Exception ex) { IndicoLogging.log.Error("Error occured while Deleting the Measurement Location", ex); } }
private void ProcessML(bool isNewML) { try { using (TransactionScope ts = new TransactionScope()) { MeasurementLocationBO objML = new MeasurementLocationBO(this.ObjContext); if (!isNewML) { objML.ID = int.Parse(this.hdnSelectedMeasurementLocationListID.Value); objML.GetObject(); } objML.IsSend = (int.Parse(this.hdnIsSend.Value.ToString()) > 0) ? true : false; objML.Name = this.hdnName.Value.ToString(); objML.Key = this.hdnKey.Value.ToString(); if (isNewML) { int itemId = int.Parse(this.ddlItem.SelectedValue.ToString()); ItemBO objItem = new ItemBO(this.ObjContext); objItem.ID = itemId; objItem.GetObject(); objItem.MeasurementLocationsWhereThisIsItem.Add(objML); } this.ObjContext.SaveChanges(); ts.Complete(); } } catch (Exception ex) { IndicoLogging.log.Error("Error occured while processing Measurement Locations", ex); } }
protected void rptSpecML_ItemDataBound(object sender, RepeaterItemEventArgs e) { RepeaterItem item = e.Item; if (item.ItemIndex > -1 && item.DataItem is IGrouping <int, SizeChartBO> ) { List <SizeChartBO> lstSizeChart = ((IGrouping <int, SizeChartBO>)item.DataItem).ToList(); MeasurementLocationBO objML = new MeasurementLocationBO(); objML.ID = lstSizeChart[0].MeasurementLocation; objML.GetObject(); Literal litCellHeaderKey = (Literal)item.FindControl("litCellHeaderKey"); litCellHeaderKey.Text = objML.Key; Literal litCellHeaderML = (Literal)item.FindControl("litCellHeaderML"); litCellHeaderML.Text = objML.Name; Repeater rptSpecSizeQty = (Repeater)item.FindControl("rptSpecSizeQty"); rptSpecSizeQty.DataSource = lstSizeChart; rptSpecSizeQty.DataBind(); } }
private void GetDiffrenceGarmentSpec(int original, int compare) { PatternBO objOriPattern = new PatternBO(); objOriPattern.ID = original; objOriPattern.GetObject(); PatternBO objComPattern = new PatternBO(); objComPattern.ID = compare; objComPattern.GetObject(); List <SizeChartBO> lstDiffrence = new List <SizeChartBO>(); List <SizeChartBO> lstOriSizeCharts = objOriPattern.SizeChartsWhereThisIsPattern; List <SizeChartBO> lstCComSizeCharts = objComPattern.SizeChartsWhereThisIsPattern; foreach (SizeChartBO osc in lstOriSizeCharts) { foreach (SizeChartBO csc in lstCComSizeCharts) { if (osc.Size == csc.Size && osc.MeasurementLocation == csc.MeasurementLocation) { decimal difference = (osc.Val - csc.Val); MeasurementLocationBO objM = new MeasurementLocationBO(); objM.ID = csc.MeasurementLocation; objM.GetObject(); SizeBO objSize = new SizeBO(); objSize.ID = csc.Size; objSize.GetObject(); SizeChartBO objSizeChart = new SizeChartBO(); objSizeChart.ID = 0; objSizeChart.Pattern = csc.Pattern;// Not necessary objSizeChart.MeasurementLocation = osc.MeasurementLocation; objSizeChart.objPattern = objComPattern; objSizeChart.Size = csc.Size; objSizeChart.objSize = objSize; objSizeChart.MeasurementLocation = csc.MeasurementLocation; objSizeChart.objMeasurementLocation = objM; objSizeChart.Val = difference; lstDiffrence.Add(objSizeChart); } } } List <IGrouping <int, SizeChartBO> > lstSizeChartGroup = lstDiffrence.OrderBy(o => o.objMeasurementLocation.Key).GroupBy(o => o.MeasurementLocation).ToList(); if (lstSizeChartGroup.Count > 0) { this.rptDiffSpecSizeQtyHeader.DataSource = (List <SizeChartBO>)lstSizeChartGroup[0].ToList(); this.rptDiffSpecSizeQtyHeader.DataBind(); this.rptDiffSpecML.DataSource = lstSizeChartGroup; this.rptDiffSpecML.DataBind(); this.dvDiffrence.Visible = true; } }