private void BindCrtl(Detail_CAW_DAILYXCTZ CDGI)
 {
     this.dtxtdate.Text = CDGI.XCDATE == DateTime.MinValue ? string.Empty : CDGI.XCDATE.ToShortDateString();
     this.ddlXCTYPE.SelectedValue = CDGI.XCTYPE.ToString();
     this.ntxtXCTime0.Text = CDGI.XCTIME0 == 0 ? string.Empty : CDGI.XCTIME0.ToString();
     this.ntxtXCTime1.Text = CDGI.XCTIME1 == 0 ? string.Empty : CDGI.XCTIME1.ToString();
     this.ntxtXCTime2.Text = CDGI.XCTIME2 == 0 ? string.Empty : CDGI.XCTIME2.ToString();
     this.ntxtXCTime3.Text = CDGI.XCTIME3 == 0 ? string.Empty : CDGI.XCTIME3.ToString();
     this.txtZFOper.Text = CDGI.ZFOPER;
     this.txtXCQK.Text = CDGI.XCQK;
     this.txtREMARK.Text = CDGI.REMARK;
     this.ddlCmp.SelectedValue = CDGI.CMPGUID;
     this.txtACCOMPANYMEN.Text = CDGI.ACCOMPANYMEN;
 }
示例#2
0
        /// <summary>
        /// 
        /// 编写日期:2010-4-8
        /// 编写人:GWF
        /// </summary>
        /// <param name="GUID"></param>
        public Detail_CAW_DAILYXCTZ GetDetail(string GUID)
        {
            Database db = DatabaseFactory.CreateDatabase(CawConnStr);
            string strSql = (db.DbProviderFactory.ToString() != "System.Data.OracleClient.OracleClientFactory") ?
                "SELECT * FROM CAW_DAILYXCTZ WHERE  GUID=@GUID " :
                "SELECT * FROM CAW_DAILYXCTZ WHERE  GUID=:GUID ";
            DbCommand cmd = db.GetSqlStringCommand(strSql);

            db.AddInParameter(cmd, "GUID", DbType.String, GUID);

            Detail_CAW_DAILYXCTZ myDetail = new Detail_CAW_DAILYXCTZ();

            using (IDataReader myReader = db.ExecuteReader(cmd))
            {
                if (myReader.Read())
                {
                    if (!Convert.IsDBNull(myReader["GUID"]))
                    {
                        myDetail.GUID = Convert.ToString(myReader["GUID"]);
                    }
                    if (!Convert.IsDBNull(myReader["XCDATE"]))
                    {
                        myDetail.XCDATE = Convert.ToDateTime(myReader["XCDATE"]);
                    }
                    if (!Convert.IsDBNull(myReader["XCTYPE"]))
                    {
                        myDetail.XCTYPE = Convert.ToInt32(myReader["XCTYPE"]);
                    }
                    if (!Convert.IsDBNull(myReader["XCTIME0"]))
                    {
                        myDetail.XCTIME0 = Convert.ToDecimal(myReader["XCTIME0"]);
                    }
                    if (!Convert.IsDBNull(myReader["XCTIME1"]))
                    {
                        myDetail.XCTIME1 = Convert.ToDecimal(myReader["XCTIME1"]);
                    }
                    if (!Convert.IsDBNull(myReader["XCTIME2"]))
                    {
                        myDetail.XCTIME2 = Convert.ToDecimal(myReader["XCTIME2"]);
                    }
                    if (!Convert.IsDBNull(myReader["XCTIME3"]))
                    {
                        myDetail.XCTIME3 = Convert.ToDecimal(myReader["XCTIME3"]);
                    }
                    if (!Convert.IsDBNull(myReader["ZFOPER"]))
                    {
                        myDetail.ZFOPER = Convert.ToString(myReader["ZFOPER"]);
                    }
                    if (!Convert.IsDBNull(myReader["XCQK"]))
                    {
                        myDetail.XCQK = Convert.ToString(myReader["XCQK"]);
                    }
                    if (!Convert.IsDBNull(myReader["REMARK"]))
                    {
                        myDetail.REMARK = Convert.ToString(myReader["REMARK"]);
                    }

                    if (!Convert.IsDBNull(myReader["CMPGUID"]))
                    {
                        myDetail.CMPGUID = Convert.ToString(myReader["CMPGUID"]);
                    }
                    if (!Convert.IsDBNull(myReader["CMPNAME"]))
                    {
                        myDetail.CMPNAME = Convert.ToString(myReader["CMPNAME"]);
                    }
                    if (!Convert.IsDBNull(myReader["ACCOMPANYMEN"]))
                    {
                        myDetail.ACCOMPANYMEN = Convert.ToString(myReader["ACCOMPANYMEN"]);
                    }
                }
            }
            return myDetail;
        }