///<summary>Inserts one ClaimFormItem into the database. Returns the new priKey.</summary> public static long Insert(ClaimFormItem claimFormItem) { if (DataConnection.DBtype == DatabaseType.Oracle) { claimFormItem.ClaimFormItemNum = DbHelper.GetNextOracleKey("claimformitem", "ClaimFormItemNum"); int loopcount = 0; while (loopcount < 100) { try { return(Insert(claimFormItem, true)); } catch (Oracle.DataAccess.Client.OracleException ex) { if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")) { claimFormItem.ClaimFormItemNum++; loopcount++; } else { throw ex; } } } throw new ApplicationException("Insert failed. Could not generate primary key."); } else { return(Insert(claimFormItem, false)); } }
///<summary>Inserts one ClaimFormItem into the database. Provides option to use the existing priKey.</summary> internal static long Insert(ClaimFormItem claimFormItem,bool useExistingPK) { if(!useExistingPK && PrefC.RandomKeys) { claimFormItem.ClaimFormItemNum=ReplicationServers.GetKey("claimformitem","ClaimFormItemNum"); } string command="INSERT INTO claimformitem ("; if(useExistingPK || PrefC.RandomKeys) { command+="ClaimFormItemNum,"; } command+="ClaimFormNum,ImageFileName,FieldName,FormatString,XPos,YPos,Width,Height) VALUES("; if(useExistingPK || PrefC.RandomKeys) { command+=POut.Long(claimFormItem.ClaimFormItemNum)+","; } command+= POut.Long (claimFormItem.ClaimFormNum)+"," +"'"+POut.String(claimFormItem.ImageFileName)+"'," +"'"+POut.String(claimFormItem.FieldName)+"'," +"'"+POut.String(claimFormItem.FormatString)+"'," + POut.Float (claimFormItem.XPos)+"," + POut.Float (claimFormItem.YPos)+"," + POut.Float (claimFormItem.Width)+"," + POut.Float (claimFormItem.Height)+")"; if(useExistingPK || PrefC.RandomKeys) { Db.NonQ(command); } else { claimFormItem.ClaimFormItemNum=Db.NonQ(command,true); } return claimFormItem.ClaimFormItemNum; }
///<summary></summary> public static void Delete(ClaimFormItem item) { string command = "DELETE FROM claimformitem " + "WHERE ClaimFormItemNum = '" + POut.PInt(item.ClaimFormItemNum) + "'"; General.NonQ(command); }
///<summary>Inserts one ClaimFormItem into the database. Returns the new priKey.</summary> internal static long Insert(ClaimFormItem claimFormItem) { if(DataConnection.DBtype==DatabaseType.Oracle) { claimFormItem.ClaimFormItemNum=DbHelper.GetNextOracleKey("claimformitem","ClaimFormItemNum"); int loopcount=0; while(loopcount<100){ try { return Insert(claimFormItem,true); } catch(Oracle.DataAccess.Client.OracleException ex){ if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){ claimFormItem.ClaimFormItemNum++; loopcount++; } else{ throw ex; } } } throw new ApplicationException("Insert failed. Could not generate primary key."); } else { return Insert(claimFormItem,false); } }
///<summary>Updates one ClaimFormItem in the database.</summary> public static void Update(ClaimFormItem claimFormItem) { string command = "UPDATE claimformitem SET " + "ClaimFormNum = " + POut.Long(claimFormItem.ClaimFormNum) + ", " + "ImageFileName = '" + POut.String(claimFormItem.ImageFileName) + "', " + "FieldName = '" + POut.String(claimFormItem.FieldName) + "', " + "FormatString = '" + POut.String(claimFormItem.FormatString) + "', " + "XPos = " + POut.Float(claimFormItem.XPos) + ", " + "YPos = " + POut.Float(claimFormItem.YPos) + ", " + "Width = " + POut.Float(claimFormItem.Width) + ", " + "Height = " + POut.Float(claimFormItem.Height) + " " + "WHERE ClaimFormItemNum = " + POut.Long(claimFormItem.ClaimFormItemNum); Db.NonQ(command); }
///<summary>Gets all claimformitems for the specified claimform from the preloaded List.</summary> public static ClaimFormItem[] GetListForForm(int claimFormNum) { ArrayList tempAL = new ArrayList(); for (int i = 0; i < List.Length; i++) { if (List[i].ClaimFormNum == claimFormNum) { tempAL.Add(List[i]); } } ClaimFormItem[] ListForForm = new ClaimFormItem[tempAL.Count]; tempAL.CopyTo(ListForForm); return(ListForForm); }
///<summary></summary> public static void Update(ClaimFormItem item) { string command = "UPDATE claimformitem SET " + "claimformnum = '" + POut.PInt(item.ClaimFormNum) + "' " + ",imagefilename = '" + POut.PString(item.ImageFileName) + "' " + ",fieldname = '" + POut.PString(item.FieldName) + "' " + ",formatstring = '" + POut.PString(item.FormatString) + "' " + ",xpos = '" + POut.PFloat(item.XPos) + "' " + ",ypos = '" + POut.PFloat(item.YPos) + "' " + ",width = '" + POut.PFloat(item.Width) + "' " + ",height = '" + POut.PFloat(item.Height) + "' " + "WHERE ClaimFormItemNum = '" + POut.PInt(item.ClaimFormItemNum) + "'"; General.NonQ(command); }
///<summary>Inserts one ClaimFormItem into the database. Returns the new priKey. Doesn't use the cache.</summary> public static long InsertNoCache(ClaimFormItem claimFormItem) { if (DataConnection.DBtype == DatabaseType.MySql) { return(InsertNoCache(claimFormItem, false)); } else { if (DataConnection.DBtype == DatabaseType.Oracle) { claimFormItem.ClaimFormItemNum = DbHelper.GetNextOracleKey("claimformitem", "ClaimFormItemNum"); //Cacheless method } return(InsertNoCache(claimFormItem, true)); } }
///<summary></summary> public static void Insert(ClaimFormItem item) { string command = "INSERT INTO claimformitem (claimformnum,imagefilename,fieldname,formatstring" + ",xpos,ypos,width,height) VALUES(" + "'" + POut.PInt(item.ClaimFormNum) + "', " + "'" + POut.PString(item.ImageFileName) + "', " + "'" + POut.PString(item.FieldName) + "', " + "'" + POut.PString(item.FormatString) + "', " + "'" + POut.PFloat(item.XPos) + "', " + "'" + POut.PFloat(item.YPos) + "', " + "'" + POut.PFloat(item.Width) + "', " + "'" + POut.PFloat(item.Height) + "')"; //MessageBox.Show(string command); item.ClaimFormItemNum = General.NonQ(command, true); }
///<summary>Converts a DataTable to a list of objects.</summary> public static List<ClaimFormItem> TableToList(DataTable table){ List<ClaimFormItem> retVal=new List<ClaimFormItem>(); ClaimFormItem claimFormItem; for(int i=0;i<table.Rows.Count;i++) { claimFormItem=new ClaimFormItem(); claimFormItem.ClaimFormItemNum= PIn.Long (table.Rows[i]["ClaimFormItemNum"].ToString()); claimFormItem.ClaimFormNum = PIn.Long (table.Rows[i]["ClaimFormNum"].ToString()); claimFormItem.ImageFileName = PIn.String(table.Rows[i]["ImageFileName"].ToString()); claimFormItem.FieldName = PIn.String(table.Rows[i]["FieldName"].ToString()); claimFormItem.FormatString = PIn.String(table.Rows[i]["FormatString"].ToString()); claimFormItem.XPos = PIn.Float (table.Rows[i]["XPos"].ToString()); claimFormItem.YPos = PIn.Float (table.Rows[i]["YPos"].ToString()); claimFormItem.Width = PIn.Float (table.Rows[i]["Width"].ToString()); claimFormItem.Height = PIn.Float (table.Rows[i]["Height"].ToString()); retVal.Add(claimFormItem); } return retVal; }
///<summary>Converts a DataTable to a list of objects.</summary> public static List <ClaimFormItem> TableToList(DataTable table) { List <ClaimFormItem> retVal = new List <ClaimFormItem>(); ClaimFormItem claimFormItem; for (int i = 0; i < table.Rows.Count; i++) { claimFormItem = new ClaimFormItem(); claimFormItem.ClaimFormItemNum = PIn.Long(table.Rows[i]["ClaimFormItemNum"].ToString()); claimFormItem.ClaimFormNum = PIn.Long(table.Rows[i]["ClaimFormNum"].ToString()); claimFormItem.ImageFileName = PIn.String(table.Rows[i]["ImageFileName"].ToString()); claimFormItem.FieldName = PIn.String(table.Rows[i]["FieldName"].ToString()); claimFormItem.FormatString = PIn.String(table.Rows[i]["FormatString"].ToString()); claimFormItem.XPos = PIn.Float(table.Rows[i]["XPos"].ToString()); claimFormItem.YPos = PIn.Float(table.Rows[i]["YPos"].ToString()); claimFormItem.Width = PIn.Float(table.Rows[i]["Width"].ToString()); claimFormItem.Height = PIn.Float(table.Rows[i]["Height"].ToString()); retVal.Add(claimFormItem); } return(retVal); }
///<summary>Gets all claimformitems for all claimforms. Items for individual claimforms can later be extracted as needed.</summary> public static void Refresh() { string command = "SELECT * FROM claimformitem ORDER BY imagefilename desc"; DataTable table = General.GetTable(command); List = new ClaimFormItem[table.Rows.Count]; for (int i = 0; i < table.Rows.Count; i++) { List[i] = new ClaimFormItem(); List[i].ClaimFormItemNum = PIn.PInt(table.Rows[i][0].ToString()); List[i].ClaimFormNum = PIn.PInt(table.Rows[i][1].ToString()); List[i].ImageFileName = PIn.PString(table.Rows[i][2].ToString()); List[i].FieldName = PIn.PString(table.Rows[i][3].ToString()); List[i].FormatString = PIn.PString(table.Rows[i][4].ToString()); List[i].XPos = PIn.PFloat(table.Rows[i][5].ToString()); List[i].YPos = PIn.PFloat(table.Rows[i][6].ToString()); List[i].Width = PIn.PFloat(table.Rows[i][7].ToString()); List[i].Height = PIn.PFloat(table.Rows[i][8].ToString()); } }
private static void Fill(int index, string fieldName, string formatString) { if (fieldName != "") { for (int i = 0; i < FormCFI.FieldNames.Length; i++) { if (FormCFI.FieldNames[i] == fieldName) { break; } if (i == FormCFI.FieldNames.Length - 1) { MessageBox.Show(fieldName + " is not valid"); return; } } } items[index] = new ClaimFormItem(); items[index].FieldName = fieldName; items[index].FormatString = formatString; }
///<summary>Inserts one ClaimFormItem into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(ClaimFormItem claimFormItem, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO claimformitem ("; if (!useExistingPK && isRandomKeys) { claimFormItem.ClaimFormItemNum = ReplicationServers.GetKeyNoCache("claimformitem", "ClaimFormItemNum"); } if (isRandomKeys || useExistingPK) { command += "ClaimFormItemNum,"; } command += "ClaimFormNum,ImageFileName,FieldName,FormatString,XPos,YPos,Width,Height) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(claimFormItem.ClaimFormItemNum) + ","; } command += POut.Long(claimFormItem.ClaimFormNum) + "," + "'" + POut.String(claimFormItem.ImageFileName) + "'," + "'" + POut.String(claimFormItem.FieldName) + "'," + "'" + POut.String(claimFormItem.FormatString) + "'," + POut.Float(claimFormItem.XPos) + "," + POut.Float(claimFormItem.YPos) + "," + POut.Float(claimFormItem.Width) + "," + POut.Float(claimFormItem.Height) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { claimFormItem.ClaimFormItemNum = Db.NonQ(command, true, "ClaimFormItemNum", "claimFormItem"); } return(claimFormItem.ClaimFormItemNum); }
///<summary>Inserts one ClaimFormItem into the database. Provides option to use the existing priKey.</summary> internal static long Insert(ClaimFormItem claimFormItem, bool useExistingPK) { if (!useExistingPK && PrefC.RandomKeys) { claimFormItem.ClaimFormItemNum = ReplicationServers.GetKey("claimformitem", "ClaimFormItemNum"); } string command = "INSERT INTO claimformitem ("; if (useExistingPK || PrefC.RandomKeys) { command += "ClaimFormItemNum,"; } command += "ClaimFormNum,ImageFileName,FieldName,FormatString,XPos,YPos,Width,Height) VALUES("; if (useExistingPK || PrefC.RandomKeys) { command += POut.Long(claimFormItem.ClaimFormItemNum) + ","; } command += POut.Long(claimFormItem.ClaimFormNum) + "," + "'" + POut.String(claimFormItem.ImageFileName) + "'," + "'" + POut.String(claimFormItem.FieldName) + "'," + "'" + POut.String(claimFormItem.FormatString) + "'," + POut.Float(claimFormItem.XPos) + "," + POut.Float(claimFormItem.YPos) + "," + POut.Float(claimFormItem.Width) + "," + POut.Float(claimFormItem.Height) + ")"; if (useExistingPK || PrefC.RandomKeys) { Db.NonQ(command); } else { claimFormItem.ClaimFormItemNum = Db.NonQ(command, true); } return(claimFormItem.ClaimFormItemNum); }
///<summary>Returns true if Update(ClaimFormItem,ClaimFormItem) would make changes to the database. ///Does not make any changes to the database and can be called before remoting role is checked.</summary> public static bool UpdateComparison(ClaimFormItem claimFormItem, ClaimFormItem oldClaimFormItem) { if (claimFormItem.ClaimFormNum != oldClaimFormItem.ClaimFormNum) { return(true); } if (claimFormItem.ImageFileName != oldClaimFormItem.ImageFileName) { return(true); } if (claimFormItem.FieldName != oldClaimFormItem.FieldName) { return(true); } if (claimFormItem.FormatString != oldClaimFormItem.FormatString) { return(true); } if (claimFormItem.XPos != oldClaimFormItem.XPos) { return(true); } if (claimFormItem.YPos != oldClaimFormItem.YPos) { return(true); } if (claimFormItem.Width != oldClaimFormItem.Width) { return(true); } if (claimFormItem.Height != oldClaimFormItem.Height) { return(true); } return(false); }
///<summary>Called once for each claim to be created. For claims with a lot of procedures, this may actually create multiple claims.</summary> public static bool CreateClaim(long patNum, long claimNum, int batchNum) { //this can be eliminated later after error checking complete: FormCFI = new FormClaimFormItemEdit(); FormCFI.FillFieldNames(); items = new ClaimFormItem[241]; //0 is not used Fill(1, "IsPreAuth"); Fill(2, "IsStandardClaim"); Fill(3, "IsMedicaidClaim"); Fill(4, ""); //EPSTD Fill(5, "TreatingProviderSpecialty"); Fill(6, "PreAuthString"); Fill(7, "PriInsCarrierName"); Fill(8, "PriInsAddressComplete"); Fill(9, "PriInsCity"); Fill(10, "PriInsST"); Fill(11, "PriInsZip"); Fill(12, "PatientLastFirst"); Fill(13, "PatientAddressComplete"); Fill(14, "PatientCity"); Fill(15, "PatientST"); Fill(16, "PatientDOB", "MM/dd/yyyy"); Fill(17, "PatientID-MedicaidOrSSN"); Fill(18, "PatientIsMale"); Fill(19, "PatientIsFemale"); Fill(20, "PatientPhone"); Fill(21, "PatientZip"); Fill(22, "RelatIsSelf"); Fill(23, "RelatIsSpouse"); Fill(24, "RelatIsChild"); Fill(25, "RelatIsOther"); Fill(26, ""); //relat other descript Fill(27, ""); //pat employer/school Fill(28, ""); //pat employer/school address Fill(29, "SubscrID"); Fill(30, "EmployerName"); Fill(31, "GroupNum"); Fill(32, "OtherInsNotExists"); Fill(33, "OtherInsExists"); Fill(34, "OtherInsExists"); //dental Fill(35, ""); //other ins exists medical Fill(36, "OtherInsSubscrID"); Fill(37, "SubscrLastFirst"); Fill(38, "OtherInsSubscrLastFirst"); Fill(39, "SubscrAddressComplete"); Fill(40, "SubscrPhone"); Fill(41, "OtherInsSubscrDOB", "MM/dd/yyyy"); Fill(42, "OtherInsSubscrIsMale"); Fill(43, "OtherInsSubscrIsFemale"); Fill(44, "OtherInsGroupNum"); //Other Plan/Program name Fill(45, "SubscrCity"); Fill(46, "SubscrST"); Fill(47, "SubscrZip"); Fill(48, ""); //other subscr employer/school Fill(49, ""); //other subscr emp/school address Fill(50, "SubscrDOB", "MM/dd/yyyy"); Fill(51, "SubscrIsMarried"); Fill(52, "SubscrIsSingle"); Fill(53, ""); //subscr marital status other Fill(54, "SubscrIsMale"); Fill(55, "SubscrIsFemale"); Fill(56, ""); //subscr is employed Fill(57, ""); //subscr is part time Fill(58, "SubscrIsFTStudent"); Fill(59, "SubscrIsPTStudent"); Fill(60, ""); //subsc employer/school Fill(61, ""); //subsc employer/school address Fill(62, "PatientRelease"); Fill(63, "PatientReleaseDate", "MM/dd/yyyy"); Fill(64, "PatientAssignment"); Fill(65, "PatientAssignmentDate", "MM/dd/yyyy"); Fill(66, "BillingDentist"); Fill(67, "BillingDentistPhoneFormatted"); Fill(68, "BillingDentistMedicaidID"); Fill(69, "BillingDentistSSNorTIN"); Fill(70, "PayToDentistAddress"); Fill(71, "PayToDentistAddress2"); Fill(72, "BillingDentistLicenseNum"); Fill(73, "DateService", "MM/dd/yyyy"); Fill(74, "PlaceIsOffice"); Fill(75, "PlaceIsHospADA2002"); Fill(76, "PlaceIsExtCareFacilityADA2002"); Fill(77, "PlaceIsOtherADA2002"); Fill(78, "PayToDentistCity"); Fill(79, "PayToDentistST"); Fill(80, "PayToDentistZip"); Fill(81, "IsRadiographsAttached"); Fill(82, "RadiographsNumAttached"); Fill(83, "RadiographsNotAttached"); Fill(84, "IsOrtho"); Fill(85, "IsNotOrtho"); Fill(86, "IsInitialProsth"); Fill(87, "IsReplacementProsth"); Fill(88, ""); //reason for replacement Fill(89, "DatePriorProsthPlaced", "MM/dd/yyyy"); Fill(90, "DateOrthoPlaced"); Fill(91, "MonthsOrthoRemaining"); Fill(92, "IsNotOccupational"); Fill(93, "IsOccupational"); Fill(94, ""); //description of occupational injury Fill(95, "IsAutoAccident"); Fill(96, "IsOtherAccident"); Fill(97, "IsNotAccident"); Fill(98, ""); //description of accident Fill(99, "TreatingDentistNPI"); //Individual NPI Fill(100, ""); //'' Fill(101, "BillingDentistNPI"); //Group NPI Fill(102, ""); //'' Fill(103, ""); //'' Fill(104, ""); //'' Fill(105, ""); //'' Fill(106, ""); //'' //proc 1 Fill(107, "P1Date", "MM/dd/yyyy"); Fill(108, "P1ToothNumber"); Fill(109, "P1Surface"); Fill(110, ""); //diag index Fill(111, "P1Code"); Fill(112, ""); //quantity Fill(113, "P1Description"); Fill(114, "P1Fee"); //proc 2 Fill(115, "P2Date", "MM/dd/yyyy"); Fill(116, "P2ToothNumber"); Fill(117, "P2Surface"); Fill(118, ""); Fill(119, "P2Code"); Fill(120, ""); Fill(121, "P2Description"); Fill(122, "P2Fee"); //proc 3 Fill(123, "P3Date", "MM/dd/yyyy"); Fill(124, "P3ToothNumber"); Fill(125, "P3Surface"); Fill(126, ""); Fill(127, "P3Code"); Fill(128, ""); Fill(129, "P3Description"); Fill(130, "P3Fee"); //proc 4 Fill(131, "P4Date", "MM/dd/yyyy"); Fill(132, "P4ToothNumber"); Fill(133, "P4Surface"); Fill(134, ""); Fill(135, "P4Code"); Fill(136, ""); Fill(137, "P4Description"); Fill(138, "P4Fee"); //proc 5 Fill(139, "P5Date", "MM/dd/yyyy"); Fill(140, "P5ToothNumber"); Fill(141, "P5Surface"); Fill(142, ""); Fill(143, "P5Code"); Fill(144, ""); Fill(145, "P5Description"); Fill(146, "P5Fee"); //proc 6 Fill(147, "P6Date", "MM/dd/yyyy"); Fill(148, "P6ToothNumber"); Fill(149, "P6Surface"); Fill(150, ""); Fill(151, "P6Code"); Fill(152, ""); Fill(153, "P6Description"); Fill(154, "P6Fee"); //proc 7 Fill(155, "P7Date", "MM/dd/yyyy"); Fill(156, "P7ToothNumber"); Fill(157, "P7Surface"); Fill(158, ""); Fill(159, "P7Code"); Fill(160, ""); Fill(161, "P7Description"); Fill(162, "P7Fee"); //proc 8 Fill(163, "P8Date", "MM/dd/yyyy"); Fill(164, "P8ToothNumber"); Fill(165, "P8Surface"); Fill(166, ""); Fill(167, "P8Code"); Fill(168, ""); Fill(169, "P8Description"); Fill(170, "P8Fee"); //end of procs Fill(171, "TotalFee"); Fill(172, ""); //payment by other plan. Only applicable on secondary insurance. Fill(173, ""); //max allowable Fill(174, ""); //deductible Fill(175, ""); //carrier percent Fill(176, ""); //carrier pays Fill(177, ""); //patient pays Fill(178, ""); //Work injury. Only x is accepted. Fill(179, "P1Area"); Fill(180, ""); Fill(181, "P2Area"); Fill(182, ""); Fill(183, "P3Area"); Fill(184, ""); Fill(185, "P4Area"); Fill(186, ""); Fill(187, "P5Area"); Fill(188, ""); Fill(189, "P6Area"); Fill(190, ""); Fill(191, "P7Area"); Fill(192, ""); Fill(193, "P8Area"); Fill(194, ""); Fill(195, ""); Fill(196, "P9Area"); Fill(197, ""); Fill(198, ""); Fill(199, ""); Fill(200, ""); Fill(201, ""); Fill(202, ""); Fill(203, ""); Fill(204, "P10Area"); Fill(205, ""); Fill(206, ""); Fill(207, ""); Fill(208, ""); Fill(209, ""); Fill(210, ""); Fill(211, ""); Fill(212, ""); Fill(213, ""); Fill(214, ""); Fill(215, ""); Fill(216, "OtherInsCarrierName"); //COB insurance company name Fill(217, "OtherInsAddress"); //COB address Fill(218, "OtherInsCity"); //COB ins City Fill(219, "OtherInsST"); //COB ins State Fill(220, "OtherInsZip"); //COB Zip Fill(221, ""); Fill(222, ""); Fill(223, ""); Fill(224, ""); Fill(225, ""); Fill(226, ""); Fill(227, ""); Fill(228, ""); Fill(229, ""); Fill(230, "Remarks"); Fill(231, ""); Fill(232, ""); Fill(233, ""); Fill(234, "TreatingDentistSignature"); //Treating Dentist Signature - Will accept any text string Fill(235, "TreatingDentistLicense"); //Treating License # - Will accept any text string Fill(236, "TreatingDentistSigDate"); //Date Signed - Expecting MM/DD/YYYY Fill(237, "TreatingDentistAddress"); //Address Where Procedure Performed - Will accept any text string Fill(238, "TreatingDentistCity"); //City Where Procedure Performed - Will accept any text string Fill(239, "TreatingDentistST"); //State Where Procedure Performed - Will accept any text string Fill(240, "TreatingDentistZip"); //Zip Code Where Procedure Performed - Expecting 5 digit ClaimFormItem[] listForForm = new ClaimFormItem[241]; //items.CopyTo(ClaimFormItems.ListForForm,0); FormClaimPrint FormCP = new FormClaimPrint(); FormCP.ClaimNumCur = claimNum; FormCP.PatNumCur = patNum; FormCP.ClaimFormCur = new ClaimForm(); FormCP.ClaimFormCur.Items = new ClaimFormItem[items.Length]; items.CopyTo(FormCP.ClaimFormCur.Items, 0); DisplayStrings = FormCP.FillRenaissance(); SaveFile(batchNum); return(true); }
///<summary>Inserts one ClaimFormItem into the database. Returns the new priKey. Doesn't use the cache.</summary> public static long InsertNoCache(ClaimFormItem claimFormItem) { return(InsertNoCache(claimFormItem, false)); }
///<summary>Updates one ClaimFormItem in the database. Uses an old object to compare to, and only alters changed fields. This prevents collisions and concurrency problems in heavily used tables.</summary> public static void Update(ClaimFormItem claimFormItem, ClaimFormItem oldClaimFormItem) { string command = ""; if (claimFormItem.ClaimFormNum != oldClaimFormItem.ClaimFormNum) { if (command != "") { command += ","; } command += "ClaimFormNum = " + POut.Long(claimFormItem.ClaimFormNum) + ""; } if (claimFormItem.ImageFileName != oldClaimFormItem.ImageFileName) { if (command != "") { command += ","; } command += "ImageFileName = '" + POut.String(claimFormItem.ImageFileName) + "'"; } if (claimFormItem.FieldName != oldClaimFormItem.FieldName) { if (command != "") { command += ","; } command += "FieldName = '" + POut.String(claimFormItem.FieldName) + "'"; } if (claimFormItem.FormatString != oldClaimFormItem.FormatString) { if (command != "") { command += ","; } command += "FormatString = '" + POut.String(claimFormItem.FormatString) + "'"; } if (claimFormItem.XPos != oldClaimFormItem.XPos) { if (command != "") { command += ","; } command += "XPos = " + POut.Float(claimFormItem.XPos) + ""; } if (claimFormItem.YPos != oldClaimFormItem.YPos) { if (command != "") { command += ","; } command += "YPos = " + POut.Float(claimFormItem.YPos) + ""; } if (claimFormItem.Width != oldClaimFormItem.Width) { if (command != "") { command += ","; } command += "Width = " + POut.Float(claimFormItem.Width) + ""; } if (claimFormItem.Height != oldClaimFormItem.Height) { if (command != "") { command += ","; } command += "Height = " + POut.Float(claimFormItem.Height) + ""; } if (command == "") { return; } command = "UPDATE claimformitem SET " + command + " WHERE ClaimFormItemNum = " + POut.Long(claimFormItem.ClaimFormItemNum); Db.NonQ(command); }
///<summary>Updates one ClaimFormItem in the database.</summary> public static void Update(ClaimFormItem claimFormItem){ string command="UPDATE claimformitem SET " +"ClaimFormNum = "+POut.Long (claimFormItem.ClaimFormNum)+", " +"ImageFileName = '"+POut.String(claimFormItem.ImageFileName)+"', " +"FieldName = '"+POut.String(claimFormItem.FieldName)+"', " +"FormatString = '"+POut.String(claimFormItem.FormatString)+"', " +"XPos = "+POut.Float (claimFormItem.XPos)+", " +"YPos = "+POut.Float (claimFormItem.YPos)+", " +"Width = "+POut.Float (claimFormItem.Width)+", " +"Height = "+POut.Float (claimFormItem.Height)+" " +"WHERE ClaimFormItemNum = "+POut.Long(claimFormItem.ClaimFormItemNum); Db.NonQ(command); }
///<summary>Updates one ClaimFormItem in the database. Uses an old object to compare to, and only alters changed fields. This prevents collisions and concurrency problems in heavily used tables. Returns true if an update occurred.</summary> public static bool Update(ClaimFormItem claimFormItem,ClaimFormItem oldClaimFormItem){ string command=""; if(claimFormItem.ClaimFormNum != oldClaimFormItem.ClaimFormNum) { if(command!=""){ command+=",";} command+="ClaimFormNum = "+POut.Long(claimFormItem.ClaimFormNum)+""; } if(claimFormItem.ImageFileName != oldClaimFormItem.ImageFileName) { if(command!=""){ command+=",";} command+="ImageFileName = '"+POut.String(claimFormItem.ImageFileName)+"'"; } if(claimFormItem.FieldName != oldClaimFormItem.FieldName) { if(command!=""){ command+=",";} command+="FieldName = '"+POut.String(claimFormItem.FieldName)+"'"; } if(claimFormItem.FormatString != oldClaimFormItem.FormatString) { if(command!=""){ command+=",";} command+="FormatString = '"+POut.String(claimFormItem.FormatString)+"'"; } if(claimFormItem.XPos != oldClaimFormItem.XPos) { if(command!=""){ command+=",";} command+="XPos = "+POut.Float(claimFormItem.XPos)+""; } if(claimFormItem.YPos != oldClaimFormItem.YPos) { if(command!=""){ command+=",";} command+="YPos = "+POut.Float(claimFormItem.YPos)+""; } if(claimFormItem.Width != oldClaimFormItem.Width) { if(command!=""){ command+=",";} command+="Width = "+POut.Float(claimFormItem.Width)+""; } if(claimFormItem.Height != oldClaimFormItem.Height) { if(command!=""){ command+=",";} command+="Height = "+POut.Float(claimFormItem.Height)+""; } if(command==""){ return false; } command="UPDATE claimformitem SET "+command +" WHERE ClaimFormItemNum = "+POut.Long(claimFormItem.ClaimFormItemNum); Db.NonQ(command); return true; }