private void ProcessForm(int queryId, bool isDelete)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    WeeklyProductionCapacityBO objProductionCapacity = new WeeklyProductionCapacityBO(this.ObjContext);
                    if (queryId > 0)
                    {
                        objProductionCapacity.ID = queryId;
                        objProductionCapacity.GetObject();
                    }

                    if (isDelete)
                    {
                        objProductionCapacity.Delete();
                    }
                    else
                    {
                        //objProductionCapacity.Name = this.txtAttributeName.Text;
                        //objProductionCapacity.Description = this.txtDescription.Text;

                        if (queryId == 0)
                        {
                            objProductionCapacity.Add();
                        }
                    }

                    this.ObjContext.SaveChanges();
                    ts.Complete();
                }
            }
            catch (Exception ex)
            {
                // Log the error
                //IndicoLogging.log("Error occured while Adding the Item", ex);
            }
        }
        private void ProcessForm(int queryId, bool isDelete)
        {
            try
            {
                using (var ts = new TransactionScope())
                {
                    var objProductionCapacity = new WeeklyProductionCapacityBO(ObjContext);
                    if (queryId > 0)
                    {
                        objProductionCapacity.ID = queryId;
                        objProductionCapacity.GetObject();
                    }
                    if (isDelete)
                    {
                        objProductionCapacity.Delete();
                    }

                    else
                    {
                        objProductionCapacity.NoOfHolidays            = int.Parse(txtWorkingDays.Text);
                        objProductionCapacity.HoursPerDay             = decimal.Parse(txtWorkingHours.Text);
                        objProductionCapacity.OrderCutOffDate         = DateTime.Parse(txtOrderCutOffDate.Text);
                        objProductionCapacity.EstimatedDateOfDespatch = DateTime.Parse(txtETD.Text);
                        objProductionCapacity.EstimatedDateOfArrival  = DateTime.Parse(txtETA.Text);
                        objProductionCapacity.Notes       = txtNotes.Text;
                        objProductionCapacity.SalesTarget = decimal.Parse(txtSalesTaget.Text);

                        foreach (RepeaterItem rptItem in rptItemTypes.Items)
                        {
                            var hdnProdCapDetailID = (HiddenField)rptItem.FindControl("hdnProdCapDetailID");
                            var hdnItemTypeID      = (HiddenField)rptItem.FindControl("hdnItemTypeID");
                            var txtTotalCapacity   = (TextBox)rptItem.FindControl("txtTotalCapacity");
                            var txt5PcsCapacity    = (TextBox)rptItem.FindControl("txt5PcsCapacity");
                            var txtSampleCapacity  = (TextBox)rptItem.FindControl("txtSampleCapacity");
                            var txtWorkers         = (TextBox)rptItem.FindControl("txtWorkers");
                            var txtEfficiency      = (TextBox)rptItem.FindControl("txtEfficiency");
                            var objProdCapDetailBO = new WeeklyProductionCapacityDetailsBO(ObjContext);
                            if (int.Parse(hdnProdCapDetailID.Value) > 0)
                            {
                                objProdCapDetailBO.ID = int.Parse(hdnProdCapDetailID.Value);
                                objProdCapDetailBO.GetObject();
                            }
                            else
                            {
                                objProdCapDetailBO.WeeklyProductionCapacity = queryId;
                                objProdCapDetailBO.ItemType = int.Parse(hdnItemTypeID.Value);
                            }
                            objProdCapDetailBO.TotalCapacity   = int.Parse(txtTotalCapacity.Text) * objProductionCapacity.NoOfHolidays;
                            objProdCapDetailBO.FivePcsCapacity = int.Parse(txt5PcsCapacity.Text) * objProductionCapacity.NoOfHolidays;
                            objProdCapDetailBO.SampleCapacity  = int.Parse(txtSampleCapacity.Text) * objProductionCapacity.NoOfHolidays;
                            objProdCapDetailBO.Workers         = int.Parse(txtWorkers.Text);
                            objProdCapDetailBO.Efficiency      = decimal.Parse(txtEfficiency.Text);
                        }
                        if (queryId == 0)
                        {
                            objProductionCapacity.Add();
                        }
                    }
                    ObjContext.SaveChanges();
                    ts.Complete();
                }
            }
            catch (Exception ex)
            {
                IndicoLogging.log.Error("Error occurred while Adding or Editing  or Deleting  the details in Production Capacity", ex);
            }
        }