コード例 #1
0
        public EquipmentRepairEntity(System.Data.DataTableReader dr)
        {
            this.pk_RepairID       = Convert.ToInt32(dr["pk_RepairID"]);
            this.ContainerNo       = Convert.ToString(dr["ContainerNo"]);
            this.Location          = Convert.ToString(dr["Location"]);
            this.Damaged           = Convert.ToBoolean(dr["Damaged"]);
            this.EstimateReference = Convert.ToString(dr["EstimateReference"]);
            this.fk_UserApproved   = Convert.ToInt32(dr["fk_UserApproved"]);

            this.Line            = Convert.ToString(dr["Line"]);
            this.RepMaterialAppr = Convert.ToDecimal(dr["MaterialAppr"]);
            this.RepMaterialEst  = Convert.ToDecimal(dr["MaterialEst"]);
            this.RepLabourEst    = Convert.ToDecimal(dr["LabourEst"]);
            this.onHold          = Convert.ToBoolean(dr["onHold"]);
            this.RealeasedOn     = DBNull.ReferenceEquals(dr["RealeasedOn"], DBNull.Value)? (Nullable <DateTime>)null:  Convert.ToDateTime(dr["RealeasedOn"]);
            this.NVOCCId         = Convert.ToInt32(dr["NVOCCID"]);
            this.Reason          = Convert.ToString(dr["Reason"]);
            this.RepLabourAppr   = Convert.ToDecimal(dr["RepLabourAppr"]);
            this.RepLabourBilled = Convert.ToDecimal(dr["RepLabourBilled"]);

            this.RepMaterialBilled = Convert.ToDecimal(dr["RepMaterialBilled"]);

            this.StockReturnDate = DBNull.ReferenceEquals(dr["StockReturnDate"], DBNull.Value) ? (Nullable <DateTime>)null : Convert.ToDateTime(dr["StockReturnDate"]);
            this.TransactionDate = DBNull.ReferenceEquals(dr["TransactionDate"], DBNull.Value) ? (Nullable <DateTime>)null : Convert.ToDateTime(dr["TransactionDate"]);
        }
コード例 #2
0
 /// <summary>檢查DataColumn是否是空值(預設 DBNull.Value 回傳 = "")</summary>
 /// <param name="pDr">資料列</param>
 /// <param name="columnName">DataColumn名稱</param>
 ///  /// <param name="returnStr">預設(DBNull.Value 回傳 = "")</param>
 /// <returns>string</returns>
 public string checkDataColumn(DataRow pDr, string columnName, string returnStr = "")
 {
     if (!DBNull.ReferenceEquals(pDr[columnName], DBNull.Value))
     {
         string columnStr = pDr[columnName].ToString().Trim();
         if (columnStr != "")
         {
             returnStr = columnStr;
         }
     }
     return(returnStr);
 }
コード例 #3
0
        ///<summary>收案清單比對 </summary>
        /// <param name="pIpd_nos"></param>
        /// <returns></returns>
        public List <string> CheckInCase(List <string> pIpd_nos)
        {
            List <string> InCaseList  = new List <string>();
            string        sqlstatment = string.Format("select ipd_no from " + GetTableName.RCS_RT_CASE + " where ipd_no in ('{0}') and accept_status = '1'", string.Join("','", pIpd_nos));
            DataTable     dt          = this.DBA.getSqlDataTable(sqlstatment);

            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (!DBNull.ReferenceEquals(dr["ipd_no"], DBNull.Value))
                    {
                        InCaseList.Add(dr["ipd_no"].ToString());
                    }
                }
            }
            return(InCaseList);
        }