Пример #1
0
        public static Arecemaindata BuildArecemaindataFromRow(DataRow row)
        {
            Arecemaindata entity = new Arecemaindata();

            entity.cono                      = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.oper                      = row.IsNull("oper") ? string.Empty : row.Field <string>("oper");
            entity.bankfromcust              = row.Field <bool>("bankfromcust");
            entity.cancelconf                = row.Field <bool>("cancelconf");
            entity.cancelconfasked           = row.Field <bool>("cancelconfasked");
            entity.cancelexchangerateupdate  = row.Field <bool>("cancelexchangerateupdate");
            entity.closejournalmenuenabled   = row.Field <bool>("closejournalmenuenabled");
            entity.displayjournalmenuenabled = row.Field <bool>("displayjournalmenuenabled");
            entity.exchrate                  = row.IsNull("exchrate") ? decimal.Zero : row.Field <decimal>("exchrate");
            entity.exchrateasked             = row.Field <bool>("exchrateasked");
            entity.launchexchrate            = row.Field <bool>("launchexchrate");
            entity.oldapplied                = row.IsNull("oldapplied") ? decimal.Zero : row.Field <decimal>("oldapplied");
            entity.oldavail                  = row.IsNull("oldavail") ? decimal.Zero : row.Field <decimal>("oldavail");
            entity.oldproof                  = row.IsNull("oldproof") ? decimal.Zero : row.Field <decimal>("oldproof");
            entity.proofcolor                = row.IsNull("proofcolor") ? string.Empty : row.Field <string>("proofcolor");
            entity.rctcheckhighlight         = row.Field <bool>("rctcheckhighlight");
            entity.rctcreditshighlight       = row.Field <bool>("rctcreditshighlight");
            entity.rctcustomerhighlight      = row.Field <bool>("rctcustomerhighlight");
            entity.rctinvoiceshighlight      = row.Field <bool>("rctinvoiceshighlight");
            entity.rctonholdvisible          = row.Field <bool>("rctonholdvisible");
            entity.showall                   = row.Field <bool>("showall");
            entity.txtapplied                = row.IsNull("txtapplied") ? string.Empty : row.Field <string>("txtapplied");
            entity.txtavail                  = row.IsNull("txtavail") ? string.Empty : row.Field <string>("txtavail");
            entity.txtcheckamt               = row.IsNull("txtcheckamt") ? string.Empty : row.Field <string>("txtcheckamt");
            entity.txtcheckno                = row.IsNull("txtcheckno") ? string.Empty : row.Field <string>("txtcheckno");
            entity.txtcredits                = row.IsNull("txtcredits") ? string.Empty : row.Field <string>("txtcredits");
            entity.txtcustbalance            = row.IsNull("txtcustbalance") ? string.Empty : row.Field <string>("txtcustbalance");
            entity.txtcustgroup              = row.IsNull("txtcustgroup") ? string.Empty : row.Field <string>("txtcustgroup");
            entity.txtcustno                 = row.IsNull("txtcustno") ? string.Empty : row.Field <string>("txtcustno");
            entity.txtcustomer               = row.IsNull("txtcustomer") ? string.Empty : row.Field <string>("txtcustomer");
            entity.txtinvoices               = row.IsNull("txtinvoices") ? string.Empty : row.Field <string>("txtinvoices");
            entity.txtonhold                 = row.IsNull("txtonhold") ? string.Empty : row.Field <string>("txtonhold");
            entity.txtprfck                  = row.IsNull("txtprfck") ? string.Empty : row.Field <string>("txtprfck");
            entity.txtproof                  = row.IsNull("txtproof") ? string.Empty : row.Field <string>("txtproof");
            entity.txtproofcr                = row.IsNull("txtproofcr") ? string.Empty : row.Field <string>("txtproofcr");
            entity.txtproofdr                = row.IsNull("txtproofdr") ? string.Empty : row.Field <string>("txtproofdr");
            entity.txtshipto                 = row.IsNull("txtshipto") ? string.Empty : row.Field <string>("txtshipto");
            entity.txtsplit                  = row.IsNull("txtsplit") ? string.Empty : row.Field <string>("txtsplit");
            entity.txttotck                  = row.IsNull("txttotck") ? string.Empty : row.Field <string>("txttotck");
            entity.txttotcr                  = row.IsNull("txttotcr") ? string.Empty : row.Field <string>("txttotcr");
            entity.txttotdr                  = row.IsNull("txttotdr") ? string.Empty : row.Field <string>("txttotdr");
            entity.txttothash                = row.IsNull("txttothash") ? string.Empty : row.Field <string>("txttothash");
            entity.updatevalid               = row.Field <bool>("updatevalid");
            entity.viewcredits               = row.Field <bool>("viewcredits");
            entity.viewcreditsinvmenuenabled = row.Field <bool>("viewcreditsinvmenuenabled");
            entity.userfield                 = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Пример #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromArecemaindata(ref DataRow row, Arecemaindata entity)
 {
     row.SetField("cono", entity.cono);
     row.SetField("oper", entity.oper);
     row.SetField("bankfromcust", entity.bankfromcust);
     row.SetField("cancelconf", entity.cancelconf);
     row.SetField("cancelconfasked", entity.cancelconfasked);
     row.SetField("cancelexchangerateupdate", entity.cancelexchangerateupdate);
     row.SetField("closejournalmenuenabled", entity.closejournalmenuenabled);
     row.SetField("displayjournalmenuenabled", entity.displayjournalmenuenabled);
     row.SetField("exchrate", entity.exchrate);
     row.SetField("exchrateasked", entity.exchrateasked);
     row.SetField("launchexchrate", entity.launchexchrate);
     row.SetField("oldapplied", entity.oldapplied);
     row.SetField("oldavail", entity.oldavail);
     row.SetField("oldproof", entity.oldproof);
     row.SetField("proofcolor", entity.proofcolor);
     row.SetField("rctcheckhighlight", entity.rctcheckhighlight);
     row.SetField("rctcreditshighlight", entity.rctcreditshighlight);
     row.SetField("rctcustomerhighlight", entity.rctcustomerhighlight);
     row.SetField("rctinvoiceshighlight", entity.rctinvoiceshighlight);
     row.SetField("rctonholdvisible", entity.rctonholdvisible);
     row.SetField("showall", entity.showall);
     row.SetField("txtapplied", entity.txtapplied);
     row.SetField("txtavail", entity.txtavail);
     row.SetField("txtcheckamt", entity.txtcheckamt);
     row.SetField("txtcheckno", entity.txtcheckno);
     row.SetField("txtcredits", entity.txtcredits);
     row.SetField("txtcustbalance", entity.txtcustbalance);
     row.SetField("txtcustgroup", entity.txtcustgroup);
     row.SetField("txtcustno", entity.txtcustno);
     row.SetField("txtcustomer", entity.txtcustomer);
     row.SetField("txtinvoices", entity.txtinvoices);
     row.SetField("txtonhold", entity.txtonhold);
     row.SetField("txtprfck", entity.txtprfck);
     row.SetField("txtproof", entity.txtproof);
     row.SetField("txtproofcr", entity.txtproofcr);
     row.SetField("txtproofdr", entity.txtproofdr);
     row.SetField("txtshipto", entity.txtshipto);
     row.SetField("txtsplit", entity.txtsplit);
     row.SetField("txttotck", entity.txttotck);
     row.SetField("txttotcr", entity.txttotcr);
     row.SetField("txttotdr", entity.txttotdr);
     row.SetField("txttothash", entity.txttothash);
     row.SetField("updatevalid", entity.updatevalid);
     row.SetField("viewcredits", entity.viewcredits);
     row.SetField("viewcreditsinvmenuenabled", entity.viewcreditsinvmenuenabled);
     row.SetField("userfield", entity.userfield);
 }