Exemplo n.º 1
0
    private void UpdateViewData()
    {
        #region 기본정보 저장

        Biz_Prj_Info     objPrj      = new Biz_Prj_Info();
        Biz_Prj_Resource objResource = new Biz_Prj_Resource();
        Biz_Prj_Share    objPrjShare = new Biz_Prj_Share();

        objPrj.IPrj_Ref_Id         = this.IPrjRefID;
        objPrj.IPrj_Code           = txtPRJ_CODE.Text.Trim();
        objPrj.IPrj_Name           = txtPRJ_NAME.Text.Trim();
        objPrj.IDefinition         = txtDEFINITION.Text.Trim();
        objPrj.IRef_Stg            = txtREF_STG.Text.Trim();
        objPrj.IEffectiveness      = txtEFFECTIVENESS.Text.Trim();
        objPrj.IRange              = txtRANGE.Text.Trim();
        objPrj.IOwner_Dept_Id      = WebUtility.GetIntByValueDropDownList(ddlOwnerDeptID);
        objPrj.IOwner_Emp_Id       = DataTypeUtility.GetToInt32(hdfOWNER_EMP_ID.Value);
        objPrj.IRequest_Dept       = txtREQUEST_DEPT.Text.Trim();
        objPrj.IPriority           = WebUtility.GetByValueDropDownList(ddlPRIORITY);
        objPrj.ITotal_Budget       = DataTypeUtility.GetToDecimal(txtTotalBudget.Text);
        objPrj.IPrj_Type           = WebUtility.GetByValueDropDownList(ddlPrjType);
        objPrj.IInterested_Parties = txtINTERESTED_PARTIES.Text.Trim();
        objPrj.IPlan_Start_Date    = wdcPlanStartDate.Value;
        objPrj.IPlan_End_Date      = wdcPlanEndDate.Value;
        objPrj.IActual_Start_Date  = wdcActualStartDate.Value;
        objPrj.IActual_End_Date    = wdcActualEndDate.Value;

        int intRtn = objPrj.UpdateData(objPrj.IPrj_Ref_Id
                                       , objPrj.IPrj_Code
                                       , objPrj.IPrj_Name
                                       , 0
                                       , objPrj.IDefinition
                                       , objPrj.IRef_Stg
                                       , objPrj.IEffectiveness
                                       , objPrj.IRange
                                       , objPrj.IOwner_Dept_Id
                                       , objPrj.IOwner_Emp_Id
                                       , objPrj.IRequest_Dept
                                       , objPrj.IPriority
                                       , objPrj.ITotal_Budget
                                       , objPrj.IPrj_Type
                                       , objPrj.IInterested_Parties
                                       , objPrj.IPlan_Start_Date
                                       , objPrj.IPlan_End_Date
                                       , objPrj.IActual_Start_Date
                                       , objPrj.IActual_End_Date
                                       , gUserInfo.Emp_Ref_ID
                                       );

        //사업정보공유정보저장

        foreach (UltraGridRow row in ugrdProjectShareList.Rows)
        {
            objPrjShare.IPrj_Ref_Id = this.IPrjRefID;
            objPrjShare.IEmp_Ref_Id = DataTypeUtility.GetToInt32(row.Cells.FromKey("EMP_REF_ID").Value);

            if (row.Cells.FromKey("ITYPE").Value.ToString() == "A")
            {
                intRtn += objPrjShare.InsertData(objPrjShare.IPrj_Ref_Id
                                                 , objPrjShare.IEmp_Ref_Id
                                                 , gUserInfo.Emp_Ref_ID);
            }
            else if (row.Cells.FromKey("ITYPE").Value.ToString() == "D")
            {
                intRtn += objPrjShare.DeleteData(objPrjShare.IPrj_Ref_Id
                                                 , objPrjShare.IEmp_Ref_Id
                                                 , gUserInfo.Emp_Ref_ID);
            }
        }

        //사업수행구성원저장

        foreach (UltraGridRow row in ugrdResourceList.Rows)
        {
            objResource.IPrj_Ref_Id = this.IPrjRefID;
            objResource.IEmp_Ref_Id = DataTypeUtility.GetToInt32(row.Cells.FromKey("EMP_REF_ID").Value);
            objResource.IRole_Type  = DataTypeUtility.GetValue(row.Cells.FromKey("ROLE_TYPE").Value);
            objResource.INote       = DataTypeUtility.GetValue(row.Cells.FromKey("NOTE").Value);
            objResource.IIsdelete   = DataTypeUtility.GetValue(row.Cells.FromKey("ISDELETE").Value);

            if (row.Cells.FromKey("ITYPE").Value.ToString() == "A")
            {
                intRtn += objResource.InsertData(objResource.IPrj_Ref_Id
                                                 , objResource.IEmp_Ref_Id
                                                 , objResource.IRole_Type
                                                 , objResource.INote
                                                 , objResource.IIsdelete
                                                 , gUserInfo.Emp_Ref_ID);
            }
            else if (row.Cells.FromKey("ITYPE").Value.ToString() == "U")
            {
                intRtn += objResource.UpdateData(objResource.IPrj_Ref_Id
                                                 , objResource.IEmp_Ref_Id
                                                 , objResource.IRole_Type
                                                 , objResource.INote
                                                 , objResource.IIsdelete
                                                 , gUserInfo.Emp_Ref_ID);
            }
            else if (row.Cells.FromKey("ITYPE").Value.ToString() == "D")
            {
                intRtn += objResource.DeleteData(objResource.IPrj_Ref_Id
                                                 , objResource.IEmp_Ref_Id
                                                 , gUserInfo.Emp_Ref_ID);
            }
        }

        #endregion

        if (intRtn > 0)
        {
            ltrScript.Text = JSHelper.GetAlertScript("사업정보가 저장되었습니다.");
            this.IType     = "U";
            this.SetFormData();
            this.SetButton();
        }
    }
Exemplo n.º 2
0
    private void InsertViewData()
    {
        if (this.CheckFormData())
        {
            ltrScript.Text = JSHelper.GetAlertScript("사업아이디 또는 사업명이 동일한 값이 존재합니다.");
            return;
        }


        #region 기본정보 저장

        Biz_Prj_Info     objPrj      = new Biz_Prj_Info();
        Biz_Prj_Resource objResource = new Biz_Prj_Resource();
        Biz_Prj_Share    objPrjShare = new Biz_Prj_Share();


        objPrj.IPrj_Code           = txtPRJ_CODE.Text.Trim();
        objPrj.IPrj_Name           = txtPRJ_NAME.Text.Trim();
        objPrj.IDefinition         = txtDEFINITION.Text.Trim();
        objPrj.IRef_Stg            = txtREF_STG.Text.Trim();
        objPrj.IEffectiveness      = txtEFFECTIVENESS.Text.Trim();
        objPrj.IRange              = txtRANGE.Text.Trim();
        objPrj.IOwner_Dept_Id      = WebUtility.GetIntByValueDropDownList(ddlOwnerDeptID);
        objPrj.IOwner_Emp_Id       = DataTypeUtility.GetToInt32(hdfOWNER_EMP_ID.Value);
        objPrj.IRequest_Dept       = txtREQUEST_DEPT.Text.Trim();
        objPrj.IPriority           = WebUtility.GetByValueDropDownList(ddlPRIORITY);
        objPrj.ITotal_Budget       = DataTypeUtility.GetToDecimal(txtTotalBudget.Text);
        objPrj.IPrj_Type           = WebUtility.GetByValueDropDownList(ddlPrjType);
        objPrj.IInterested_Parties = txtINTERESTED_PARTIES.Text.Trim();
        objPrj.IPlan_Start_Date    = wdcPlanStartDate.Value;
        objPrj.IPlan_End_Date      = wdcPlanEndDate.Value;
        objPrj.IActual_Start_Date  = wdcActualStartDate.Value;
        objPrj.IActual_End_Date    = wdcActualEndDate.Value;

        int intRtn = objPrj.InsertData(objPrj.IPrj_Code
                                       , objPrj.IPrj_Name
                                       , 0
                                       , objPrj.IDefinition
                                       , objPrj.IRef_Stg
                                       , objPrj.IEffectiveness
                                       , objPrj.IRange
                                       , objPrj.IOwner_Dept_Id
                                       , objPrj.IOwner_Emp_Id
                                       , objPrj.IRequest_Dept
                                       , objPrj.IPriority
                                       , objPrj.ITotal_Budget
                                       , objPrj.IPrj_Type
                                       , objPrj.IInterested_Parties
                                       , objPrj.IPlan_Start_Date
                                       , objPrj.IPlan_End_Date
                                       , objPrj.IActual_Start_Date
                                       , objPrj.IActual_End_Date
                                       , gUserInfo.Emp_Ref_ID
                                       );


        this.IPrjRefID = objPrj.IPrj_Ref_Id;

        //사업정보공유정보저장

        foreach (UltraGridRow row in ugrdProjectShareList.Rows)
        {
            objPrjShare.IPrj_Ref_Id = this.IPrjRefID;
            objPrjShare.IEmp_Ref_Id = DataTypeUtility.GetToInt32(row.Cells.FromKey("EMP_REF_ID").Value);

            if (row.Cells.FromKey("ITYPE").Value.ToString() == "A")
            {
                intRtn += objPrjShare.InsertData(objPrjShare.IPrj_Ref_Id
                                                 , objPrjShare.IEmp_Ref_Id
                                                 , gUserInfo.Emp_Ref_ID);
            }
            else if (row.Cells.FromKey("ITYPE").Value.ToString() == "D")
            {
                intRtn += objPrjShare.DeleteData(objPrjShare.IPrj_Ref_Id
                                                 , objPrjShare.IEmp_Ref_Id
                                                 , gUserInfo.Emp_Ref_ID);
            }
        }


        //사업수행구성원저장

        foreach (UltraGridRow row in ugrdResourceList.Rows)
        {
            objResource.IPrj_Ref_Id = this.IPrjRefID;
            objResource.IEmp_Ref_Id = DataTypeUtility.GetToInt32(row.Cells.FromKey("EMP_REF_ID").Value);
            objResource.IRole_Type  = DataTypeUtility.GetValue(row.Cells.FromKey("ROLE_TYPE").Value);
            objResource.INote       = DataTypeUtility.GetValue(row.Cells.FromKey("NOTE").Value);
            objResource.IIsdelete   = DataTypeUtility.GetValue(row.Cells.FromKey("ISDELETE").Value);

            if (row.Cells.FromKey("ITYPE").Value.ToString() == "A")
            {
                intRtn += objResource.InsertData(objResource.IPrj_Ref_Id
                                                 , objResource.IEmp_Ref_Id
                                                 , objResource.IRole_Type
                                                 , objResource.INote
                                                 , objResource.IIsdelete
                                                 , gUserInfo.Emp_Ref_ID);
            }
            else if (row.Cells.FromKey("ITYPE").Value.ToString() == "U")
            {
                intRtn += objResource.UpdateData(objResource.IPrj_Ref_Id
                                                 , objResource.IEmp_Ref_Id
                                                 , objResource.IRole_Type
                                                 , objResource.INote
                                                 , objResource.IIsdelete
                                                 , gUserInfo.Emp_Ref_ID);
            }
            else if (row.Cells.FromKey("ITYPE").Value.ToString() == "D")
            {
                intRtn += objResource.DeleteData(objResource.IPrj_Ref_Id
                                                 , objResource.IEmp_Ref_Id
                                                 , gUserInfo.Emp_Ref_ID);
            }
        }

        #endregion

        #region 일정관리
        //Biz_Prj_Schedule objSchedule = new Biz_Prj_Schedule();

        //objSchedule.IPrj_Ref_Id = this.IPrjRefID;
        //objSchedule.IUp_Task_Ref_Id = 0;

        //intRtn += objSchedule.InsertData(objSchedule.IPrj_Ref_Id
        //                        , 0
        //                        , this.txtPRJ_NAME.Text.Trim()
        //                        , "PAS"
        //                        , 0
        //                        , objSchedule.IUp_Task_Ref_Id
        //                        , "1.0"
        //                        , this.wdcPlanStartDate.Value
        //                        , this.wdcPlanEndDate.Value
        //                        , null
        //                        , null
        //                        , 0
        //                        , ""
        //                        , "N"
        //                        , "N"
        //                        , 0
        //                        , -1
        //                        , ""
        //                        , gUserInfo.Emp_Ref_ID);



        MicroBSC.Integration.PRJ.Biz.Biz_Prj_Schedule bizPrjSchedule = new MicroBSC.Integration.PRJ.Biz.Biz_Prj_Schedule();

        intRtn += bizPrjSchedule.AddData(this.IPrjRefID
                                         , 0
                                         , this.txtPRJ_NAME.Text.Trim()
                                         , "PAS"
                                         , 0
                                         , "1.0"
                                         , 0
                                         , this.wdcPlanStartDate.Value
                                         , this.wdcPlanEndDate.Value
                                         , null
                                         , null
                                         , 0
                                         , ""
                                         , "N"
                                         , "N"
                                         , 0
                                         , -1
                                         , ""
                                         , gUserInfo.Emp_Ref_ID);

        #endregion

        if (intRtn > 0)
        {
            string url = "./PRJ0101M1.aspx?iType=U&PRJ_REF_ID=" + this.IPrjRefID + "&CCB1=" + ICCB1;
            ltrScript.Text = string.Format("<script language=javascript>parent.location.replace('" + url + "'); </script>");
        }
    }