public void gvPlantList_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                System.Web.UI.WebControls.Label       lbl     = new Label();
                System.Web.UI.WebControls.HiddenField hfField = new HiddenField();

                try
                {
                    lbl = (Label)e.Row.Cells[0].FindControl("lblBusorg_out");
                    if (!String.IsNullOrEmpty(lbl.Text))
                    {
                        BUSINESS_ORG busorg = SQMModelMgr.LookupBusOrg(entities, SessionManager.SessionContext.ActiveCompany().COMPANY_ID, Convert.ToDecimal(lbl.Text));
                        if (busorg != null)
                        {
                            lbl.Text = busorg.ORG_NAME;
                        }
                    }

                    lbl      = (Label)e.Row.Cells[0].FindControl("lblStatus_out");
                    hfField  = (HiddenField)e.Row.Cells[0].FindControl("hfStatus_out");
                    lbl.Text = WebSiteCommon.GetStatusString(hfField.Value);
                }
                catch
                {
                }
            }
        }
        public void gvList_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                System.Web.UI.WebControls.Label       lbl     = new Label();
                System.Web.UI.WebControls.HiddenField hfField = new HiddenField();

                try
                {
                    lbl = (Label)e.Row.Cells[0].FindControl("lblStatus_out");
                    if (lbl != null)
                    {
                        hfField  = (HiddenField)e.Row.Cells[0].FindControl("hfStatus");
                        lbl.Text = WebSiteCommon.GetStatusString(hfField.Value);
                    }
                    CheckBox ckbox = (CheckBox)e.Row.Cells[0].FindControl("cbStatus");
                    if (ckbox != null)
                    {
                        hfField = (HiddenField)e.Row.Cells[0].FindControl("hfStatus");
                        if (hfField.Value == "A")
                        {
                            ckbox.Checked = true;
                        }
                    }
                }
                catch
                {
                }
            }
        }
示例#3
0
 public void DisplayCompany(COMPANY company)
 {
     pnlCompanyHdr.Visible          = true;
     lblCompanyName_out.Text        = company.COMPANY_NAME;
     lblUlDunsCode_out.Text         = company.ULT_DUNS_CODE;
     lblCompanyStatus_out.Text      = WebSiteCommon.GetStatusString(company.STATUS);
     lblCompanyUpdatedDate_out.Text = WebSiteCommon.LocalTime((DateTime)company.LAST_UPD_DT, SessionManager.UserContext.TimeZoneID).ToString();
 }
        public void rptOrgList_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                Label       lbl;
                HiddenField hfField;

                try
                {
                    BUSINESS_ORG busOrg = (BUSINESS_ORG)e.Item.DataItem;

                    lbl = (Label)e.Item.FindControl("lblParentBUHdr_out");
                    if (busOrg.PARENT_BUS_ORG_ID == busOrg.BUS_ORG_ID || busOrg.PARENT_BUS_ORG_ID < 1)
                    {
                        lbl.Text = "Top Level";
                    }
                    else
                    {
                        BUSINESS_ORG parentOrg = null;
                        if ((parentOrg = SQMModelMgr.LookupParentBusOrg(null, busOrg)) != null)
                        {
                            lbl.Text = parentOrg.ORG_NAME;
                        }
                    }

                    lbl      = (Label)e.Item.FindControl("lblStatus");
                    hfField  = (HiddenField)e.Item.FindControl("hfStatus");
                    lbl.Text = WebSiteCommon.GetStatusString(hfField.Value);

                    GridView gv = (GridView)e.Item.FindControl("gvPlantList");
                    gv.DataSource = busOrg.PLANT.OrderBy(l => l.PLANT_NAME).ToList();  // order by plant name
                    gv.DataBind();

                    Label divLabel         = (Label)e.Item.FindControl("lblPlantListEmpty");
                    HtmlGenericControl div = (HtmlGenericControl)e.Item.FindControl("divPlantGVScroll");
                    SetGridViewDisplay(gv, divLabel, div, 20, gv.Rows.Count, "scrollArea");

                    if (UserContext.GetMaxScopePrivilege(SysScope.busloc) <= SysPriv.admin)
                    {
                        if (busOrg.PLANT.Count > 0)
                        {
                            Button btnAddPlant = (Button)gv.HeaderRow.FindControl("btnAddPlant");
                            btnAddPlant.CommandArgument = busOrg.BUS_ORG_ID.ToString();
                            btnAddPlant.Visible         = true;
                        }
                        else
                        {
                            Button btnAddPlant = (Button)e.Item.FindControl("btnAddPlantEmpty");
                            btnAddPlant.CommandArgument = busOrg.BUS_ORG_ID.ToString();
                            btnAddPlant.Visible         = true;
                        }
                    }
                }
                catch
                {
                }
            }
        }
示例#5
0
 public void DisplayCompanyData(COMPANY company, int userCount)
 {
     pnlCompanyData.Visible     = true;
     lnkCompany.Text            = company.COMPANY_NAME;
     lnkCompany.CommandArgument = lnkCompanyUsers.CommandArgument = company.COMPANY_ID.ToString();
     lblCompanyCode.Text        = company.ULT_DUNS_CODE;
     lblCompanyStatus2.Text     = WebSiteCommon.GetStatusString(company.STATUS);
     if (userCount > -1)
     {
         lnkCompanyUsers.Text = lblManageUsers.Text + " (" + userCount.ToString() + ")";
     }
 }
 public void gvList_OnNonconfRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
 {
     if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
     {
         try
         {
             Label       lbl = (Label)e.Row.Cells[0].FindControl("lblStatus_out");
             HiddenField hf  = (HiddenField)e.Row.Cells[0].FindControl("hfStatus_out");
             lbl.Text = WebSiteCommon.GetStatusString(hf.Value);
         }
         catch
         {
         }
     }
 }
        private void SetupPage()
        {
            ddlFormType.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("COAForm", "long"));

            if (coaReport.BusOrg != null)
            {
                SetFindControlValue("lblParentBU_out", hfBase, coaReport.BusOrg.ORG_NAME);
                ddlPlant.DataSource     = coaReport.PlantList;
                ddlPlant.DataTextField  = "PLANT_NAME";
                ddlPlant.DataValueField = "PLANT_ID";
                ddlPlant.DataBind();
                ddlPlant.Items.Insert(0, new ListItem("", "0"));
            }

            if (coaReport.Part == null)
            {
                pnlPartDetail.Visible = pnlPartBOM.Visible = pnlCtlResult.Visible = false;
            }
            else
            {
                tbPartNumber.Text     = coaReport.Part.PART_NUM;
                pnlPartDetail.Visible = pnlPartBOM.Visible = pnlCtlResult.Visible = true;
                SetFindControlValue("lblPartNum_out", hfBase, coaReport.Part.PART_NUM);
                SetFindControlValue("lblPartNumFull_out", hfBase, SQMModelMgr.GetFullPartNumber(coaReport.Part));
                SetFindControlValue("lblPartName_out", hfBase, coaReport.Part.PART_NAME);
                SetFindControlValue("lblPartSerial_out", hfBase, coaReport.Part.SERIAL_NUM);
                SetFindControlValue("lblDrawing_out", hfBase, coaReport.Part.DRAWING_REF);
                SetFindControlValue("lblPartRevisionLevel_out", hfBase, coaReport.Part.REVISION_LEVEL);
                SetFindControlValue("lblPartStatus_out", hfBase, WebSiteCommon.GetStatusString(coaReport.Part.STATUS));

                GridView gv = (GridView)hfBase.FindControl("gvPartAssyList");
                gv.DataSource = coaReport.Part.PART_COMPONENT;
                gv.DataBind();
                gv.Columns[5].Visible = true;
                gv.Columns[4].Visible = false;
                SetGridViewDisplay(gv, (Label)hfBase.FindControl("lblPartAssyListEmpty"), (System.Web.UI.HtmlControls.HtmlGenericControl)hfBase.FindControl("divGVScrollBOM2"), 0);

                GridView gv2 = (GridView)hfBase.FindControl("gvPartProcList");
                gv2.DataSource = coaReport.Part.PART_PROCESS;
                gv2.DataBind();
                gv2.Columns[4].Visible = true;
                SetGridViewDisplay(gv2, (Label)hfBase.FindControl("lblPartProcListEmpty"), (System.Web.UI.HtmlControls.HtmlGenericControl)hfBase.FindControl("divGVScrollBOM1"), 0);

                DoCtlPlanSteps();
            }
        }
示例#8
0
        private void SetupPage()
        {
            BUSINESS_ORG busOrg = (BUSINESS_ORG)SessionManager.BusinessOrg;

            pnlBusOrgDetail.Visible = true;
            // bu summary section
            SetFindControlValue("lblOrgName_out", hfBase, busOrg.ORG_NAME);
            SetFindControlValue("lblLocCode_out", hfBase, busOrg.DUNS_CODE);
            SetFindControlValue("lblCurrency_out", hfBase, busOrg.PREFERRED_CURRENCY_CODE);
            SetFindControlValue("lblCaseThreshold_out", hfBase, busOrg.THRESHOLD_AMT.ToString());
            SetFindControlValue("lblStatus_out", hfBase, WebSiteCommon.GetStatusString(busOrg.STATUS));
            SetFindControlValue("lblUpdatedBy_out", hfBase, busOrg.LAST_UPD_BY);
            SetFindControlValue("lblUpdatedDate_out", hfBase, WebSiteCommon.LocalTime((DateTime)busOrg.LAST_UPD_DT, SessionManager.UserContext.TimeZoneID).ToString());


            if (busOrg.PARENT_BUS_ORG_ID == busOrg.BUS_ORG_ID || busOrg.PARENT_BUS_ORG_ID < 1)
            {
                SetFindControlValue("lblParentBU_out", hfBase, "Top Level");
            }
            else
            {
                if (SessionManager.ParentBusinessOrg == null)
                {
                    SessionManager.ParentBusinessOrg = SQMModelMgr.LookupParentBusOrg(entities, busOrg);
                }
                BUSINESS_ORG parentOrg = (BUSINESS_ORG)SessionManager.ParentBusinessOrg;
                SetFindControlValue("lblParentBU_out", hfBase, parentOrg.ORG_NAME);
            }

            // editable fields
            SetFindControlValue("tbOrgname", hfBase, busOrg.ORG_NAME);
            SetFindControlValue("tbOrgLocCode", hfBase, busOrg.DUNS_CODE);
            SetFindControlValue("tbThreshold", hfBase, busOrg.THRESHOLD_AMT.ToString());
            SetFindControlValue("ddlCurrencyCodes", hfBase, busOrg.PREFERRED_CURRENCY_CODE);
            SetFindControlValue("ddlStatus", hfBase, busOrg.STATUS);
            if (busOrg.PARENT_BUS_ORG_ID > 0)
            {
                SetFindControlValue("ddlParentBusOrg", hfBase, busOrg.PARENT_BUS_ORG_ID.ToString());
            }
            SetFindControlValue("lblLastUpdate_out", hfBase, busOrg.LAST_UPD_BY);
            SetFindControlValue("lblLastUpdateDate_out", hfBase, WebSiteCommon.LocalTime((DateTime)busOrg.LAST_UPD_DT, SessionManager.UserContext.TimeZoneID).ToString());
        }
示例#9
0
        public void gvUserList_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                System.Web.UI.WebControls.Label       lbl     = new Label();
                System.Web.UI.WebControls.HiddenField hfField = new HiddenField();
                try
                {
                    try
                    {
                        hfField = (HiddenField)e.Row.Cells[0].FindControl("hfBusOrg_out");
                        decimal busorgID = Convert.ToDecimal(hfField.Value);
                        if (busorgID > 0)
                        {
                            BUSINESS_ORG busOrg = busorgList.FirstOrDefault(b => (b.BUS_ORG_ID == busorgID));
                            if (busOrg != null)
                            {
                                lbl      = (Label)e.Row.Cells[0].FindControl("lblBusOrg_out");
                                lbl.Text = busOrg.ORG_NAME;
                            }
                        }
                    }
                    catch
                    {
                    }

                    lbl      = (Label)e.Row.Cells[0].FindControl("lblStatus_out");
                    hfField  = (HiddenField)e.Row.Cells[0].FindControl("hfStatus_out");
                    lbl.Text = WebSiteCommon.GetStatusString(hfField.Value);

                    lbl     = (Label)e.Row.Cells[0].FindControl("lblLastUpd_out");
                    hfField = (HiddenField)e.Row.Cells[0].FindControl("hfLastUpd_out");
                    DateTime dt = new DateTime();
                    dt       = Convert.ToDateTime(hfField.Value);
                    lbl.Text = dt.ToShortDateString();
                }
                catch
                {
                }
            }
        }
        public void gvPlantList_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                System.Web.UI.WebControls.Label       lbl     = new Label();
                System.Web.UI.WebControls.HiddenField hfField = new HiddenField();

                try
                {
                    lbl      = (Label)e.Row.Cells[0].FindControl("lblLocationType_out");
                    hfField  = (HiddenField)e.Row.Cells[0].FindControl("hfLocationType");
                    lbl.Text = WebSiteCommon.GetXlatValue("locationType", hfField.Value);

                    lbl      = (Label)e.Row.Cells[0].FindControl("lblStatus_out");
                    hfField  = (HiddenField)e.Row.Cells[0].FindControl("hfStatus_out");
                    lbl.Text = WebSiteCommon.GetStatusString(hfField.Value);

                    SETTINGS sets = SQMSettings.GetSetting("COMPANY", "PLANTUSER");
                    if (sets == null || sets.VALUE.ToUpper() != "N")
                    {
                        LinkButton  lnk     = (LinkButton)e.Row.Cells[0].FindControl("lnkView_out");
                        decimal     plantID = Convert.ToDecimal(lnk.CommandArgument);
                        HiddenField hf      = (HiddenField)e.Row.Cells[0].FindControl("hfPlantCompanyID");
                        lnk.ToolTip = "";
                        foreach (PERSON person in UserList())
                        {
                            if (person.ROLE > 1 && SQMModelMgr.PersonPlantAccess(person, plantID))
                            {
                                lnk.ToolTip += (" " + person.FIRST_NAME + " " + person.LAST_NAME + ",");
                            }
                        }
                        lnk.ToolTip = lnk.ToolTip.TrimEnd(',');
                    }
                }
                catch
                {
                }
            }
        }
        public void gvList_OnMeasureRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                try
                {
                    Label       lbl = (Label)e.Row.Cells[0].FindControl("lblStatus_out");
                    HiddenField hf  = (HiddenField)e.Row.Cells[0].FindControl("hfStatus_out");
                    lbl.Text = WebSiteCommon.GetStatusString(hf.Value);

                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfMeasureSubcat");
                    if (hf.Value != staticSubcat)
                    {
                        staticSubcat = hf.Value;
                        lbl          = (Label)e.Row.Cells[0].FindControl("lblMeasureSubcat");
                        lbl.Text     = WebSiteCommon.GetXlatValue("measureSubCategory", hf.Value);
                        e.Row.Cells[0].Style.Add("BORDER-TOP", "#787878 1px solid");
                    }

                    hf  = (HiddenField)e.Row.Cells[0].FindControl("hfMeasureUOM");
                    lbl = (Label)e.Row.Cells[0].FindControl("lblMeasureUOM_out");
                    UOM uom = SessionManager.UOMList.FirstOrDefault(l => l.UOM_ID == Convert.ToDecimal(hf.Value));
                    if (uom != null)
                    {
                        lbl.Text = uom.UOM_CD;
                    }

                    for (int n = 1; n <= e.Row.Cells.Count; n++)
                    {
                        e.Row.Cells[n].Style.Add("BORDER-TOP", "#787878 1px solid");
                    }
                }
                catch
                {
                }
            }
        }
示例#12
0
        public void gvBusOrgList_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                System.Web.UI.WebControls.Label       lbl     = new Label();
                System.Web.UI.WebControls.HiddenField hfField = new HiddenField();

                try
                {
                    lbl      = (Label)e.Row.Cells[0].FindControl("lblStatus");
                    hfField  = (HiddenField)e.Row.Cells[0].FindControl("hfStatus");
                    lbl.Text = WebSiteCommon.GetStatusString(hfField.Value);

                    BUSINESS_ORG busOrg = orgList[e.Row.RowIndex];
                    GridView     gv     = (GridView)e.Row.Cells[0].FindControl("gvPlantGrid");
                    gv.DataSource = busOrg.PLANT;
                    gv.DataBind();
                    totalRowCount += gv.Rows.Count;
                }
                catch
                {
                }
            }
        }