public ActionResult viewmakeitems(string BIDMATID)
        {
            if (!string.IsNullOrWhiteSpace(BIDMATID))
            {
                Session["BIDMATID"] = BIDMATID;
            }
            else
            {
                BIDMATID = Convert.ToString(Session["BIDMATID"]);
            }
            if (Session["BIDMATID"] == null || BIDMATID != Convert.ToString(Session["BIDMATID"]))
            {
                Session["BIDMATID"] = BIDMATID;
            }
            List <BID04_MaterialDetail> materialDl = CFSProcessingDAL.GetBidMaterialDetails(Convert.ToInt32(Session["BIDMATID"]));

            return(View("detail/viewmakeitems", materialDl));
        }
        public ActionResult saveStyleHeight(BID01_Headers header)
        {
            int BIDID, BIDMATID = 0;

            header.BIDStatusID          = Convert.ToString(Session["JobStatusId"]);
            header.InRollup             = 1;
            header.SalTxPer             = 0;
            header.EditBidItemFlag      = 0;
            header.PercentOfHtStd       = 0;
            header.PercentOfFtRangeStd  = 0;
            header.PercentOfDigStandard = 0;
            header.SupervisonMarkup     = 0;
            header.MaterialMarkUp       = 0;
            header.LaborMarkUp          = 0;
            header.JobMarkUp            = 0;
            header.PFPJobMarkup         = 0;
            header.PRJID = Convert.ToInt32(Session["PRJID"]);

            var result = ProjectDAL.saveStyleHeight(header);

            BIDID = result;
            if (BIDID > 0)
            {
                header.BIDID = BIDID;
                var matHeader = new BID03_MaterialHeader();
                matHeader.BIDMatHeaderID = header.BIDMatHeaderID;
                if (header.CFSFiles[0] != null)
                {
                    matHeader.CfsFileName    = header.CFSFiles[0].FileName;
                    matHeader.OverRiddenCost = 0;
                    matHeader.BIDID          = BIDID;
                    matHeader.EmployeeID     = Convert.ToString(Session["CommID"]);
                    if (header.OverrideCost)
                    {
                        matHeader.OverRideCost   = Convert.ToByte(header.OverrideCost);
                        matHeader.OverRiddenCost = Convert.ToDecimal(header.MaterialCost);
                    }
                    matHeader.BIDMatHeaderID = 0;
                    CFSProcessingDAL.DeleteExistingCFS(header.BIDID, 1);
                    header.BIDMatHeaderID = 0;
                    BIDMATID = ProjectDAL.saveMaterialHeader(matHeader);
                    header.BIDMatHeaderID = BIDMATID;
                    if (BIDMATID > 0)
                    {
                        string cfsDatapath = Server.MapPath("~/App_Data/CFS.xml");
                        //Server.MapPath(ConfigurationManager.AppSettings["menuListPathConfig"].ToString());
                        result = CFSProcessingDAL.saveCFSFile(header.CFSFiles[0], BIDMATID, header.OverrideCost, matHeader.BIDID.ToString(), cfsDatapath);
                    }
                }
                else
                {
                    matHeader.BIDID          = BIDID;
                    matHeader.EmployeeID     = Convert.ToString(Session["CommID"]);
                    matHeader.CfsFileName    = header.CFSFileName;
                    matHeader.OverRideCost   = Convert.ToByte(header.OverrideCost);
                    matHeader.OverRiddenCost = Convert.ToDecimal(header.MaterialCost);
                    BIDMATID            = ProjectDAL.saveMaterialHeader(matHeader);
                    Session["BIDMATID"] = BIDMATID;
                }
            }

            if (result > 0)
            {
                Session["FenceTypeID"] = header.FenceTypeID;
                Session["BidId"]       = header.BIDID;
                return(RedirectToAction("viewmakeitems", new { BIDMATID = BIDMATID }));
            }
            else
            {
                LoadComboForHeight();
                ModelState.AddModelError(String.Empty, BusinessConstants.contactAdmin);
                return(View("detail/selectheight", header));
            }
        }