Example #1
0
        public static Gletaparam BuildGletaparamFromRow(DataRow row)
        {
            Gletaparam entity = new Gletaparam();

            entity.cProc        = row.IsNull("cProc") ? string.Empty : row.Field <string>("cProc");
            entity.iControlDiv  = row.IsNull("iControlDiv") ? 0 : row.Field <int>("iControlDiv");
            entity.iControlDept = row.IsNull("iControlDept") ? 0 : row.Field <int>("iControlDept");
            entity.iControlAcct = row.IsNull("iControlAcct") ? 0 : row.Field <int>("iControlAcct");
            entity.iControlSub  = row.IsNull("iControlSub") ? 0 : row.Field <int>("iControlSub");
            entity.dAmount      = row.IsNull("dAmount") ? decimal.Zero : row.Field <decimal>("dAmount");
            entity.lBalType     = row.Field <bool>("lBalType");
            entity.cRefer       = row.IsNull("cRefer") ? string.Empty : row.Field <string>("cRefer");
            entity.iInvNo       = row.IsNull("iInvNo") ? 0 : row.Field <int>("iInvNo");
            entity.iInvSuf      = row.IsNull("iInvSuf") ? 0 : row.Field <int>("iInvSuf");
            entity.iBankNo      = row.IsNull("iBankNo") ? 0 : row.Field <int>("iBankNo");
            entity.cUpdGLTy     = row.IsNull("cUpdGLTy") ? string.Empty : row.Field <string>("cUpdGLTy");
            entity.cAPInvNo     = row.IsNull("cAPInvNo") ? string.Empty : row.Field <string>("cAPInvNo");
            entity.dAPCheckNo   = row.IsNull("dAPCheckNo") ? decimal.Zero : row.Field <decimal>("dAPCheckNo");
            entity.iPosition    = row.IsNull("iPosition") ? 0 : row.Field <int>("iPosition");
            entity.dCustNo      = row.IsNull("dCustNo") ? decimal.Zero : row.Field <decimal>("dCustNo");
            entity.dVendNo      = row.IsNull("dVendNo") ? decimal.Zero : row.Field <decimal>("dVendNo");
            entity.dFRate       = row.IsNull("dFRate") ? decimal.Zero : row.Field <decimal>("dFRate");
            entity.iDivNum      = row.IsNull("iDivNum") ? 0 : row.Field <int>("iDivNum");
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Example #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromGletaparam(ref DataRow row, Gletaparam entity)
 {
     row.SetField("cProc", entity.cProc);
     row.SetField("iControlDiv", entity.iControlDiv);
     row.SetField("iControlDept", entity.iControlDept);
     row.SetField("iControlAcct", entity.iControlAcct);
     row.SetField("iControlSub", entity.iControlSub);
     row.SetField("dAmount", entity.dAmount);
     row.SetField("lBalType", entity.lBalType);
     row.SetField("cRefer", entity.cRefer);
     row.SetField("iInvNo", entity.iInvNo);
     row.SetField("iInvSuf", entity.iInvSuf);
     row.SetField("iBankNo", entity.iBankNo);
     row.SetField("cUpdGLTy", entity.cUpdGLTy);
     row.SetField("cAPInvNo", entity.cAPInvNo);
     row.SetField("dAPCheckNo", entity.dAPCheckNo);
     row.SetField("iPosition", entity.iPosition);
     row.SetField("dCustNo", entity.dCustNo);
     row.SetField("dVendNo", entity.dVendNo);
     row.SetField("dFRate", entity.dFRate);
     row.SetField("iDivNum", entity.iDivNum);
     row.SetField("userfield", entity.userfield);
 }