Exemplo n.º 1
0
    protected void ibnSave_Click(object sender, ImageClickEventArgs e)
    {
        Biz_Scopes scopes   = new Biz_Scopes();
        DataTable  dtInsert = scopes.GetSchema();
        DataRow    drNew    = null;

        foreach (UltraGridRow ugRow in UltraWebGrid1.Rows)
        {
            if (CheckRow(ugRow) == false)
            {
                ltrScript.Text = JSHelper.GetAlertScript("입력되지 않았습니다. 값을 입력해주세요.", false);
                break;
            }

            //TemplatedColumn tcol_ScaleId	    = (TemplatedColumn)ugRow.Band.Columns.FromKey( "DDLSCALE_ID" );
            //DropDownList ddl_ScaleId		    = (DropDownList)( (CellItem)tcol_ScaleId.CellItems[ugRow.BandIndex] ).FindControl( "ddlScaleId" );

            TemplatedColumn tcol_StartScope = (TemplatedColumn)ugRow.Band.Columns.FromKey("TXTSTART_SCOPE");
            TextBox         txtStartScope   = (TextBox)((CellItem)tcol_StartScope.CellItems[ugRow.BandIndex]).FindControl("txtStartScope");

            TemplatedColumn tcol_EndScope = (TemplatedColumn)ugRow.Band.Columns.FromKey("TXTEND_SCOPE");
            TextBox         txtEndScope   = (TextBox)((CellItem)tcol_EndScope.CellItems[ugRow.BandIndex]).FindControl("txtEndScope");

            //TemplatedColumn tcol_ScopeUnitId	= (TemplatedColumn)ugRow.Band.Columns.FromKey( "DDLSCOPE_UNIT_ID" );
            //DropDownList ddl_ScopeUnitId		= (DropDownList)( (CellItem)tcol_ScopeUnitId.CellItems[ugRow.BandIndex] ).FindControl( "ddlScopeUnitId" );

            TemplatedColumn tcol_GradeToPoint = (TemplatedColumn)ugRow.Band.Columns.FromKey("TXTGRADE_TO_POINT");
            TextBox         txtGradeToPoint   = (TextBox)((CellItem)tcol_GradeToPoint.CellItems[ugRow.BandIndex]).FindControl("txtGradeToPoint");

            drNew                   = dtInsert.NewRow();
            drNew["COMP_ID"]        = COMP_ID;
            drNew["EST_ID"]         = EST_ID;
            drNew["GRADE_ID"]       = ugRow.Cells.FromKey("GRADE_ID").Value;
            drNew["SCALE_ID"]       = SCALE_ID;
            drNew["START_SCOPE"]    = DataTypeUtility.GetToDouble(txtStartScope.Text.Trim());
            drNew["END_SCOPE"]      = DataTypeUtility.GetToDouble(txtEndScope.Text.Trim());
            drNew["SCOPE_UNIT_ID"]  = new Biz_ScopeUnits().GetScopeUnitIDByScaleID(SCALE_ID);
            drNew["GRADE_TO_POINT"] = DataTypeUtility.GetToDouble(txtGradeToPoint.Text.Trim());

            dtInsert.Rows.Add(drNew);
        }

        bool isOK = scopes.AddScope(dtInsert
                                    , DateTime.Now
                                    , EMP_REF_ID);

        if (isOK)
        {
            BindGrid(COMP_ID, EST_ID, SCALE_ID);
            //ButtonStatusInit();
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("항목이 입력되지 않았습니다. 각 항목을 입력해주세요.");
            return;
        }
    }
Exemplo n.º 2
0
    public static void BindEstScopeUnit(DropDownList ddl)
    {
        Biz_ScopeUnits scopeUnit = new Biz_ScopeUnits();
        DataSet        ds        = scopeUnit.GetScopeUnit();

        ddl.DataTextField  = "SCOPE_UNIT_NAME";
        ddl.DataValueField = "SCOPE_UNIT_ID";
        ddl.DataSource     = ds;
        ddl.DataBind();
    }