Example #1
0
    protected void lbnSavePOS_Click(object sender, EventArgs e)
    {
        Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails();
        Biz_DeptInfos      deptInfo      = new Biz_DeptInfos();
        DataTable          dataTable     = deptPosDetail.GetDataTableSchema();
        DataTable          dtDept        = deptInfo.GetDataTableSchema();
        DataRow            drRow         = null;

        string[] dept_values = hdfDeptID.Value.Split(',');

        dataTable = UltraGridUtility.GetDataTableByAllValue(UltraWebGrid3
                                                            , new string[] { "SEQ", "POS_ID", "POS_VALUE", "WEIGHT" }
                                                            , dataTable);

        foreach (string dept_value in dept_values)
        {
            drRow = dtDept.NewRow();
            drRow["DEPT_REF_ID"] = DataTypeUtility.GetToInt32(dept_value);
            dtDept.Rows.Add(drRow);
        }

        if (dataTable.Rows.Count == 0)
        {
            ltrScript.Text = JSHelper.GetAlertScript("적용하려는 부서별 가중치가 없습니다.");
            return;
        }

        foreach (DataRow dataRow in dataTable.Rows)
        {
            dataRow["COMP_ID"]        = COMP_ID;
            dataRow["EST_ID"]         = EST_ID;
            dataRow["ESTTERM_REF_ID"] = ESTTERM_REF_ID;
            dataRow["DATE"]           = DateTime.Now;
            dataRow["USER"]           = EMP_REF_ID;
        }

        bool isOK = deptPosDetail.SaveDeptPosDetailAll(dtDept, dataTable);

        if (isOK)
        {
            ltrScript.Text = JSHelper.GetAlertScript("선택 부서의 가중치를 일괄 적용하였습니다.");

            GridBinding22(COMP_ID, ESTTERM_REF_ID, EST_ID);
            UltraWebGrid3.Clear();
            hdfDeptID.Value = "";
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리 않았습니다.");
        }
    }
Example #2
0
    protected void ibnInit2_Click(object sender, ImageClickEventArgs e)
    {
        Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails();
        Biz_DeptInfos      deptInfo      = new Biz_DeptInfos();
        DataTable          dataTable     = deptPosDetail.GetDataTableSchema();
        DataTable          dtDept        = deptInfo.GetDataTableSchema();

        dtDept.Columns.Add("COMP_ID", typeof(int));
        dtDept.Columns.Add("EST_ID", typeof(string));
        dtDept.Columns.Add("ESTTERM_REF_ID", typeof(int));

        dtDept = UltraGridUtility.GetDataTableByCheckValue(UltraWebGrid2
                                                           , "cBox"
                                                           , "selchk"
                                                           , new string[] { "DEPT_REF_ID" }
                                                           , dtDept);

        if (dtDept.Rows.Count == 0)
        {
            ltrScript.Text = JSHelper.GetAlertScript("초기화하려는 부서를 선택하세요.");
            return;
        }

        foreach (DataRow dataRow in dtDept.Rows)
        {
            dataRow["COMP_ID"]        = COMP_ID;
            dataRow["EST_ID"]         = EST_ID;
            dataRow["ESTTERM_REF_ID"] = ESTTERM_REF_ID;
        }

        bool isOK = deptPosDetail.InitDept(dtDept);

        if (isOK)
        {
            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 선택부서를 초기화 하였습니다.");

            GridBinding22(COMP_ID, ESTTERM_REF_ID, EST_ID);
            UltraWebGrid3.Clear();
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리 않았습니다.");
        }
    }
Example #3
0
    protected void ibnSavePosAll_Click(object sender, ImageClickEventArgs e)
    {
        Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails();
        Biz_DeptInfos      deptInfo      = new Biz_DeptInfos();
        DataTable          dataTable     = deptPosDetail.GetDataTableSchema();
        DataTable          dtDept        = deptInfo.GetDataTableSchema();

        dataTable = UltraGridUtility.GetDataTableByAllValue(UltraWebGrid3
                                                            , new string[] { "SEQ", "POS_ID", "POS_VALUE", "WEIGHT" }
                                                            , dataTable);

        dtDept = UltraGridUtility.GetDataTableByAllValue(UltraWebGrid2
                                                         , new string[] { "DEPT_REF_ID" }
                                                         , dtDept);

        if (dataTable.Rows.Count == 0)
        {
            ltrScript.Text = JSHelper.GetAlertScript("적용하려는 부서별 가중치가 없습니다.");
            return;
        }

        foreach (DataRow dataRow in dataTable.Rows)
        {
            dataRow["COMP_ID"]        = COMP_ID;
            dataRow["EST_ID"]         = EST_ID;
            dataRow["ESTTERM_REF_ID"] = ESTTERM_REF_ID;
            dataRow["DATE"]           = DateTime.Now;
            dataRow["USER"]           = EMP_REF_ID;
        }

        bool isOK = deptPosDetail.SaveDeptPosDetailAll(dtDept, dataTable);

        if (isOK)
        {
            ltrScript.Text = JSHelper.GetAlertScript("모든 부서의 가중치를 일괄 적용하였습니다.");

            GridBinding22(COMP_ID, ESTTERM_REF_ID, EST_ID);
            UltraWebGrid3.Clear();
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리 않았습니다.");
        }
    }
Example #4
0
    protected void ibnRemove_Click(object sender, ImageClickEventArgs e)
    {
        Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails();
        DataTable          dataTable     = deptPosDetail.GetDataTableSchema();

        dataTable = UltraGridUtility.GetDataTableByCheckValue(UltraWebGrid3
                                                              , "cBox"
                                                              , "selchk"
                                                              , new string[] { "DEPT_REF_ID", "SEQ" }
                                                              , dataTable);

        if (dataTable.Rows.Count == 0)
        {
            ltrScript.Text = JSHelper.GetAlertScript("삭제하려는 항목을 선택하세요.");
            return;
        }

        foreach (DataRow dataRow in dataTable.Rows)
        {
            dataRow["COMP_ID"]        = COMP_ID;
            dataRow["EST_ID"]         = EST_ID;
            dataRow["ESTTERM_REF_ID"] = ESTTERM_REF_ID;
        }

        bool isOK = deptPosDetail.RemoveDeptPosDetail(dataTable);

        if (isOK)
        {
            GridBinding3(COMP_ID, ESTTERM_REF_ID, DataTypeUtility.GetToInt32(hdfEstPosEstDeptRefID.Value), EST_ID);
            ClearControlValues();
            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리되었습니다.");
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리되지 않았습니다.");
        }
    }