Example #1
0
    private object[] GetSelectKpiList(UltraWebGrid grid)
    {
        object[] objTemp = new object[grid.Rows.Count];
        int      objCnt  = 0;

        for (int i = 0; i < grid.Rows.Count; i++)
        {
            UltraGridRow    gr = grid.Rows[i];
            CheckBox        chkCheck;
            TemplatedColumn Col_Check = (TemplatedColumn)gr.Band.Columns.FromKey("selchk");

            chkCheck = (CheckBox)((CellItem)Col_Check.CellItems[gr.BandIndex]).FindControl("cBox");
            if (chkCheck.Checked)
            {
                objTemp[objCnt] = DataTypeUtility.GetToInt32(gr.Cells.FromKey("KPI_POOL_REF_ID").Value);
                objCnt++;
            }
        }

        objCnt = 0;
        for (int i = 0; i < objTemp.Length; i++)
        {
            if (objTemp[i] == null)
            {
                break;
            }
            objCnt++;
        }
        if (objCnt == 0)
        {
            return(null);
        }
        object[] rtnObj = new object[objCnt];

        for (int i = 0; i < rtnObj.Length; i++)
        {
            rtnObj[i] = objTemp[i];
        }
        return(rtnObj);
    }
Example #2
0
    protected DataTable Get_SaveDT_EstQuestion()
    {
        Biz_QuestionDatas questionDatas = new Biz_QuestionDatas();
        DataTable         saveDT        = questionDatas.GetDataTableSchema();

        for (int i = 0; i < ugrdEstQuestion.Rows.Count; i++)
        {
            DataRow dr = saveDT.NewRow();

            TemplatedColumn tc = (TemplatedColumn)ugrdEstQuestion.Rows[i].Cells.FromKey("Q_ITEM").Column;
            RadioButtonList rdoQuestionItem = (RadioButtonList)((CellItem)tc.CellItems[i]).FindControl("rdoQuestionItem");

            string q_obj_id = Q_OBJ_ID;
            string q_sbj_id = DataTypeUtility.GetString(ugrdEstQuestion.Rows[i].Cells.FromKey("Q_SBJ_ID").Value);
            string q_itm_id = DataTypeUtility.GetString(rdoQuestionItem.SelectedValue);

            dr["COMP_ID"]         = COMP_ID;
            dr["EST_ID"]          = EST_ID;
            dr["ESTTERM_REF_ID"]  = ESTTERM_REF_ID;
            dr["ESTTERM_SUB_ID"]  = ESTTERM_SUB_ID;
            dr["ESTTERM_STEP_ID"] = ESTTERM_STEP_ID;
            dr["EST_DEPT_ID"]     = TGT_DEPT_ID;
            dr["EST_EMP_ID"]      = TGT_EMP_ID;
            dr["TGT_DEPT_ID"]     = TGT_DEPT_ID;
            dr["TGT_EMP_ID"]      = TGT_EMP_ID;
            dr["Q_OBJ_ID"]        = q_obj_id;
            dr["Q_SBJ_ID"]        = q_sbj_id;
            dr["Q_ITM_ID"]        = q_itm_id;
            dr["POINT"]           = 0;
            dr["GRADE_ID"]        = "";
            dr["TEXT_VALUE"]      = "";
            dr["OPINION"]         = "";
            dr["ATTACH_NO"]       = "";
            dr["USER"]            = gUserInfo.Emp_Ref_ID;

            saveDT.Rows.Add(dr);
        }

        return(saveDT);
    }
Example #3
0
    /// <summary>
    /// Delete multiple containers on the grid
    /// </summary>
    private void Delete()
    {
        lbError.Visible = false;
        bool success = true;

        if (dg != null && dg.Rows != null && dg.Rows.Count > 0)
        {
            TemplatedColumn col = (TemplatedColumn)dg.Rows[0].Cells.FromKey("Select").Column;
            if (col != null)
            {
                for (int i = 0; i < col.CellItems.Count; i++)
                {
                    CellItem cellItem = (CellItem)col.CellItems[i];
                    Infragistics.WebUI.UltraWebGrid.UltraGridRow r = cellItem.Cell.Row;
                    CheckBox cb = (CheckBox)cellItem.FindControl("g_sd");
                    if (cb != null)
                    {
                        if (cb.Checked)
                        {
                            HyperCatalog.Business.InputFormContainer ifCObj = HyperCatalog.Business.InputFormContainer.GetByKey(Convert.ToInt32(r.Cells.FromKey("InputFormContainerId").Value));
                            success = ifCObj.Delete(HyperCatalog.Shared.SessionState.User.Id);
                            if (!success)
                            {
                                UpdateDataView();
                                lbError.CssClass = "hc_error";
                                lbError.Text     = HyperCatalog.Business.InputFormContainer.LastError;
                                lbError.Visible  = true;

                                break;
                            }
                        }
                    }
                }
            }
        }
        if (success)
        {
            UpdateDataView();
        }
    }
Example #4
0
    private bool SaveEstTermSubMap()
    {
        Biz_TermSubEstMaps termSubEstMap = new Biz_TermSubEstMaps();
        DataTable          dataTable     = termSubEstMap.GetDataTableSchema();
        DataRow            dataRow       = null;

        TemplatedColumn ckb_use_yn = null;
        CheckBox        ckbUseYN   = null;

        TemplatedColumn weight_col = null;
        TextBox         txtWeight  = null;

        for (int i = 0; i < uGridSub.Rows.Count; i++)
        {
            UltraGridRow row = uGridSub.Rows[i];

            ckb_use_yn = (TemplatedColumn)row.Band.Columns.FromKey("USE_YN");
            ckbUseYN   = (CheckBox)((CellItem)ckb_use_yn.CellItems[row.BandIndex]).FindControl("cBox");

            weight_col = (TemplatedColumn)row.Band.Columns.FromKey("WEIGHT");
            txtWeight  = (TextBox)((CellItem)weight_col.CellItems[row.BandIndex]).FindControl("txtWeight");

            if (ckbUseYN.Checked)
            {
                dataRow = dataTable.NewRow();

                dataRow["COMP_ID"]        = COMP_ID;
                dataRow["EST_ID"]         = TreeView1.SelectedValue;
                dataRow["ESTTERM_SUB_ID"] = uGridSub.Rows[i].Cells.FromKey("ESTTERM_SUB_ID").Value;
                dataRow["WEIGHT"]         = txtWeight.Text;
                dataRow["DATE"]           = DateTime.Now;
                dataRow["USER"]           = EMP_REF_ID;

                dataTable.Rows.Add(dataRow);
            }
        }

        return(termSubEstMap.SaveTermSubEstMap(dataTable, COMP_ID, TreeView1.SelectedValue));
    }
Example #5
0
    protected void ugrdGradeList_InitializeRow(object sender, RowEventArgs e)
    {
        DataRowView drw = (DataRowView)e.Data;


        e.Row.Cells.FromKey("ITYPE").Value = "U";

        DropDownList    ddlTempYN;
        TemplatedColumn yn_col = (TemplatedColumn)e.Row.Band.Columns.FromKey("USE_YN");

        ddlTempYN = (DropDownList)((CellItem)yn_col.CellItems[e.Row.BandIndex]).FindControl("ddlUse_YN");


        ddlTempYN.Items.Add(new ListItem("사용", "Y"));
        ddlTempYN.Items.Add(new ListItem("미사용", "N"));

        PageUtility.FindByValueDropDownList(ddlTempYN, e.Row.Cells.FromKey("USE_YN").Value.ToString());

        CheckBox        chkMidGradeTemp;
        TemplatedColumn home_yn_col;


        home_yn_col = (TemplatedColumn)e.Row.Band.Columns.FromKey("MID_GRADE_YN");

        chkMidGradeTemp = (CheckBox)((CellItem)home_yn_col.CellItems[e.Row.BandIndex]).FindControl("chkMidGrade_YN");



        if (drw["MID_GRADE_YN"].ToString() == "Y")
        {
            chkMidGradeTemp.Checked = true;
        }
        else
        {
            chkMidGradeTemp.Checked = false;
        }

        chkMidGradeTemp.Attributes.Add("onclick", "return selectChkBox(this, '" + ((UltraWebGrid)sender).ClientID + "');");
    }
Example #6
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int isAllConvertThis = txtThis.Text == "" ? 0 : DataTypeUtility.GetToInt32(txtThis.Text);
        int isAllConvertFill = txtThis.Text == "" ? 0 : DataTypeUtility.GetToInt32(txtFill.Text);
        int rowEffect        = 0;

        for (int i = 0; i < ugrdKpiResultList.Rows.Count; i++)
        {
            UltraGridRow    row       = ugrdKpiResultList.Rows[i];
            TemplatedColumn Col_Check = (TemplatedColumn)row.Band.Columns.FromKey("selchk");
            System.Web.UI.WebControls.CheckBox chkCheck = (System.Web.UI.WebControls.CheckBox)((CellItem)Col_Check.CellItems[row.BandIndex]).FindControl("cBox");

            if (chkCheck.Checked)
            {
                double target_ms = txtThis.Text != "" && DataTypeUtility.GetToDouble(txtThis.Text) != 0 ?
                                   DataTypeUtility.GetToDouble(txtThis.Text) : DataTypeUtility.GetToDouble((row.Cells.FromKey("RESULT_MS").Value));
                double target_ts = txtFill.Text != "" && DataTypeUtility.GetToDouble(txtFill.Text) != 0 ?
                                   DataTypeUtility.GetToDouble(txtFill.Text) : DataTypeUtility.GetToDouble((row.Cells.FromKey("RESULT_TS").Value));

                int    kpi_pool_ref_id = DataTypeUtility.GetToInt32((row.Cells.FromKey("KPI_REF_ID").Value));
                int    esstid          = DataTypeUtility.GetToInt32(ddlEstTermInfo.SelectedValue);
                string ymd             = ddlEstTermMonth.SelectedValue;

                rowEffect += new Biz_Com_Emp_Info().Update_Result(esstid, kpi_pool_ref_id, ymd, target_ms, target_ts);
            }
        }
        if (rowEffect > 0)
        {
            ltrScript.Text = JSHelper.GetAlertScript("저장되었습니다.");
            txtFill.Text   = "";
            txtThis.Text   = "";
            Grid_Bind();
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("저장 실패.");
            return;
        }
    }
        private void DoCompare()
        {
            string strItems          = string.Empty;
            string preference        = "c";
            string ContainerTypeCode = ddlContainertype.SelectedValue;
            int    nbItems           = 0;

            for (int i = 0; i < dg.Rows.Count; i++)
            {
                TemplatedColumn col = (TemplatedColumn)dg.Rows[i].Cells.FromKey("Select").Column;
                CheckBox        cb  = (CheckBox)((CellItem)col.CellItems[i]).FindControl("g_sd");
                if (cb.Checked)
                {
                    strItems += dg.Rows[i].Cells.FromKey("ItemId").Text + ",";
                    nbItems++;
                }
            }
            if (txtCompareComponents.Text != string.Empty)
            {
                using (Database database = Utils.GetMainDB())
                {
                    using (DataSet ds = database.RunSPReturnDataSet("_Item_CompareAnalyzeSkuList", "",
                                                                    new SqlParameter("@SkuList", txtCompareComponents.Text)
                                                                    ))
                    {
                        database.CloseConnection();
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            strItems += dr["ItemId"].ToString() + ",";
                            nbItems++;
                        }
                    }
                }
            }
            if (nbItems > 0)
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "DoCompare()", "<script>DoCompare('" + strItems + "', '" + cultureCode + "','" + preference + "','" + ContainerTypeCode + "');</script>");
            }
        }
    private void Save()
    {
        if (dg.Rows.Count > 0)
        {
            bool success = true;
            success = SessionState.EditedUser.Notifications.RemoveAll();
            TemplatedColumn col = (TemplatedColumn)dg.Rows[0].Cells.FromKey("Select").Column;
            foreach (CellItem cell in col.CellItems)
            {
                TemplatedColumn colDelay      = (TemplatedColumn)cell.Cell.Row.Cells.FromKey("Delay").Column;
                CellItem        cellItemDelay = (CellItem)colDelay.CellItems[cell.Cell.Row.Index];
                CheckBox        cb            = (CheckBox)cell.FindControl("g_sd");
                DropDownList    ddDelay       = (DropDownList)cellItemDelay.FindControl("ddDelay");
                if (cb.Checked)
                {
                    success = success && SessionState.EditedUser.Notifications.Add(Convert.ToInt32(cell.Cell.Row.DataKey), ddDelay.Enabled ? Convert.ToInt32(ddDelay.SelectedValue) : 0);
                }
            }

            SessionState.EditedUser.ClearNotifications();
            BindLists();
            if (success)
            {
                if (SessionState.EditedUser.Id == SessionState.User.Id)
                {
                    SessionState.User = SessionState.EditedUser;
                }
                lbError.Text     = "Data saved!";
                lbError.CssClass = "hc_success";
                lbError.Visible  = true;
            }
            else
            {
                lbError.Text     = "Error, update failed" + HyperCatalog.Business.UserNotification.LastError;
                lbError.CssClass = "hc_error";
                lbError.Visible  = true;
            }
        }
    }
    /// <summary>
    /// Save exclusion rule
    /// </summary>
    private void Save()
    {
        //string containerTypeCode = ddlContainerType.SelectedValue;
        string msg = string.Empty;

        if (inputFormTypeCode != ' ')
        {
            for (int i = 0; i < dg.Rows.Count; i++)
            {
                TemplatedColumn col = (TemplatedColumn)dg.Rows[i].Cells.FromKey("Select").Column;
                CheckBox        cb  = (CheckBox)((CellItem)col.CellItems[i]).FindControl("g_sd");
                string          containerTypeCode = dg.Rows[i].Cells.FromKey("Code").ToString();

                if (containerTypeCode.Length == 1 && cb.Checked)
                {
                    InputFormTypeExclusionRule rule = new InputFormTypeExclusionRule(inputFormTypeCode, Convert.ToChar(containerTypeCode));

                    if (!rule.Save())
                    {
                        msg = InputFormTypeExclusionRule.LastError + "\\n";
                    }
                }
            }
        }
        if (msg.Length == 0)
        {
            lbError.Text     = "Data saved!";
            lbError.CssClass = "hc_success";
            lbError.Visible  = true;

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "update", "<script>UpdateParentWithClose();</script>");
        }
        else
        {
            lbError.Text     = msg;
            lbError.CssClass = "hc_error";
            lbError.Visible  = true;
        }
    }
Example #10
0
    /// <summary>
    /// Delete multiple values on the grid
    /// </summary>
    private void Delete()
    {
        lbError.Visible = false;
        for (int i = 0; i < dg.Rows.Count; i++)
        {
            TemplatedColumn col = (TemplatedColumn)dg.Rows[i].Cells.FromKey("Select").Column;
            CheckBox        cb  = (CheckBox)((CellItem)col.CellItems[i]).FindControl("g_sd");
            if (cb.Checked)
            {
                LookupValue lgValuesObj = LookupValue.GetByKey(Convert.ToInt32(dg.Rows[i].Cells.FromKey("LookupValueId").Text));
                if (!lgValuesObj.Delete())
                {
                    lbError.CssClass = "hc_error";
                    lbError.Text     = LookupValue.LastError;
                    lbError.Visible  = true;

                    break;
                }
            }
        }
        UpdateDataView();
    }
Example #11
0
    protected void ImgBtnAddRow_Click(object sender, ImageClickEventArgs e)
    {
        int cntRow = 0;

        ugrdGradeList.Rows.Add();
        cntRow = ugrdGradeList.Rows.Count - 1;



        DropDownList    ddlTempYN;
        TemplatedColumn yn_col = (TemplatedColumn)ugrdGradeList.Columns.FromKey("USE_YN");

        ddlTempYN = (DropDownList)((CellItem)yn_col.CellItems[ugrdGradeList.Rows[cntRow].BandIndex]).FindControl("ddlUse_YN");


        ddlTempYN.Items.Add(new ListItem("사용", "Y"));
        ddlTempYN.Items.Add(new ListItem("미사용", "N"));



        DropDownList    ddlTempGradeYN;
        TemplatedColumn grade_col = (TemplatedColumn)ugrdGradeList.Columns.FromKey("MID_GRADE_YN");

        ddlTempGradeYN = (DropDownList)((CellItem)grade_col.CellItems[ugrdGradeList.Rows[cntRow].BandIndex]).FindControl("ddlMidGrade_YN");


        //ddlTempGradeYN.Items.Add(new ListItem("사용", "Y"));
        //ddlTempGradeYN.Items.Add(new ListItem("미사용", "N"));

        //ddlTempGradeYN.SelectedIndex = 1;

        UltraGridRow row;

        row = ugrdGradeList.Rows[cntRow];

        ugrdGradeList.Rows[cntRow].Cells.FromKey("ITYPE").Value         = "A";
        ugrdGradeList.Rows[cntRow].Cells.FromKey("EST_DEPT_TYPE").Value = PageUtility.GetByValueDropDownList(ddlDeptType);
        ugrdGradeList.Rows[cntRow].Cells.FromKey("TYPE_NAME").Value     = PageUtility.GetByTextDropDownList(ddlDeptType);
    }
Example #12
0
    protected void ugrdAppList_InitializeRow(object sender, RowEventArgs e)
    {
        //string strAppId = e.Row.Cells.FromKey("APP_REF_ID").Value.ToString();
        //string strVerNo = e.Row.Cells.FromKey("VERSION_NO").Value.ToString();
        //string strAppCd = e.Row.Cells.FromKey("APP_CODE").Value.ToString();
        //string strURL = String.Format("<span onclick='OpenAppWin({0},{1})'>{2}</span>", strAppId, strVerNo, strAppCd);
        //e.Row.Cells.FromKey("APP_CODE").Text = strURL;

        TemplatedColumn cCol   = (TemplatedColumn)e.Row.Band.Columns.FromKey("selchk");
        CheckBox        chkSel = (CheckBox)((CellItem)cCol.CellItems[e.Row.BandIndex]).FindControl("cBox");

        string strAppStatusCd = e.Row.Cells.FromKey("APP_CODE").Value.ToString();

        if (strAppStatusCd == Biz_Type.app_status_draft)
        {
            chkSel.Enabled = false;
        }
        else
        {
            chkSel.Enabled = true;
        }
    }
Example #13
0
    protected void UltraWebGrid1_InitializeRow(object sender, RowEventArgs e)
    {
        double total_weight = 0; //가중치 합계
        double weight       = 0; //부서 가중치


        //가중치 입력 필드에 바인드
        for (int i = 0; i < DEPT_TYPE_REF_ID.Length; i++)
        {
            string          colName = string.Format("WEIGHT_{0}", DEPT_TYPE_REF_ID[i]);
            TemplatedColumn tc      = (TemplatedColumn)UltraWebGrid1.Columns.FromKey("i" + colName);
            Infragistics.WebUI.WebDataInput.WebNumericEdit ne = (Infragistics.WebUI.WebDataInput.WebNumericEdit)((CellItem)tc.CellItems[e.Row.Index]).FindControl("WEIGHT");

            weight   = DataTypeUtility.GetToDouble(e.Row.Cells.FromKey(colName).Value);
            ne.Value = weight;

            total_weight += weight;
        }


        e.Row.Cells.FromKey("TOTAL_WEIGHT").Value = total_weight;
    }
Example #14
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int    result = 0;
        string type   = rdoTarget.SelectedValue;
        int    emp_no = DataTypeUtility.GetToInt32(hdfChampionEmpId.Value);

        for (int i = 0; i < ugrdKpiList.Rows.Count; i++)
        {
            UltraGridRow    row       = ugrdKpiList.Rows[i];
            TemplatedColumn Col_Check = (TemplatedColumn)row.Band.Columns.FromKey("selchk");
            CheckBox        chkCheck  = (CheckBox)((CellItem)Col_Check.CellItems[row.BandIndex]).FindControl("cBox");
            if (chkCheck.Checked)
            {
                if (type == "0")
                {
                    result = new Biz_Bsc_Kpi_Pool().AllTargetInsert(emp_no,
                                                                    DataTypeUtility.GetToInt32((row.Cells.FromKey("KPI_POOL_REF_ID").Value))
                                                                    );
                }
                else
                {
                    result = new Biz_Bsc_Kpi_Pool().AllResultInsert(emp_no,
                                                                    DataTypeUtility.GetToInt32((row.Cells.FromKey("KPI_POOL_REF_ID").Value))
                                                                    );
                }
            }
        }
        if (result > 0)
        {
            ltrScript.Text = JSHelper.GetAlertScript("저장되었습니다.");
            GridBind();
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("저장 실패.");
            return;
        }
    }
Example #15
0
 private void ApplyChanges(string s)
 {
     for (int i = 0; i < dg.Rows.Count; i++)
     {
         TemplatedColumn col = (TemplatedColumn)dg.Rows[i].Cells.FromKey("Select").Column;
         CheckBox        cb  = (CheckBox)((CellItem)col.CellItems[i]).FindControl("g_sd");
         if (cb.Checked)
         {
             Item item = Item.GetByKey(Convert.ToInt64(dg.Rows[i].Cells.FromKey("ItemId").Value));
             if (!item.UpdateWorkflowStatus(s, DDL_Cultures.SelectedValue, SessionState.User.Id))
             {
                 lbMessage.Text     = "Error: impossible to update workflowStatus for the bundle " + item.Name;
                 lbMessage.CssClass = "hc_error";
                 lbMessage.Visible  = true;
                 break;
             }
         }
     }
     DisplayData();
     lbMessage.Text     = "Changes applied";
     lbMessage.CssClass = "hc_success";
     lbMessage.Visible  = true;
 }
Example #16
0
    protected void ugrdEstOpinion_InitializeRow(object sender, RowEventArgs e)
    {
        string          sFileId = (e.Row.Cells.FromKey("REVIEW_FILE_ID").Value == null) ? "" : e.Row.Cells.FromKey("REVIEW_FILE_ID").Value.ToString();
        TemplatedColumn colEst  = (TemplatedColumn)e.Row.Cells.FromKey("EST_LEVEL_NAME").Column;

        System.Web.UI.WebControls.Label       lblLevel = (System.Web.UI.WebControls.Label)((CellItem)colEst.CellItems[e.Row.BandIndex]).FindControl("lblEST_LEVEL_NAME");
        System.Web.UI.WebControls.ImageButton btnFile  = (System.Web.UI.WebControls.ImageButton)((CellItem)colEst.CellItems[e.Row.BandIndex]).FindControl("iBtnReviewFile");
        System.Web.UI.WebControls.HiddenField hdfFile  = (System.Web.UI.WebControls.HiddenField)((CellItem)colEst.CellItems[e.Row.BandIndex]).FindControl("iHdfReviewFile");

        lblLevel.Text = (e.Row.Cells.FromKey("EST_LEVEL_NAME").Value == null) ? "" : e.Row.Cells.FromKey("EST_LEVEL_NAME").Value.ToString();

        if (sFileId.Length > 0)
        {
            hdfFile.Value         = sFileId;
            btnFile.Visible       = true;
            btnFile.OnClientClick = "return mfUpload('" + hdfFile.ClientID.Replace("$", "_") + "')";
        }
        else
        {
            hdfFile.Value   = "";
            btnFile.Visible = false;
        }
    }
Example #17
0
    protected void btnMapEdit_Click(object sender, EventArgs e)
    {
        int rows = ugrdStgList.Rows.Count;

        if (rows > 0)
        {
            for (int i = 0; i < rows; i++)
            {
                UltraGridRow    row    = ugrdStgList.Rows[i];
                TemplatedColumn selchk = (TemplatedColumn)row.Band.Columns.FromKey("selchk");
                CheckBox        cBox   = (CheckBox)((CellItem)selchk.CellItems[row.BandIndex]).FindControl("cBox");
                if (cBox.Checked)
                {
                    int stg_ref_id  = DataTypeUtility.GetToInt32(row.Cells.FromKey("STG_REF_ID").Value);
                    int view_ref_id = DataTypeUtility.GetToInt32(row.Cells.FromKey("VIEW_REF_ID").Value);
                    new MicroBSC.Integration.BSC.Biz.Biz_Bsc_Kpi_Pool().KpiPoolMapEdit(stg_ref_id, view_ref_id);
                }
            }
            ltrScript.Text = JSHelper.GetSclipt("변경 되었습니다.");
            SetStgGrid();
        }
        //new MicroBSC.Integration.BSC.Biz.Biz_Bsc_Kpi_Pool().KpiPoolMapEdit(1, 1);
    }
Example #18
0
    protected void ugrdEstComment_InitializeRow(object sender, RowEventArgs e)
    {
        string self_top_id = DataTypeUtility.GetString(e.Row.Cells.FromKey("SELF_TOP_ID"));

        DataTable dt_question = DataTypeUtility.FilterSortDataTable(DT_EST_SELF_DATA, string.Format("SELF_TOP_ID={0}", self_top_id));


        TemplatedColumn tc            = (TemplatedColumn)e.Row.Band.Columns.FromKey("EST_COMMENT");
        RadioButtonList rdoEstComment = (RadioButtonList)((CellItem)tc.CellItems[e.Row.Index]).FindControl("rdoEstComment");

        rdoEstComment.RepeatDirection = RepeatDirection.Horizontal;
        rdoEstComment.RepeatLayout    = RepeatLayout.Table;
        rdoEstComment.Width           = Unit.Percentage(99);
        rdoEstComment.DataSource      = dt_question;
        rdoEstComment.DataBind();

        DataTable dt_q_selected = DataTypeUtility.FilterSortDataTable(dt_question, string.Format("SELECTED > 0"));

        if (dt_q_selected.Rows.Count > 0)
        {
            WebUtility.FindByValueRadioButtonList(rdoEstComment, DataTypeUtility.GetString(dt_q_selected.Rows[0]["SELF_MID_ID"]));
        }
    }
Example #19
0
        private void InitializeGridGrouping()
        {
            int             i   = 0;
            int             x   = dg.Rows.Count;
            TemplatedColumn col = (TemplatedColumn)dg.Columns.FromKey("Select");

            groupCount = 0;
            while (i < dg.Rows.Count)
            {
                string containerGroup = dg.Rows[i].Cells.FromKey("Path").Value.ToString();
                if (i == 0 || currentGroup != containerGroup)
                {
                    currentGroup = containerGroup;
                    dg.Rows.Insert(i, new UltraGridRow());
                    CheckBox c = (CheckBox)((CellItem)col.CellItems[x]).FindControl("g_sd");
                    c.Visible = false;
                    Label l = (Label)((CellItem)col.CellItems[x]).FindControl("grp_lbl");
                    l.Visible     = true;
                    l.Text        = currentGroup;
                    l.CssClass    = "ptbgroup";
                    l.BorderStyle = BorderStyle.None;
                    UltraGridRow  groupRow     = dg.Rows[i];
                    UltraGridCell groupCellMax = groupRow.Cells[dg.Columns.Count - 1];
                    foreach (UltraGridCell cell in groupRow.Cells)
                    {
                        cell.Style.CssClass = string.Empty;
                    }
                    dg.Rows[i].Style.CssClass = "ptbgroup";
                    UltraGridCell groupCell = groupRow.Cells.FromKey("Select");
                    groupCell.Text    = containerGroup;
                    groupCell.ColSpan = dg.Columns.Count - 1 - groupCell.Column.Index;
                    i++;
                    x++;
                }
                i++;
            }
        }
Example #20
0
    protected int UnSetTarget()
    {
        int Result;
        //DataTable DT = UltraGridUtility.GetDataSetByCheckedBox(UltraWebGrid1
        //                                                        , new string[] { "PRJ_ID" }
        //                                                        , "selchk"
        //                                                        , "cBox").Tables[0];

        DataTable DT = new DataTable();

        DT.Columns.Add("PRJ_ID");


        foreach (UltraGridRow row in UltraWebGrid1.Rows)
        {
            string status = DataTypeUtility.GetString(row.Cells.FromKey("PRJ_EST_STATUS").Value);
            if (!status.Equals("E"))
            {
                TemplatedColumn col_cBox = (TemplatedColumn)row.Band.Columns.FromKey("selchk");
                CheckBox        cBox     = (CheckBox)((CellItem)col_cBox.CellItems[row.BandIndex]).FindControl("cBox");

                if (cBox.Checked == true)
                {
                    DT.Rows.Add(row.Cells.FromKey("PRJ_ID").Value);
                }
            }
        }


        Result = bizPrjInfo.UnSet_Est_Target(DT);
        if (DT.Rows.Count == 0)
        {
            Result = -1;
        }

        return(Result);
    }
Example #21
0
    protected void ugrdStgList_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
    {
        TemplatedColumn cCol   = (TemplatedColumn)e.Row.Band.Columns.FromKey("USE_YN");
        Image           objImg = (Image)((CellItem)cCol.CellItems[e.Row.BandIndex]).FindControl("imgUseYn");

        objImg.ImageUrl = (e.Row.Cells.FromKey("USE_YN").Value.ToString() == "Y") ?
                          "../images/icon_o.gif" : "../images/icon_x.gif";

        TemplatedColumn cCol1   = (TemplatedColumn)e.Row.Band.Columns.FromKey("MAPYN");
        Image           objImg1 = (Image)((CellItem)cCol1.CellItems[e.Row.BandIndex]).FindControl("imgUseMapYn");

        objImg1.ImageUrl = (e.Row.Cells.FromKey("MAPYN").Value.ToString() == "Y") ?
                           "../images/icon_o.gif" : "../images/icon_x.gif";


        string use_yn     = (DataTypeUtility.GetValue(e.Row.Cells.FromKey("USE_YN").Value) == "Y") ? "U" : "D";
        string stg_ref_id = DataTypeUtility.GetValue(e.Row.Cells.FromKey("STG_REF_ID").Value);
        string stg_name   = DataTypeUtility.GetValue(e.Row.Cells.FromKey("STG_NAME").Value);

        string url  = "<a href='#' onclick='doPoppingUp_StgList(\"{0}\",\"{1}\",\"{2}\",\"{3}\")'>{4}</a>";
        string link = string.Format(url, use_yn, IESTTERM_REF_ID, stg_ref_id, ICCB1, stg_name);

        e.Row.Cells.FromKey("STG_NAME").Value = link;
    }
    private void BindLists()
    {
        SessionState.EditedUser.ClearNotifications();
        cv            = new HyperCatalog.Business.CollectionView(SessionState.EditedUser.Notifications);
        dg.DataSource = SessionState.EditedUser.Role.Notifications;
        dg.DataBind();
        Utils.InitGridSort(ref dg, false);

        if (!SessionState.User.HasCapability(CapabilitiesEnum.MANAGE_USERS) || SessionState.User.IsReadOnly)
        {
            TemplatedColumn colHeader      = (TemplatedColumn)dg.Columns.FromKey("Select");
            HeaderItem      cellItemHeader = colHeader.HeaderItem;
            CheckBox        cbHeader       = (CheckBox)cellItemHeader.FindControl("g_ca");
            cbHeader.Enabled = false;

            foreach (UltraGridRow r in dg.Rows)
            {
                TemplatedColumn col      = (TemplatedColumn)r.Cells.FromKey("Select").Column;
                CellItem        cellItem = (CellItem)col.CellItems[r.Index];
                CheckBox        cb       = (CheckBox)cellItem.FindControl("g_sd");
                cb.Enabled = false;
            }
        }
    }
Example #23
0
    public static DataSet GetDataSetByCheckedBox(UltraWebGrid ultraWebGrid
                                                 , string[] strColumnNames
                                                 , string strTemplateColumnCheckBoxName
                                                 , string strCheckBoxName)
    {
        DataSet   dsReturn = new DataSet();
        DataTable dtReturn = new DataTable();

        dsReturn.Tables.Add(dtReturn);

        for (int i = 0; i < strColumnNames.Length; i++)
        {
            DataColumn dcColumn = new DataColumn(strColumnNames[i], typeof(string));
            dtReturn.Columns.Add(dcColumn);
        }

        foreach (UltraGridRow ugRow in ultraWebGrid.Rows)
        {
            TemplatedColumn col_cBox = (TemplatedColumn)ugRow.Band.Columns.FromKey(strTemplateColumnCheckBoxName);
            CheckBox        cBox     = (CheckBox)((CellItem)col_cBox.CellItems[ugRow.BandIndex]).FindControl(strCheckBoxName);

            DataRow drNew;
            if (cBox.Checked == true)
            {
                drNew = dtReturn.NewRow();

                foreach (DataColumn dcItem in dtReturn.Columns)
                {
                    drNew[dcItem.ColumnName] = ugRow.Cells.FromKey(dcItem.ColumnName).Value;
                }
                dtReturn.Rows.Add(drNew);
            }
        }

        return(dsReturn);
    }
Example #24
0
    public void SetRecallDraft()
    {
        DataTable dtDraft = new DataTable("RECALL_LIST");

        dtDraft.Columns.Add("APP_REF_ID", typeof(int));
        dtDraft.Columns.Add("VERSION_NO", typeof(int));

        DataRow         drDraft = null;
        int             iRow    = ugrdAppList.Rows.Count;
        int             iCol    = ugrdAppList.Columns.Count;
        TemplatedColumn cCol    = (TemplatedColumn)ugrdAppList.Columns.FromKey("selchk");
        CheckBox        chkSel  = null;

        for (int i = 0; i < iRow; i++)
        {
            chkSel = (CheckBox)((CellItem)cCol.CellItems[ugrdAppList.Rows[i].BandIndex]).FindControl("cBox");
            if (chkSel.Checked)
            {
                drDraft = dtDraft.NewRow();
                drDraft["APP_REF_ID"] = int.Parse(ugrdAppList.Rows[i].Cells.FromKey("APP_REF_ID").Value.ToString());
                drDraft["VERSION_NO"] = int.Parse(ugrdAppList.Rows[i].Cells.FromKey("VERSION_NO").Value.ToString());
                dtDraft.Rows.Add(drDraft);
            }
        }

        if (dtDraft.Rows.Count > 0)
        {
            Biz_Com_Approval_Prc objPrc = new Biz_Com_Approval_Prc();
            int iRtnRow = objPrc.RecallDraft(null, null, dtDraft, gUserInfo.Emp_Ref_ID);
            ltrScript.Text = JSHelper.GetAlertScript(objPrc.Transaction_Message, false);
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("선택된 문서가 없습니다.", false);
        }
    }
Example #25
0
 /// <summary>
 /// Delete the selected translation of the TM Expression
 /// </summary>
 private void Delete()
 {
     for (int i = 0; i < dg.Rows.Count; i++)
     {
         TemplatedColumn col = (TemplatedColumn)dg.Rows[i].Cells.FromKey("Select").Column;
         CheckBox        cb  = (CheckBox)((CellItem)col.CellItems[i]).FindControl("g_sd");
         if (cb.Checked)
         {
             using (TMExpressionTranslation tt = TMExpressionTranslation.GetByKey(expressionId, dg.Rows[i].Cells.FromKey("LanguageCode").ToString()))
             {
                 if (tt != null)
                 {
                     #region Delete result
                     if (!tt.Delete(HyperCatalog.Shared.SessionState.User.Id))
                     {
                         lbMessage.Text     = "Error: Translation [" + dg.Rows[i].Cells.FromKey("LanguageCode").ToString() + "] can't be deleted";
                         lbMessage.CssClass = "hc_error";
                         lbMessage.Visible  = true;
                         break;
                     }
                     #endregion
                 }
                 else
                 {
                     lbMessage.Text     = "Error: Term translation [" + dg.Rows[i].Cells.FromKey("Language").ToString() + "] can't be deleted - translation not found";
                     lbMessage.CssClass = "hc_error";
                     lbMessage.Visible  = true;
                 }
             }
         }
     }
     ShowTMTranslations();
     lbMessage.Text     = "Data deleted";
     lbMessage.CssClass = "hc_success";
     lbMessage.Visible  = true;
 }
Example #26
0
        private void Analyze()
        {
            lbError.Visible = false;
            dg.Visible      = false;
            bool showObsolete;

            string separator = rbList.SelectedValue;

            //Code modified for Links Requirement (PR664195) - to show/hide obsolete items based on "Include Obsolete" checkbox by Prachi on 18th Jan 2013
            if (bLinkFrom) //Analyzing List of Companion; so consider Include Obsolete option
            {
                CheckBox cb = (CheckBox)uwToolbar.Items.FromKeyCustom("chkObs").FindControl("chkObsolete");
                showObsolete = cb.Checked;
            }
            else
            {
                showObsolete = true;
            }

            //Code modified for Links Requirement (PR658943) - to allow analyze for higher level Node Names by Prachi on 19th Jan 2013
            string inputType = rblInput.SelectedValue.ToUpper();
            int    levelId;

            if (inputType.Equals("NAME"))
            {
                levelId = Convert.ToInt32(ddlLevel.SelectedValue);
            }
            else
            {
                levelId = 7; //In case of "SKU" selected in Input Type
            }
            try
            {
                DataSet ds = Link.LinkAnalyze(itemId, SessionState.Culture.Code, txtSKUs.Text, Convert.ToByte(bLinkFrom), linkTypeId, separator, Convert.ToByte(showObsolete), inputType, levelId);

                if (ds == null || ds.Tables.Count == 0)
                {
                    lbError.CssClass = "hc_error";
                    lbError.Text     = "Error in retrieving the Dataset";
                    lbError.Visible  = true;
                }
                else
                {
                    // initialize
                    NbSKUs = 0;
                    if (inputType.Equals("SKU"))
                    {
                        txtSKUs.Text = string.Empty;
                    }

                    // Display grid
                    if (ds != null)
                    {
                        dg.DataSource = ds.Tables[0];
                        dg.DataBind();
                        dg.Visible = true;

                        ds.Dispose();
                    }

                    if (inputType.Equals("NAME"))
                    {
                        LoadLevelDDL();
                        lbLevel.Enabled  = true;
                        ddlLevel.Enabled = true;
                        ddlLevel.Items.Remove("Disabled");
                        ddlLevel.SelectedValue = Convert.ToString(levelId);
                    }

                    // User can or cannot save
                    bool canProceed      = false;
                    bool isHeaderChecked = false;
                    if (txtSKUs.Text.Length > 0)
                    {
                        txtSKUs.Text = txtSKUs.Text.Substring(0, txtSKUs.Text.Length);
                    }

                    foreach (UltraGridRow r in dg.Rows)
                    {
                        if ((r.Cells[colErrorIndex].Text == string.Empty) || (Convert.ToInt32(r.Cells.FromKey("SameLink").Value) == 2 && Convert.ToBoolean(r.Cells.FromKey("IsRelevant").Text)))
                        {
                            canProceed = true;
                            break;
                        }
                    }

                    TemplatedColumn colH = (TemplatedColumn)dg.Columns.FromKey("Select");
                    CheckBox        cbH  = (CheckBox)colH.HeaderItem.FindControl("g_ca");
                    // Display or not Save button
                    if (canProceed)
                    {
                        Ultrawebtoolbar2.Items.FromKeyButton("Export").Enabled = true;
                        cbH.Enabled = true;
                    }
                    else
                    {
                        Ultrawebtoolbar2.Items.FromKeyButton("Export").Enabled = true;
                        cbH.Enabled = false;
                    }

                    //selecting/unselecting the header checkbox
                    foreach (UltraGridRow r in dg.Rows)
                    {
                        CheckBox cbItem = (CheckBox)((CellItem)colH.CellItems[r.Index]).FindControl("g_sd");
                        if (!cbItem.Enabled && cbItem.Checked)
                        {
                            isHeaderChecked = true;
                        }
                        else if (cbItem.Enabled)
                        {
                            if (!cbItem.Checked)
                            {
                                isHeaderChecked = false;
                                break;
                            }
                            else
                            {
                                isHeaderChecked = true;
                            }
                        }
                    }
                    if (isHeaderChecked)
                    {
                        cbH.Checked = true;
                    }

                    // Count of SKUs to save
                    if (NbSKUs > 0)
                    {
                        LbNbSKUs.Text = NbSKUs.ToString() + "/" + dg.Rows.Count.ToString() + " component(s) found. Please make a selection and Click Save.";
                    }
                    else
                    {
                        LbNbSKUs.Text = "The analyze provided 0 possible components. One component at least is required. Please retry or cancel.";
                    }

                    LbNbSKUs.Text    = "<br>" + LbNbSKUs.Text;
                    LbNbSKUs.Visible = true;

                    if (!bLinkFrom)  // Informative Message should be displayed only in case of Add Host
                    {
                        AddHostCnt.Value = NbSKUs.ToString();
                        lbMsg.Text       = "You are trying to create " + AddHostCnt.Value + " link(s). These links will only be manageable at product level.";
                    }
                    else
                    {
                        AddHostCnt.Value = "-1";
                    }
                }
            }
            catch (Exception e)
            {
                lbError.CssClass = "hc_error";
                lbError.Text     = "Input String is not in correct Format! Or separator is not used properly!";
                lbError.Visible  = true;
                LbNbSKUs.Visible = false;
                Ultrawebtoolbar2.Items.FromKeyButton("Export").Enabled = false;
            }
        }
Example #27
0
        protected void dg_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
        {
            //Code modified for Links Requirement (PR658943) - to allow analyze for higher level Node Names by Prachi on 19th Jan 2013 - start
            string inputType = rblInput.SelectedValue.ToUpper();
            string separator = rbList.SelectedValue; // separator

            TemplatedColumn col = (TemplatedColumn)e.Row.Cells.FromKey("Select").Column;
            CheckBox        cb  = (CheckBox)((CellItem)col.CellItems[e.Row.Index]).FindControl("g_sd");

            if (e.Row.Cells.FromKey("IsRelevant").Value != null)
            {
                cb.Enabled = Convert.ToBoolean(e.Row.Cells.FromKey("IsRelevant").Text);

                if (Convert.ToInt16(e.Row.Cells.FromKey("FlagExists").Value) == 1 && Convert.ToInt16(e.Row.Cells.FromKey("SameLink").Value) == 1)
                {
                    cb.Checked = Convert.ToBoolean(e.Row.Cells.FromKey("FlagExists").Text);
                }
            }

            //Added for Links Requirement (PR664364) - to add Host from Companions - Companion should always be SKU Level Item - start
            if (!bLinkFrom) // for links From -- Adding a Host
            {
                dg.Columns.FromKey("ClassName").Hidden    = true;
                dg.Columns.FromKey("MainItemPath").Hidden = false;
                dg.Columns.FromKey("ItemPath").Hidden     = true;
                dg.Columns.FromKey("ItemName").Hidden     = false;
            }
            else // for links To -- Adding a Companion
            {
                dg.Columns.FromKey("ClassName").Hidden    = false;
                dg.Columns.FromKey("MainItemPath").Hidden = true;
            }
            //Added for Links Requirement (PR664364) - to add Host from Companions - Companion should always be SKU Level Item - end

            if (inputType.Equals("SKU"))
            {
                dg.Columns.FromKey("ItemPath").Hidden = true;
                dg.Columns.FromKey("ItemName").Hidden = false;

                // If the proposed Sku is incorrect, change the cell style
                if (e.Row.Cells[colErrorIndex].Value != null && e.Row.Cells[colErrorIndex].Value.ToString().Length > 0)
                {
                    if (!Convert.ToBoolean(e.Row.Cells.FromKey("IsRelevant").Value))
                    {
                        e.Row.Cells.FromKey("ItemName").Style.CssClass = "hc_error";
                    }

                    if (!Convert.ToBoolean(e.Row.Cells.FromKey("IsRelevant").Value) && Convert.ToInt32(e.Row.Cells.FromKey("SameLink").Value) != 2)
                    {
                        e.Row.Cells.FromKey("ItemName").Text = "<b>[" + e.Row.Cells.FromKey("ItemNumber").Text + "]</b> - " + e.Row.Cells[colErrorIndex].Value.ToString();
                    }
                    else
                    {
                        e.Row.Cells.FromKey("ItemName").Text = e.Row.Cells.FromKey("ItemName").Text + " <b>[" + e.Row.Cells.FromKey("ItemNumber").Text + "] - " + e.Row.Cells[colErrorIndex].Value.ToString() + "</b>";
                    }

                    if (Convert.ToInt32(e.Row.Cells.FromKey("SameLink").Value) == 2 && Convert.ToBoolean(e.Row.Cells.FromKey("IsRelevant").Text))
                    {
                        if (txtSKUs.Text.Length > 0 && !txtSKUs.Text.Contains(e.Row.Cells.FromKey("ItemNumber").Text))
                        {
                            if (separator.Equals("R"))
                            {
                                txtSKUs.Text += "\r\n";
                            }
                            else
                            {
                                txtSKUs.Text += separator;
                            }
                        }
                        if (!txtSKUs.Text.Contains(e.Row.Cells.FromKey("ItemNumber").Text))
                        {
                            txtSKUs.Text += e.Row.Cells.FromKey("ItemNumber").Text;
                        }
                        NbSKUs++;
                    }
                }
                else
                {
                    e.Row.Cells.FromKey("ItemName").Text = e.Row.Cells.FromKey("ItemName").Text + " <b>[" + e.Row.Cells.FromKey("ItemNumber").Text + "]</b>";

                    // Update list of SKU
                    if (txtSKUs.Text.Length > 0 && !txtSKUs.Text.Contains(e.Row.Cells.FromKey("ItemNumber").Text))
                    {
                        if (separator.Equals("R"))
                        {
                            txtSKUs.Text += "\r\n";
                        }
                        else
                        {
                            txtSKUs.Text += separator;
                        }
                    }
                    if (!txtSKUs.Text.Contains(e.Row.Cells.FromKey("ItemNumber").Text))
                    {
                        txtSKUs.Text += e.Row.Cells.FromKey("ItemNumber").Text;
                    }
                    NbSKUs++;
                }
            }
            else if (inputType.Equals("NAME"))
            {
                if (bLinkFrom) //Adding a companion
                {
                    dg.Columns.FromKey("ItemName").Hidden = true;
                    dg.Columns.FromKey("ItemPath").Hidden = false;
                }

                // If the Sku is incorrect, change the cell style
                if (e.Row.Cells[colErrorIndex].Value != null && e.Row.Cells[colErrorIndex].Value.ToString().Length > 0)
                {
                    if (bLinkFrom)
                    {
                        if (!Convert.ToBoolean(e.Row.Cells.FromKey("IsRelevant").Value))
                        {
                            e.Row.Cells.FromKey("ItemPath").Style.CssClass = "hc_error";
                        }
                        if (!Convert.ToBoolean(e.Row.Cells.FromKey("IsRelevant").Value) && Convert.ToInt32(e.Row.Cells.FromKey("SameLink").Value) != 2)
                        {
                            if (e.Row.Cells.FromKey("ItemNumber").Value.ToString().Length > 0)
                            {
                                e.Row.Cells.FromKey("ItemPath").Text = e.Row.Cells.FromKey("ItemPath").Text + " <b>[" + e.Row.Cells.FromKey("ItemNumber").Text + "]</b> - " + e.Row.Cells[colErrorIndex].Value.ToString();
                            }
                            else
                            {
                                e.Row.Cells.FromKey("ItemPath").Text = e.Row.Cells.FromKey("ItemPath").Text + " - " + e.Row.Cells[colErrorIndex].Value.ToString();
                            }
                        }
                        else
                        {
                            e.Row.Cells.FromKey("ItemPath").Text = e.Row.Cells.FromKey("ItemPath").Text + " <b>[" + e.Row.Cells.FromKey("ItemNumber").Text + "] - " + e.Row.Cells[colErrorIndex].Value.ToString() + "</b>";
                        }
                    }
                    else
                    {
                        if (!Convert.ToBoolean(e.Row.Cells.FromKey("IsRelevant").Value))
                        {
                            e.Row.Cells.FromKey("ItemName").Style.CssClass = "hc_error";
                        }

                        if (e.Row.Cells.FromKey("ItemNumber").Value != null && e.Row.Cells.FromKey("ItemNumber").Value.ToString().Length > 0)
                        {
                            e.Row.Cells.FromKey("ItemName").Text = e.Row.Cells.FromKey("ItemName").Text + " <b>[" + e.Row.Cells.FromKey("ItemNumber").Text + "]</b> - " + e.Row.Cells[colErrorIndex].Value.ToString();
                        }
                        else
                        {
                            e.Row.Cells.FromKey("ItemName").Text = e.Row.Cells.FromKey("ItemName").Text + " - " + e.Row.Cells[colErrorIndex].Value.ToString();
                        }
                    }

                    if (Convert.ToInt32(e.Row.Cells.FromKey("SameLink").Value) == 2 && Convert.ToBoolean(e.Row.Cells.FromKey("IsRelevant").Text))
                    {
                        NbSKUs++;
                    }
                }
                else
                {
                    if (bLinkFrom)
                    {
                        e.Row.Cells.FromKey("ItemPath").Text = e.Row.Cells.FromKey("ItemPath").Text + " <b>[" + e.Row.Cells.FromKey("ItemNumber").Text + "]</b>";
                    }
                    else
                    {
                        if (e.Row.Cells.FromKey("ItemNumber").Value != null && e.Row.Cells.FromKey("ItemNumber").Value.ToString().Length > 0)
                        {
                            e.Row.Cells.FromKey("ItemName").Text = e.Row.Cells.FromKey("ItemName").Text + " <b>[" + e.Row.Cells.FromKey("ItemNumber").Text + "]</b>";
                        }
                        else
                        {
                            e.Row.Cells.FromKey("ItemName").Text = e.Row.Cells.FromKey("ItemName").Text;
                        }
                    }
                    NbSKUs++;
                }
            }
            //Code modified for Links Requirement (PR658943) - to allow analyze for higher level Node Names by Prachi on 19th Jan 2013 - end
        }
Example #28
0
    private int UpdateGrade()
    {
        UltraGridRow row;
        int          intTxrUser = gUserInfo.Emp_Ref_ID;
        int          intRtn     = 0;
        int          intRow     = ugrdGradeList.Rows.Count;

        MicroBSC.BSC.Biz.Biz_Bsc_Est_Dept_Grade objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Est_Dept_Grade();

        CheckBox        chkTempGradeYN;
        TemplatedColumn grade_col = (TemplatedColumn)ugrdGradeList.Columns.FromKey("MID_GRADE_YN");

        DropDownList    ddlTempYN;
        TemplatedColumn yn_col = (TemplatedColumn)ugrdGradeList.Columns.FromKey("USE_YN");


        for (int i = 0; i < intRow; i++)
        {
            row = ugrdGradeList.Rows[i];

            string iType           = Convert.ToString(row.Cells.FromKey("ITYPE").Value.ToString());
            int    iEstterm_ref_id = PageUtility.GetIntByValueDropDownList(ddlEstTermInfo);
            int    iEstDeptType    = (row.Cells.FromKey("EST_DEPT_TYPE").Value == null) ? 0 : Convert.ToInt32(row.Cells.FromKey("EST_DEPT_TYPE").Value.ToString());
            int    iGradeRefId     = (row.Cells.FromKey("GRADE_REF_ID").Value == null) ? 0 : Convert.ToInt32(row.Cells.FromKey("GRADE_REF_ID").Value.ToString());
            string iGradeName      = row.Cells.FromKey("GRADE_NAME").ToString();
            double iMinValue       = Convert.ToDouble(row.Cells.FromKey("MIN_VALUE").Value);
            double iMaxValue       = Convert.ToDouble(row.Cells.FromKey("MAX_VALUE").Value);

            chkTempGradeYN = (CheckBox)((CellItem)grade_col.CellItems[ugrdGradeList.Rows[i].BandIndex]).FindControl("chkMidGrade_YN");
            int iSort_order = Convert.ToInt32(row.Cells.FromKey("SORT_ORDER").Value.ToString());
            ddlTempYN = (DropDownList)((CellItem)yn_col.CellItems[ugrdGradeList.Rows[i].BandIndex]).FindControl("ddlUse_YN");
            int iuser = intTxrUser;


            if (iType == "U")
            {
                intRtn += objBSC.UpdateData(iEstterm_ref_id
                                            , iEstDeptType
                                            , iGradeRefId
                                            , iGradeName
                                            , iMinValue
                                            , iMaxValue
                                            , (chkTempGradeYN.Checked == true)? "Y": "N"
                                            , iSort_order
                                            , ddlTempYN.SelectedValue.ToString()
                                            , iuser);
            }
            else if (iType == "A")
            {
                intRtn += objBSC.InsertData(iEstterm_ref_id
                                            , iEstDeptType
                                            , iGradeRefId
                                            , iGradeName
                                            , iMinValue
                                            , iMaxValue
                                            , (chkTempGradeYN.Checked == true) ? "Y" : "N"
                                            , iSort_order
                                            , ddlTempYN.SelectedValue.ToString()
                                            , iuser);
            }
        }

        return(intRtn);
    }
Example #29
0
        private void Save()
        {
            if (dg != null)
            {
                bool            isOk = false;
                TemplatedColumn col  = (TemplatedColumn)dg.Columns.FromKey("Select");

                foreach (UltraGridRow r in dg.Rows)
                {
                    //Code modified for Links Requirement (PR658943) - to create links for the selected Items by Prachi on 20th Jan 2013
                    int      isRelevant    = Convert.ToInt32(r.Cells.FromKey("IsRelevant").Value);
                    int      SameValidLink = Convert.ToInt32(r.Cells.FromKey("SameLink").Value);
                    CheckBox cb            = (CheckBox)((CellItem)col.CellItems[r.Index]).FindControl("g_sd");

                    if (((isRelevant == 1) || (SameValidLink == 2)) && cb.Enabled && cb.Checked)
                    {
                        System.Int64 mainId = -1;
                        System.Int64 subId  = Convert.ToInt64(r.Cells.FromKey("ItemId").Value);
                        if (!bLinkFrom) // for links From -- Adding a Host
                        {
                            mainId = Convert.ToInt64(r.Cells.FromKey("ItemId").Value);
                            //Modified for Links Requirement (PR664364) - to add Host from Companions - Companion should always be SKU Level Item
                            subId = Convert.ToInt64(r.Cells.FromKey("MainItemId").Value);
                        }
                        else // for links To -- Adding a Companion
                        {
                            mainId = itemId;
                            subId  = Convert.ToInt64(r.Cells.FromKey("ItemId").Value);
                        }
                        //prachi 5/5/2016 CR#6914

                        if (string.IsNullOrEmpty(Convert.ToString(dateValue.Value)))
                        {
                            dateValue.Value = DateTime.Now.ToUniversalTime().Date;
                        }
                        //prachi 5/5/2016 CR#6914

                        Link link = new Link(mainId, subId, linkTypeId, SessionState.Culture.CountryCode, -1, SessionState.User.Id, DateTime.UtcNow, Convert.ToDateTime(dateValue.Value).ToUniversalTime().Date);
                        if (!link.Save())
                        {
                            lbError.CssClass = "hc_error";
                            lbError.Text     = Link.LastError;
                            lbError.Visible  = true;

                            isOk = false;
                            return;
                        }
                        else
                        {
                            isOk = true;
                        }
                    }
                }

                if (isOk)
                {
                    lbError.CssClass = "hc_success";
                    lbError.Text     = "Data saved!";
                    lbError.Visible  = true;
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close", "<script>ReloadParent();</script>");
                }
            }
        }
Example #30
0
    protected void ugrdLoadMapList_InitializeRow(object sender, RowEventArgs e)
    {
        TemplatedColumn tmcPL = (TemplatedColumn)e.Row.Band.Columns.FromKey("MONTHLY_PLAN");
        TemplatedColumn tmcDO = (TemplatedColumn)e.Row.Band.Columns.FromKey("DETAILS");
        TemplatedColumn tmcDE = (TemplatedColumn)e.Row.Band.Columns.FromKey("ETC_CONTENTS");

        TextBox txtPL = (TextBox)((CellItem)tmcPL.CellItems[e.Row.BandIndex]).FindControl("txtMONTHLY_PLAN");
        TextBox txtDO = (TextBox)((CellItem)tmcDO.CellItems[e.Row.BandIndex]).FindControl("txtDETAILS");
        TextBox txtDE = (TextBox)((CellItem)tmcDE.CellItems[e.Row.BandIndex]).FindControl("txtETC_CONTENTS");

        txtPL.Text = (e.Row.Cells.FromKey("MONTHLY_PLAN").Value == null)  ? "" : Convert.ToString(e.Row.Cells.FromKey("MONTHLY_PLAN").Value.ToString());
        txtDO.Text = (e.Row.Cells.FromKey("DETAILS").Value == null)       ? "" : Convert.ToString(e.Row.Cells.FromKey("DETAILS").Value.ToString());
        txtDE.Text = (e.Row.Cells.FromKey("ETC_CONTENTS").Value == null)  ? "" : Convert.ToString(e.Row.Cells.FromKey("ETC_CONTENTS").Value.ToString());

        txtPL.Font.Size = FontUnit.Medium;
        txtDO.Font.Size = FontUnit.Medium;
        txtDE.Font.Size = FontUnit.Medium;

        txtPL.Font.Name = "HY울릉도M";
        txtDO.Font.Name = "HY울릉도M";
        txtDE.Font.Name = "HY울릉도M";

        txtPL.Style.Add("overflow", "auto");
        txtDO.Style.Add("overflow", "auto");
        txtDE.Style.Add("overflow", "auto");

        txtPL.Style.Add("padding-left", "10px");
        txtDO.Style.Add("padding-left", "10px");

        txtPL.Style.Add("padding-top", "5px");
        txtDO.Style.Add("padding-top", "5px");

        int intYmd = (e.Row.Cells.FromKey("YMD").Value == null)  ? 0 : Convert.ToInt32(e.Row.Cells.FromKey("YMD").Value.ToString());

        if ((intYmd % 2) == 1)
        {
            e.Row.Style.BackColor = ColorTranslator.FromHtml("#EDF0F5");
            txtPL.Style.Add("background-color", "#EDF0F5");
            txtDO.Style.Add("background-color", "#EDF0F5");
        }
        else
        {
            e.Row.Style.BackColor = ColorTranslator.FromHtml("#DCE1E5");
            txtPL.Style.Add("background-color", "#DCE1E5");
            txtDO.Style.Add("background-color", "#DCE1E5");
        }


        if (intYmd < Convert.ToInt32(this.IYmd) - 1)
        {
            e.Row.Hidden = true;
        }
        else if (intYmd == Convert.ToInt32(this.IYmd) + 1)
        {
            //e.Row.Style.BackColor = ColorTranslator.FromHtml("#EDF0F5");
            //txtPL.Style.Add("background-color", "#EDF0F5");
            //txtDO.Style.Add("background-color", "#EDF0F5");
            e.Row.Style.BackColor = ColorTranslator.FromHtml("#9DC1CD");
            //txtPL.ForeColor = Color.Navy;
            //txtDO.ForeColor = Color.Navy;
            e.Row.Activate();
        }

        //string strCheck = e.Row.Cells.FromKey("CLOSE_YN").Value.ToString();
        //if (strCheck == "Y")
        //{
        //    txtPL.ReadOnly = true;
        //    txtDO.ReadOnly = true;
        //    txtDE.ReadOnly = true;

        //    txtPL.BackColor = Color.WhiteSmoke;
        //    txtDO.BackColor = Color.WhiteSmoke;
        //    txtDE.BackColor = Color.WhiteSmoke;
        //}
        //else
        //{
        //    txtPL.ReadOnly = (this.IsOpenTerm=="Y") ? false : true;
        //    txtDO.ReadOnly = false;
        //    txtDE.ReadOnly = false;

        //    txtPL.BackColor = (this.IsOpenTerm=="Y") ? Color.White : Color.WhiteSmoke;
        //    txtDO.BackColor = Color.White;
        //    txtDE.BackColor = Color.White;
        //}
    }