/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOelineworksheet(ref DataRow row, Oelineworksheet entity) { row.SetField("worksheettype", entity.worksheettype); row.SetField("explaination", entity.explaination); row.SetField("callrun", entity.callrun); row.SetField("lastupdate", entity.lastupdate); row.SetField("orignetord", entity.orignetord); row.SetField("origtotalcost", entity.origtotalcost); row.SetField("origmargin", entity.origmargin); row.SetField("origmarginpct", entity.origmarginpct); row.SetField("numlines", entity.numlines); row.SetField("origpdrecno", entity.origpdrecno); row.SetField("origpdrecnohidden", entity.origpdrecnohidden); row.SetField("newnetord", entity.newnetord); row.SetField("newtotalcost", entity.newtotalcost); row.SetField("newmargin", entity.newmargin); row.SetField("newmarginpct", entity.newmarginpct); row.SetField("newpdrecno", entity.newpdrecno); row.SetField("newpdrecnohidden", entity.newpdrecnohidden); row.SetField("origoverridetype", entity.origoverridetype); row.SetField("orighightolprice", entity.orighightolprice); row.SetField("origlowtolprice", entity.origlowtolprice); row.SetField("newoverridetype", entity.newoverridetype); row.SetField("newhightolprice", entity.newhightolprice); row.SetField("newlowtolprice", entity.newlowtolprice); row.SetField("btnlineapplyenabled", entity.btnlineapplyenabled); row.SetField("btnorigcostenabled", entity.btnorigcostenabled); row.SetField("btnorigcosthidden", entity.btnorigcosthidden); row.SetField("linelist", entity.linelist); row.SetField("linetype", entity.linetype); row.SetField("pricetype", entity.pricetype); row.SetField("pricetypeenabled", entity.pricetypeenabled); row.SetField("pricetypehidden", entity.pricetypehidden); row.SetField("pricetypedesc", entity.pricetypedesc); row.SetField("pricetypedeschidden", entity.pricetypedeschidden); row.SetField("lineamount", entity.lineamount); row.SetField("lineamountlabel", entity.lineamountlabel); row.SetField("lineamountenabled", entity.lineamountenabled); row.SetField("lineamounthidden", entity.lineamounthidden); row.SetField("lineamountformat", entity.lineamountformat); row.SetField("lineamounttype", entity.lineamounttype); row.SetField("pricecd", entity.pricecd); row.SetField("multdisc", entity.multdisc); row.SetField("multdischidden", entity.multdischidden); row.SetField("multdiscenabled", entity.multdiscenabled); row.SetField("baselist", entity.baselist); row.SetField("baselisthidden", entity.baselisthidden); row.SetField("baselistenabled", entity.baselistenabled); row.SetField("multiplier", entity.multiplier); row.SetField("multiplierhidden", entity.multiplierhidden); row.SetField("multiplierenabled", entity.multiplierenabled); row.SetField("multiplierformat", entity.multiplierformat); row.SetField("multipliertype", entity.multipliertype); row.SetField("costbase", entity.costbase); row.SetField("costbasedefault", entity.costbasedefault); row.SetField("costbasehidden", entity.costbasehidden); row.SetField("costbaseenabled", entity.costbaseenabled); row.SetField("chaindisccalcpercent", entity.chaindisccalcpercent); row.SetField("chaindisccalcpercenthidden", entity.chaindisccalcpercenthidden); row.SetField("disc1", entity.disc1); row.SetField("disc1hidden", entity.disc1hidden); row.SetField("disc1enabled", entity.disc1enabled); row.SetField("disc2", entity.disc2); row.SetField("disc2hidden", entity.disc2hidden); row.SetField("disc2enabled", entity.disc2enabled); row.SetField("disc3", entity.disc3); row.SetField("disc3hidden", entity.disc3hidden); row.SetField("disc3enabled", entity.disc3enabled); row.SetField("disc4", entity.disc4); row.SetField("disc4hidden", entity.disc4hidden); row.SetField("disc4enabled", entity.disc4enabled); row.SetField("disc5", entity.disc5); row.SetField("disc5hidden", entity.disc5hidden); row.SetField("disc5enabled", entity.disc5enabled); row.SetField("disc6", entity.disc6); row.SetField("disc6hidden", entity.disc6hidden); row.SetField("disc6enabled", entity.disc6enabled); row.SetField("disc7", entity.disc7); row.SetField("disc7hidden", entity.disc7hidden); row.SetField("disc7enabled", entity.disc7enabled); row.SetField("disc8", entity.disc8); row.SetField("disc8hidden", entity.disc8hidden); row.SetField("disc8enabled", entity.disc8enabled); row.SetField("disc9", entity.disc9); row.SetField("disc9hidden", entity.disc9hidden); row.SetField("disc9enabled", entity.disc9enabled); row.SetField("disc10", entity.disc10); row.SetField("disc10hidden", entity.disc10hidden); row.SetField("disc10enabled", entity.disc10enabled); row.SetField("disc11", entity.disc11); row.SetField("disc11hidden", entity.disc11hidden); row.SetField("disc11enabled", entity.disc11enabled); row.SetField("disc12", entity.disc12); row.SetField("disc12hidden", entity.disc12hidden); row.SetField("disc12enabled", entity.disc12enabled); row.SetField("disc13", entity.disc13); row.SetField("disc13hidden", entity.disc13hidden); row.SetField("disc13enabled", entity.disc13enabled); row.SetField("disc14", entity.disc14); row.SetField("disc14hidden", entity.disc14hidden); row.SetField("disc14enabled", entity.disc14enabled); row.SetField("disc15", entity.disc15); row.SetField("disc15hidden", entity.disc15hidden); row.SetField("disc15enabled", entity.disc15enabled); row.SetField("disc16", entity.disc16); row.SetField("disc16hidden", entity.disc16hidden); row.SetField("disc16enabled", entity.disc16enabled); row.SetField("disc17", entity.disc17); row.SetField("disc17hidden", entity.disc17hidden); row.SetField("disc17enabled", entity.disc17enabled); row.SetField("disc18", entity.disc18); row.SetField("disc18hidden", entity.disc18hidden); row.SetField("disc18enabled", entity.disc18enabled); row.SetField("disc19", entity.disc19); row.SetField("disc19hidden", entity.disc19hidden); row.SetField("disc19enabled", entity.disc19enabled); row.SetField("userfield", entity.userfield); }
public static Oelineworksheet BuildOelineworksheetFromRow(DataRow row) { Oelineworksheet entity = new Oelineworksheet(); entity.worksheettype = row.IsNull("worksheettype") ? string.Empty : row.Field <string>("worksheettype"); entity.explaination = row.IsNull("explaination") ? string.Empty : row.Field <string>("explaination"); entity.callrun = row.IsNull("callrun") ? 0 : row.Field <int>("callrun"); entity.lastupdate = row.IsNull("lastupdate") ? string.Empty : row.Field <string>("lastupdate"); entity.orignetord = row.IsNull("orignetord") ? decimal.Zero : row.Field <decimal>("orignetord"); entity.origtotalcost = row.IsNull("origtotalcost") ? decimal.Zero : row.Field <decimal>("origtotalcost"); entity.origmargin = row.IsNull("origmargin") ? decimal.Zero : row.Field <decimal>("origmargin"); entity.origmarginpct = row.IsNull("origmarginpct") ? decimal.Zero : row.Field <decimal>("origmarginpct"); entity.numlines = row.IsNull("numlines") ? 0 : row.Field <int>("numlines"); entity.origpdrecno = row.IsNull("origpdrecno") ? 0 : row.Field <int>("origpdrecno"); entity.origpdrecnohidden = row.Field <bool>("origpdrecnohidden"); entity.newnetord = row.IsNull("newnetord") ? decimal.Zero : row.Field <decimal>("newnetord"); entity.newtotalcost = row.IsNull("newtotalcost") ? decimal.Zero : row.Field <decimal>("newtotalcost"); entity.newmargin = row.IsNull("newmargin") ? decimal.Zero : row.Field <decimal>("newmargin"); entity.newmarginpct = row.IsNull("newmarginpct") ? decimal.Zero : row.Field <decimal>("newmarginpct"); entity.newpdrecno = row.IsNull("newpdrecno") ? 0 : row.Field <int>("newpdrecno"); entity.newpdrecnohidden = row.Field <bool>("newpdrecnohidden"); entity.origoverridetype = row.IsNull("origoverridetype") ? string.Empty : row.Field <string>("origoverridetype"); entity.orighightolprice = row.IsNull("orighightolprice") ? decimal.Zero : row.Field <decimal>("orighightolprice"); entity.origlowtolprice = row.IsNull("origlowtolprice") ? decimal.Zero : row.Field <decimal>("origlowtolprice"); entity.newoverridetype = row.IsNull("newoverridetype") ? string.Empty : row.Field <string>("newoverridetype"); entity.newhightolprice = row.IsNull("newhightolprice") ? decimal.Zero : row.Field <decimal>("newhightolprice"); entity.newlowtolprice = row.IsNull("newlowtolprice") ? decimal.Zero : row.Field <decimal>("newlowtolprice"); entity.btnlineapplyenabled = row.Field <bool>("btnlineapplyenabled"); entity.btnorigcostenabled = row.Field <bool>("btnorigcostenabled"); entity.btnorigcosthidden = row.Field <bool>("btnorigcosthidden"); entity.linelist = row.IsNull("linelist") ? string.Empty : row.Field <string>("linelist"); entity.linetype = row.IsNull("linetype") ? string.Empty : row.Field <string>("linetype"); entity.pricetype = row.IsNull("pricetype") ? string.Empty : row.Field <string>("pricetype"); entity.pricetypeenabled = row.Field <bool>("pricetypeenabled"); entity.pricetypehidden = row.Field <bool>("pricetypehidden"); entity.pricetypedesc = row.IsNull("pricetypedesc") ? string.Empty : row.Field <string>("pricetypedesc"); entity.pricetypedeschidden = row.Field <bool>("pricetypedeschidden"); entity.lineamount = row.IsNull("lineamount") ? decimal.Zero : row.Field <decimal>("lineamount"); entity.lineamountlabel = row.IsNull("lineamountlabel") ? string.Empty : row.Field <string>("lineamountlabel"); entity.lineamountenabled = row.Field <bool>("lineamountenabled"); entity.lineamounthidden = row.Field <bool>("lineamounthidden"); entity.lineamountformat = row.IsNull("lineamountformat") ? string.Empty : row.Field <string>("lineamountformat"); entity.lineamounttype = row.IsNull("lineamounttype") ? string.Empty : row.Field <string>("lineamounttype"); entity.pricecd = row.IsNull("pricecd") ? 0 : row.Field <int>("pricecd"); entity.multdisc = row.Field <bool>("multdisc"); entity.multdischidden = row.Field <bool>("multdischidden"); entity.multdiscenabled = row.Field <bool>("multdiscenabled"); entity.baselist = row.Field <bool>("baselist"); entity.baselisthidden = row.Field <bool>("baselisthidden"); entity.baselistenabled = row.Field <bool>("baselistenabled"); entity.multiplier = row.IsNull("multiplier") ? decimal.Zero : row.Field <decimal>("multiplier"); entity.multiplierhidden = row.Field <bool>("multiplierhidden"); entity.multiplierenabled = row.Field <bool>("multiplierenabled"); entity.multiplierformat = row.IsNull("multiplierformat") ? string.Empty : row.Field <string>("multiplierformat"); entity.multipliertype = row.IsNull("multipliertype") ? string.Empty : row.Field <string>("multipliertype"); entity.costbase = row.IsNull("costbase") ? string.Empty : row.Field <string>("costbase"); entity.costbasedefault = row.IsNull("costbasedefault") ? string.Empty : row.Field <string>("costbasedefault"); entity.costbasehidden = row.Field <bool>("costbasehidden"); entity.costbaseenabled = row.Field <bool>("costbaseenabled"); entity.chaindisccalcpercent = row.IsNull("chaindisccalcpercent") ? decimal.Zero : row.Field <decimal>("chaindisccalcpercent"); entity.chaindisccalcpercenthidden = row.Field <bool>("chaindisccalcpercenthidden"); entity.disc1 = row.IsNull("disc1") ? 0 : row.Field <int>("disc1"); entity.disc1hidden = row.Field <bool>("disc1hidden"); entity.disc1enabled = row.Field <bool>("disc1enabled"); entity.disc2 = row.IsNull("disc2") ? 0 : row.Field <int>("disc2"); entity.disc2hidden = row.Field <bool>("disc2hidden"); entity.disc2enabled = row.Field <bool>("disc2enabled"); entity.disc3 = row.IsNull("disc3") ? 0 : row.Field <int>("disc3"); entity.disc3hidden = row.Field <bool>("disc3hidden"); entity.disc3enabled = row.Field <bool>("disc3enabled"); entity.disc4 = row.IsNull("disc4") ? 0 : row.Field <int>("disc4"); entity.disc4hidden = row.Field <bool>("disc4hidden"); entity.disc4enabled = row.Field <bool>("disc4enabled"); entity.disc5 = row.IsNull("disc5") ? 0 : row.Field <int>("disc5"); entity.disc5hidden = row.Field <bool>("disc5hidden"); entity.disc5enabled = row.Field <bool>("disc5enabled"); entity.disc6 = row.IsNull("disc6") ? 0 : row.Field <int>("disc6"); entity.disc6hidden = row.Field <bool>("disc6hidden"); entity.disc6enabled = row.Field <bool>("disc6enabled"); entity.disc7 = row.IsNull("disc7") ? 0 : row.Field <int>("disc7"); entity.disc7hidden = row.Field <bool>("disc7hidden"); entity.disc7enabled = row.Field <bool>("disc7enabled"); entity.disc8 = row.IsNull("disc8") ? 0 : row.Field <int>("disc8"); entity.disc8hidden = row.Field <bool>("disc8hidden"); entity.disc8enabled = row.Field <bool>("disc8enabled"); entity.disc9 = row.IsNull("disc9") ? 0 : row.Field <int>("disc9"); entity.disc9hidden = row.Field <bool>("disc9hidden"); entity.disc9enabled = row.Field <bool>("disc9enabled"); entity.disc10 = row.IsNull("disc10") ? 0 : row.Field <int>("disc10"); entity.disc10hidden = row.Field <bool>("disc10hidden"); entity.disc10enabled = row.Field <bool>("disc10enabled"); entity.disc11 = row.IsNull("disc11") ? 0 : row.Field <int>("disc11"); entity.disc11hidden = row.Field <bool>("disc11hidden"); entity.disc11enabled = row.Field <bool>("disc11enabled"); entity.disc12 = row.IsNull("disc12") ? 0 : row.Field <int>("disc12"); entity.disc12hidden = row.Field <bool>("disc12hidden"); entity.disc12enabled = row.Field <bool>("disc12enabled"); entity.disc13 = row.IsNull("disc13") ? 0 : row.Field <int>("disc13"); entity.disc13hidden = row.Field <bool>("disc13hidden"); entity.disc13enabled = row.Field <bool>("disc13enabled"); entity.disc14 = row.IsNull("disc14") ? 0 : row.Field <int>("disc14"); entity.disc14hidden = row.Field <bool>("disc14hidden"); entity.disc14enabled = row.Field <bool>("disc14enabled"); entity.disc15 = row.IsNull("disc15") ? 0 : row.Field <int>("disc15"); entity.disc15hidden = row.Field <bool>("disc15hidden"); entity.disc15enabled = row.Field <bool>("disc15enabled"); entity.disc16 = row.IsNull("disc16") ? 0 : row.Field <int>("disc16"); entity.disc16hidden = row.Field <bool>("disc16hidden"); entity.disc16enabled = row.Field <bool>("disc16enabled"); entity.disc17 = row.IsNull("disc17") ? 0 : row.Field <int>("disc17"); entity.disc17hidden = row.Field <bool>("disc17hidden"); entity.disc17enabled = row.Field <bool>("disc17enabled"); entity.disc18 = row.IsNull("disc18") ? 0 : row.Field <int>("disc18"); entity.disc18hidden = row.Field <bool>("disc18hidden"); entity.disc18enabled = row.Field <bool>("disc18enabled"); entity.disc19 = row.IsNull("disc19") ? 0 : row.Field <int>("disc19"); entity.disc19hidden = row.Field <bool>("disc19hidden"); entity.disc19enabled = row.Field <bool>("disc19enabled"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }