private List <MAS_PROJECTITEMBIDDING> GetListItemProject()
        {
            List <MAS_PROJECTITEMBIDDING> lRet = new List <MAS_PROJECTITEMBIDDING>();

            try
            {
                Mas_ProjectITemBidding_Manage piManage = new Mas_ProjectITemBidding_Manage();
                MAS_PROJECTITEMBIDDING        para     = new MAS_PROJECTITEMBIDDING();
                para.ProjectNo = _projectNo;
                lRet           = piManage.ListMasProjItemBiddingByPNo(para);
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
            }

            return(lRet);
        }
        private void BindItemProject(string TemplateNo)
        {
            try
            {
                /******************* Get Column Item Project Name ********/
                MAS_TEMPLATECOLNAME value            = new MAS_TEMPLATECOLNAME();
                Int64 pkItemCol                      = Int64.Parse(TemplateNo);
                Mas_TemplateColName_Manage manageCol = new Mas_TemplateColName_Manage();
                MAS_TEMPLATECOLNAME        para      = new MAS_TEMPLATECOLNAME();
                para.TemplateNo = pkItemCol;
                value           = manageCol.GetMasTemplateColNameByKey(para);
                /*******************************************************/

                /*************** Gen Table & Gridview Column **********/
                DataTable dtColumnName = new DataTable();
                dtColumnName = CreateTableItemColumn(value);
                /******************************************************/

                /*************** List Item Project ********************************/
                Mas_ProjectITemBidding_Manage projItemBL = new Mas_ProjectITemBidding_Manage();
                List <MAS_PROJECTITEMBIDDING> lItemProj  = new List <MAS_PROJECTITEMBIDDING>();
                MAS_PROJECTITEMBIDDING        sData      = new MAS_PROJECTITEMBIDDING();
                sData.ProjectNo = hdfProjectNo.Value.ToString().Trim();
                lItemProj       = projItemBL.ListMasProjItemBiddingByPNo(sData);
                /*****************************************************************/

                DataRow row;
                foreach (MAS_PROJECTITEMBIDDING item in lItemProj)
                {
                    row = dtColumnName.NewRow();

                    row["ProjectItemNo"] = item.ProjectItemNo;
                    row["ProjectNo"]     = item.ProjectNo;

                    if (row.Table.Columns["ItemColumn1"] != null)
                    {
                        row["ItemColumn1"] = item.ItemColumn1;
                    }
                    if (row.Table.Columns["ItemColumn2"] != null)
                    {
                        row["ItemColumn2"] = item.ItemColumn2;
                    }
                    if (row.Table.Columns["ItemColumn3"] != null)
                    {
                        row["ItemColumn3"] = item.ItemColumn3;
                    }
                    if (row.Table.Columns["ItemColumn4"] != null)
                    {
                        row["ItemColumn4"] = item.ItemColumn4;
                    }
                    if (row.Table.Columns["ItemColumn5"] != null)
                    {
                        row["ItemColumn5"] = item.ItemColumn5;
                    }
                    if (row.Table.Columns["ItemColumn6"] != null)
                    {
                        row["ItemColumn6"] = item.ItemColumn6;
                    }
                    if (row.Table.Columns["ItemColumn7"] != null)
                    {
                        row["ItemColumn7"] = item.ItemColumn7;
                    }
                    if (row.Table.Columns["ItemColumn8"] != null)
                    {
                        row["ItemColumn8"] = item.ItemColumn8;
                    }

                    dtColumnName.Rows.Add(row);
                }

                /************ Set Empty Row ************/
                if (dtColumnName.Rows.Count == 0)
                {
                    dtColumnName = SetEmptyRows(dtColumnName);
                }
                /***************************************/

                gvItem.DataSource = dtColumnName;
                gvItem.DataBind();
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
            }
        }