Пример #1
0
    protected void ibnPMS_IF_Click(object sender, EventArgs e)
    {
        int  Pms_Com_Info_Idx = 1;
        bool Result;

        object start_date = prj_sDate.Value;
        object end_date   = prj_eDate.Value;


        DataTable dtPrj_ID = bizPmsInfo.Get_Vw_ProjectID((DateTime)start_date, (DateTime)end_date);

        dtPrj_ID = DataTypeUtility.FilterSortDataTable(dtPrj_ID, " STATUS_ID IS NULL");


        Result = bizPmsColInfo.Sync_Col_Info(Pms_Com_Info_Idx, dtPrj_ID, gUserInfo.Emp_Ref_ID.ToString());
        if (Result)
        {
            /*
             * for (int i = 0; i < dtPrj_ID.Rows.Count; i++)
             * {
             *  string prj_id = dtPrj_ID.Rows[i]["PROJECTID"].ToString();
             *
             *  DataTable dtColList = bizPmsColInfo.Get_Col_Info_List(prj_id);
             *  System.Text.StringBuilder colList = new StringBuilder();
             *  for (int j = 0; j < dtColList.Rows.Count; j++)
             *  {
             *      if (colList.Length > 0)
             *          colList.Append(", ");
             *      colList.Append(dtColList.Rows[j]["PRJ_COL_ID"].ToString());
             *  }
             *  Result = bizPmsInfo.Add_Project_Info_To_Pms((DateTime)start_date, (DateTime)end_date, prj_id, colList.ToString());
             *
             *  if (!Result)
             *      break;
             * }
             */


            DataTable dtComInfo    = bizPmsComInfo.Get_Pms_Com_Info(Pms_Com_Info_Idx);
            string    srcIF_COL_ID = dtComInfo.Rows[0]["IF_COL_ID"].ToString();
            string    tgtIF_COL_ID = "";
            string    tmpIF_COL_ID;
            string[]  arrIF_COL_ID = bizPmsColInfo.Remove_Escape_Blank_Char(srcIF_COL_ID).Split(',');
            for (int i = 0; i < arrIF_COL_ID.Length; i++)
            {
                string col_type = bizPmsColInfo.Proc_Col_Type(arrIF_COL_ID[i]);
                if (col_type.Equals("B"))
                {
                    tmpIF_COL_ID = arrIF_COL_ID[i];
                }
                else
                {
                    tmpIF_COL_ID = arrIF_COL_ID[i].Substring(0, arrIF_COL_ID[i].IndexOf("("));
                }

                if (tgtIF_COL_ID.Length > 0)
                {
                    tgtIF_COL_ID += ", ";
                }
                tgtIF_COL_ID += tmpIF_COL_ID;
            }

            string prj_id_list = "";
            for (int i = 0; i < dtPrj_ID.Rows.Count; i++)
            {
                if (prj_id_list.Length > 0)
                {
                    prj_id_list += ", ";
                }
                prj_id_list += "'" + dtPrj_ID.Rows[i]["PROJECTID"].ToString() + "'";
            }
            Result = bizPmsInfo.Add_Project_Info_To_Pms((DateTime)start_date, (DateTime)end_date, prj_id_list, tgtIF_COL_ID);
        }



        if (Result)
        {
            this.ltrScript.Text = JSHelper.GetAlertScript("저장되었습니다.");
        }
        else
        {
            this.ltrScript.Text = JSHelper.GetAlertScript("저장에 실패하였습니다.");
        }


        UltraWebGrid1.Clear();
        UltraWebGrid2.Clear();
        UltraWebGrid2.Bands[0].ResetColumns();
        UltraWebGrid3.Clear();

        this.TxtBox_Soosik.Text = "";

        Project_Bind();
    }