コード例 #1
0
        ///<summary>Updates one ToothInitial in the database.</summary>
        public static void Update(ToothInitial toothInitial)
        {
            string command = "UPDATE toothinitial SET "
                             + "PatNum         =  " + POut.Long(toothInitial.PatNum) + ", "
                             + "ToothNum       = '" + POut.String(toothInitial.ToothNum) + "', "
                             + "InitialType    =  " + POut.Int((int)toothInitial.InitialType) + ", "
                             + "Movement       =  " + POut.Float(toothInitial.Movement) + ", "
                             + "DrawingSegment =  " + DbHelper.ParamChar + "paramDrawingSegment, "
                             + "ColorDraw      =  " + POut.Int(toothInitial.ColorDraw.ToArgb()) + " "
                             + "WHERE ToothInitialNum = " + POut.Long(toothInitial.ToothInitialNum);

            if (toothInitial.DrawingSegment == null)
            {
                toothInitial.DrawingSegment = "";
            }
            OdSqlParameter paramDrawingSegment = new OdSqlParameter("paramDrawingSegment", OdDbType.Text, POut.StringParam(toothInitial.DrawingSegment));

            Db.NonQ(command, paramDrawingSegment);
        }
コード例 #2
0
        ///<summary>Inserts one EvaluationCriterion into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(EvaluationCriterion evaluationCriterion, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                evaluationCriterion.EvaluationCriterionNum = ReplicationServers.GetKey("evaluationcriterion", "EvaluationCriterionNum");
            }
            string command = "INSERT INTO evaluationcriterion (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "EvaluationCriterionNum,";
            }
            command += "EvaluationNum,CriterionDescript,IsCategoryName,GradingScaleNum,GradeShowing,GradeNumber,Notes,ItemOrder,MaxPointsPoss) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(evaluationCriterion.EvaluationCriterionNum) + ",";
            }
            command +=
                POut.Long(evaluationCriterion.EvaluationNum) + ","
                + "'" + POut.String(evaluationCriterion.CriterionDescript) + "',"
                + POut.Bool(evaluationCriterion.IsCategoryName) + ","
                + POut.Long(evaluationCriterion.GradingScaleNum) + ","
                + "'" + POut.String(evaluationCriterion.GradeShowing) + "',"
                + POut.Float(evaluationCriterion.GradeNumber) + ","
                + DbHelper.ParamChar + "paramNotes,"
                + POut.Int(evaluationCriterion.ItemOrder) + ","
                + POut.Float(evaluationCriterion.MaxPointsPoss) + ")";
            if (evaluationCriterion.Notes == null)
            {
                evaluationCriterion.Notes = "";
            }
            OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(evaluationCriterion.Notes));

            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command, paramNotes);
            }
            else
            {
                evaluationCriterion.EvaluationCriterionNum = Db.NonQ(command, true, "EvaluationCriterionNum", "evaluationCriterion", paramNotes);
            }
            return(evaluationCriterion.EvaluationCriterionNum);
        }
コード例 #3
0
ファイル: SupplyCrud.cs プロジェクト: kjb7749/testImport
        ///<summary>Inserts one Supply into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(Supply supply, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO supply (";

            if (!useExistingPK && isRandomKeys)
            {
                supply.SupplyNum = ReplicationServers.GetKeyNoCache("supply", "SupplyNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "SupplyNum,";
            }
            command += "SupplierNum,CatalogNumber,Descript,Category,ItemOrder,LevelDesired,IsHidden,Price,BarCodeOrID,DispDefaultQuant,DispUnitsCount,DispUnitDesc,LevelOnHand) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(supply.SupplyNum) + ",";
            }
            command +=
                POut.Long(supply.SupplierNum) + ","
                + "'" + POut.String(supply.CatalogNumber) + "',"
                + "'" + POut.String(supply.Descript) + "',"
                + POut.Long(supply.Category) + ","
                + POut.Int(supply.ItemOrder) + ","
                + POut.Float(supply.LevelDesired) + ","
                + POut.Bool(supply.IsHidden) + ","
                + "'" + POut.Double(supply.Price) + "',"
                + "'" + POut.String(supply.BarCodeOrID) + "',"
                + POut.Float(supply.DispDefaultQuant) + ","
                + POut.Int(supply.DispUnitsCount) + ","
                + "'" + POut.String(supply.DispUnitDesc) + "',"
                + POut.Float(supply.LevelOnHand) + ")";
            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                supply.SupplyNum = Db.NonQ(command, true, "SupplyNum", "supply");
            }
            return(supply.SupplyNum);
        }
コード例 #4
0
        ///<summary>Inserts one EhrProvKey into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(EhrProvKey ehrProvKey, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO ehrprovkey (";

            if (!useExistingPK && isRandomKeys)
            {
                ehrProvKey.EhrProvKeyNum = ReplicationServers.GetKeyNoCache("ehrprovkey", "EhrProvKeyNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "EhrProvKeyNum,";
            }
            command += "PatNum,LName,FName,ProvKey,FullTimeEquiv,Notes,YearValue) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(ehrProvKey.EhrProvKeyNum) + ",";
            }
            command +=
                POut.Long(ehrProvKey.PatNum) + ","
                + "'" + POut.String(ehrProvKey.LName) + "',"
                + "'" + POut.String(ehrProvKey.FName) + "',"
                + "'" + POut.String(ehrProvKey.ProvKey) + "',"
                + POut.Float(ehrProvKey.FullTimeEquiv) + ","
                + DbHelper.ParamChar + "paramNotes,"
                + POut.Int(ehrProvKey.YearValue) + ")";
            if (ehrProvKey.Notes == null)
            {
                ehrProvKey.Notes = "";
            }
            OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(ehrProvKey.Notes));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramNotes);
            }
            else
            {
                ehrProvKey.EhrProvKeyNum = Db.NonQ(command, true, "EhrProvKeyNum", "ehrProvKey", paramNotes);
            }
            return(ehrProvKey.EhrProvKeyNum);
        }
コード例 #5
0
        ///<summary>Updates one WebForms_SheetFieldDef in the database.</summary>
        public static void Update(WebForms_SheetFieldDef webForms_SheetFieldDef)
        {
            string command = "UPDATE webforms_sheetfielddef SET "
                             + "WebSheetDefID           =  " + POut.Long(webForms_SheetFieldDef.WebSheetDefID) + ", "
                             + "FieldType               =  " + POut.Int((int)webForms_SheetFieldDef.FieldType) + ", "
                             + "FieldName               = '" + POut.String(webForms_SheetFieldDef.FieldName) + "', "
                             + "FieldValue              =  " + DbHelper.ParamChar + "paramFieldValue, "
                             + "FontSize                =  " + POut.Float(webForms_SheetFieldDef.FontSize) + ", "
                             + "FontName                = '" + POut.String(webForms_SheetFieldDef.FontName) + "', "
                             + "FontIsBold              =  " + POut.Bool(webForms_SheetFieldDef.FontIsBold) + ", "
                             + "XPos                    =  " + POut.Int(webForms_SheetFieldDef.XPos) + ", "
                             + "YPos                    =  " + POut.Int(webForms_SheetFieldDef.YPos) + ", "
                             + "Width                   =  " + POut.Int(webForms_SheetFieldDef.Width) + ", "
                             + "Height                  =  " + POut.Int(webForms_SheetFieldDef.Height) + ", "
                             + "GrowthBehavior          =  " + POut.Int((int)webForms_SheetFieldDef.GrowthBehavior) + ", "
                             + "RadioButtonValue        = '" + POut.String(webForms_SheetFieldDef.RadioButtonValue) + "', "
                             + "RadioButtonGroup        = '" + POut.String(webForms_SheetFieldDef.RadioButtonGroup) + "', "
                             + "IsRequired              =  " + POut.Bool(webForms_SheetFieldDef.IsRequired) + ", "
                             + "ImageData               =  " + DbHelper.ParamChar + "paramImageData, "
                             + "TabOrder                =  " + POut.Int(webForms_SheetFieldDef.TabOrder) + ", "
                             + "ReportableName          = '" + POut.String(webForms_SheetFieldDef.ReportableName) + "', "
                             + "TextAlign               =  " + POut.Int((int)webForms_SheetFieldDef.TextAlign) + ", "
                             + "ItemColor               =  " + POut.Int(webForms_SheetFieldDef.ItemColor.ToArgb()) + ", "
                             + "TabOrderMobile          =  " + POut.Int(webForms_SheetFieldDef.TabOrderMobile) + ", "
                             + "UiLabelMobile           = '" + POut.String(webForms_SheetFieldDef.UiLabelMobile) + "', "
                             + "UiLabelMobileRadioButton= '" + POut.String(webForms_SheetFieldDef.UiLabelMobileRadioButton) + "' "
                             + "WHERE WebSheetFieldDefID = " + POut.Long(webForms_SheetFieldDef.WebSheetFieldDefID);

            if (webForms_SheetFieldDef.FieldValue == null)
            {
                webForms_SheetFieldDef.FieldValue = "";
            }
            OdSqlParameter paramFieldValue = new OdSqlParameter("paramFieldValue", OdDbType.Text, webForms_SheetFieldDef.FieldValue);

            if (webForms_SheetFieldDef.ImageData == null)
            {
                webForms_SheetFieldDef.ImageData = "";
            }
            OdSqlParameter paramImageData = new OdSqlParameter("paramImageData", OdDbType.Text, webForms_SheetFieldDef.ImageData);

            DataCore.NonQ(command, paramFieldValue, paramImageData);
        }
コード例 #6
0
ファイル: SupplyCrud.cs プロジェクト: kjb7749/testImport
        ///<summary>Updates one Supply in the database.</summary>
        public static void Update(Supply supply)
        {
            string command = "UPDATE supply SET "
                             + "SupplierNum     =  " + POut.Long(supply.SupplierNum) + ", "
                             + "CatalogNumber   = '" + POut.String(supply.CatalogNumber) + "', "
                             + "Descript        = '" + POut.String(supply.Descript) + "', "
                             + "Category        =  " + POut.Long(supply.Category) + ", "
                             + "ItemOrder       =  " + POut.Int(supply.ItemOrder) + ", "
                             + "LevelDesired    =  " + POut.Float(supply.LevelDesired) + ", "
                             + "IsHidden        =  " + POut.Bool(supply.IsHidden) + ", "
                             + "Price           = '" + POut.Double(supply.Price) + "', "
                             + "BarCodeOrID     = '" + POut.String(supply.BarCodeOrID) + "', "
                             + "DispDefaultQuant=  " + POut.Float(supply.DispDefaultQuant) + ", "
                             + "DispUnitsCount  =  " + POut.Int(supply.DispUnitsCount) + ", "
                             + "DispUnitDesc    = '" + POut.String(supply.DispUnitDesc) + "', "
                             + "LevelOnHand     =  " + POut.Float(supply.LevelOnHand) + " "
                             + "WHERE SupplyNum = " + POut.Long(supply.SupplyNum);

            Db.NonQ(command);
        }
コード例 #7
0
        ///<summary>Updates one EhrProvKey in the database.</summary>
        public static void Update(EhrProvKey ehrProvKey)
        {
            string command = "UPDATE ehrprovkey SET "
                             + "PatNum       =  " + POut.Long(ehrProvKey.PatNum) + ", "
                             + "LName        = '" + POut.String(ehrProvKey.LName) + "', "
                             + "FName        = '" + POut.String(ehrProvKey.FName) + "', "
                             + "ProvKey      = '" + POut.String(ehrProvKey.ProvKey) + "', "
                             + "FullTimeEquiv=  " + POut.Float(ehrProvKey.FullTimeEquiv) + ", "
                             + "Notes        =  " + DbHelper.ParamChar + "paramNotes, "
                             + "YearValue    =  " + POut.Int(ehrProvKey.YearValue) + " "
                             + "WHERE EhrProvKeyNum = " + POut.Long(ehrProvKey.EhrProvKeyNum);

            if (ehrProvKey.Notes == null)
            {
                ehrProvKey.Notes = "";
            }
            OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(ehrProvKey.Notes));

            Db.NonQ(command, paramNotes);
        }
コード例 #8
0
ファイル: SmsBillingCrud.cs プロジェクト: kjb7749/testImport
        ///<summary>Updates one SmsBilling in the database.</summary>
        public static void Update(SmsBilling smsBilling)
        {
            string command = "UPDATE smsbilling SET "
                             + "RegistrationKeyNum        =  " + POut.Long(smsBilling.RegistrationKeyNum) + ", "
                             + "CustPatNum                =  " + POut.Long(smsBilling.CustPatNum) + ", "
                             + "DateUsage                 =  " + POut.Date(smsBilling.DateUsage) + ", "
                             + "MsgChargeTotalUSD         =  " + POut.Float(smsBilling.MsgChargeTotalUSD) + ", "
                             + "AccessChargeTotalUSD      =  " + POut.Float(smsBilling.AccessChargeTotalUSD) + ", "
                             + "ClinicsTotalCount         =  " + POut.Int(smsBilling.ClinicsTotalCount) + ", "
                             + "ClinicsActiveCount        =  " + POut.Int(smsBilling.ClinicsActiveCount) + ", "
                             + "ClinicsUsedCount          =  " + POut.Int(smsBilling.ClinicsUsedCount) + ", "
                             + "PhonesTotalCount          =  " + POut.Int(smsBilling.PhonesTotalCount) + ", "
                             + "PhonesActiveCount         =  " + POut.Int(smsBilling.PhonesActiveCount) + ", "
                             + "PhonesUsedCount           =  " + POut.Int(smsBilling.PhonesUsedCount) + ", "
                             + "MsgSentOkCount            =  " + POut.Int(smsBilling.MsgSentOkCount) + ", "
                             + "MsgRcvOkCount             =  " + POut.Int(smsBilling.MsgRcvOkCount) + ", "
                             + "MsgSentFailCount          =  " + POut.Int(smsBilling.MsgSentFailCount) + ", "
                             + "MsgRcvFailCount           =  " + POut.Int(smsBilling.MsgRcvFailCount) + ", "
                             + "ConfirmationClinics       =  " + POut.Int(smsBilling.ConfirmationClinics) + ", "
                             + "ConfirmationsTotal        =  " + POut.Int(smsBilling.ConfirmationsTotal) + ", "
                             + "ConfirmationsEmail        =  " + POut.Int(smsBilling.ConfirmationsEmail) + ", "
                             + "ConfirmationsSms          =  " + POut.Int(smsBilling.ConfirmationsSms) + ", "
                             + "ConfirmationChargeTotalUSD=  " + POut.Float(smsBilling.ConfirmationChargeTotalUSD) + ", "
                             + "BillingDescSms            =  " + DbHelper.ParamChar + "paramBillingDescSms, "
                             + "BillingDescConfirmation   =  " + DbHelper.ParamChar + "paramBillingDescConfirmation "
                             + "WHERE SmsBillingNum = " + POut.Long(smsBilling.SmsBillingNum);

            if (smsBilling.BillingDescSms == null)
            {
                smsBilling.BillingDescSms = "";
            }
            OdSqlParameter paramBillingDescSms = new OdSqlParameter("paramBillingDescSms", OdDbType.Text, POut.StringParam(smsBilling.BillingDescSms));

            if (smsBilling.BillingDescConfirmation == null)
            {
                smsBilling.BillingDescConfirmation = "";
            }
            OdSqlParameter paramBillingDescConfirmation = new OdSqlParameter("paramBillingDescConfirmation", OdDbType.Text, POut.StringParam(smsBilling.BillingDescConfirmation));

            Db.NonQ(command, paramBillingDescSms, paramBillingDescConfirmation);
        }
コード例 #9
0
        ///<summary>Converts a list of WebForms_Sheet into a DataTable.</summary>
        public static DataTable ListToTable(List <WebForms_Sheet> listWebForms_Sheets, string tableName = "")
        {
            if (string.IsNullOrEmpty(tableName))
            {
                tableName = "WebForms_Sheet";
            }
            DataTable table = new DataTable(tableName);

            table.Columns.Add("SheetID");
            table.Columns.Add("DentalOfficeID");
            table.Columns.Add("Description");
            table.Columns.Add("SheetType");
            table.Columns.Add("DateTimeSheet");
            table.Columns.Add("FontSize");
            table.Columns.Add("FontName");
            table.Columns.Add("Width");
            table.Columns.Add("Height");
            table.Columns.Add("IsLandscape");
            table.Columns.Add("ClinicNum");
            table.Columns.Add("HasMobileLayout");
            table.Columns.Add("SheetDefNum");
            foreach (WebForms_Sheet webForms_Sheet in listWebForms_Sheets)
            {
                table.Rows.Add(new object[] {
                    POut.Long(webForms_Sheet.SheetID),
                    POut.Long(webForms_Sheet.DentalOfficeID),
                    webForms_Sheet.Description,
                    POut.Int((int)webForms_Sheet.SheetType),
                    POut.DateT(webForms_Sheet.DateTimeSheet),
                    POut.Float(webForms_Sheet.FontSize),
                    webForms_Sheet.FontName,
                    POut.Int(webForms_Sheet.Width),
                    POut.Int(webForms_Sheet.Height),
                    POut.Bool(webForms_Sheet.IsLandscape),
                    POut.Long(webForms_Sheet.ClinicNum),
                    POut.Bool(webForms_Sheet.HasMobileLayout),
                    POut.Long(webForms_Sheet.SheetDefNum),
                });
            }
            return(table);
        }
コード例 #10
0
ファイル: ToothInitialCrud.cs プロジェクト: royedwards/DRDNet
        ///<summary>Inserts one ToothInitial into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(ToothInitial toothInitial, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO toothinitial (";

            if (!useExistingPK && isRandomKeys)
            {
                toothInitial.ToothInitialNum = ReplicationServers.GetKeyNoCache("toothinitial", "ToothInitialNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "ToothInitialNum,";
            }
            command += "PatNum,ToothNum,InitialType,Movement,DrawingSegment,ColorDraw) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(toothInitial.ToothInitialNum) + ",";
            }
            command +=
                POut.Long(toothInitial.PatNum) + ","
                + "'" + POut.String(toothInitial.ToothNum) + "',"
                + POut.Int((int)toothInitial.InitialType) + ","
                + POut.Float(toothInitial.Movement) + ","
                + DbHelper.ParamChar + "paramDrawingSegment,"
                + POut.Int(toothInitial.ColorDraw.ToArgb()) + ")";
            if (toothInitial.DrawingSegment == null)
            {
                toothInitial.DrawingSegment = "";
            }
            OdSqlParameter paramDrawingSegment = new OdSqlParameter("paramDrawingSegment", OdDbType.Text, POut.StringParam(toothInitial.DrawingSegment));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramDrawingSegment);
            }
            else
            {
                toothInitial.ToothInitialNum = Db.NonQ(command, true, "ToothInitialNum", "toothInitial", paramDrawingSegment);
            }
            return(toothInitial.ToothInitialNum);
        }
コード例 #11
0
        ///<summary>Inserts one SheetDef into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(SheetDef sheetDef, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO sheetdef (";

            if (!useExistingPK && isRandomKeys)
            {
                sheetDef.SheetDefNum = ReplicationServers.GetKeyNoCache("sheetdef", "SheetDefNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "SheetDefNum,";
            }
            command += "Description,SheetType,FontSize,FontName,Width,Height,IsLandscape,PageCount,IsMultiPage,BypassGlobalLock,HasMobileLayout,DateTCreated) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(sheetDef.SheetDefNum) + ",";
            }
            command +=
                "'" + POut.String(sheetDef.Description) + "',"
                + POut.Int((int)sheetDef.SheetType) + ","
                + POut.Float(sheetDef.FontSize) + ","
                + "'" + POut.String(sheetDef.FontName) + "',"
                + POut.Int(sheetDef.Width) + ","
                + POut.Int(sheetDef.Height) + ","
                + POut.Bool(sheetDef.IsLandscape) + ","
                + POut.Int(sheetDef.PageCount) + ","
                + POut.Bool(sheetDef.IsMultiPage) + ","
                + POut.Int((int)sheetDef.BypassGlobalLock) + ","
                + POut.Bool(sheetDef.HasMobileLayout) + ","
                + POut.DateT(sheetDef.DateTCreated) + ")";
            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                sheetDef.SheetDefNum = Db.NonQ(command, true, "SheetDefNum", "sheetDef");
            }
            return(sheetDef.SheetDefNum);
        }
コード例 #12
0
        ///<summary>Converts a list of SheetDef into a DataTable.</summary>
        public static DataTable ListToTable(List <SheetDef> listSheetDefs, string tableName = "")
        {
            if (string.IsNullOrEmpty(tableName))
            {
                tableName = "SheetDef";
            }
            DataTable table = new DataTable(tableName);

            table.Columns.Add("SheetDefNum");
            table.Columns.Add("Description");
            table.Columns.Add("SheetType");
            table.Columns.Add("FontSize");
            table.Columns.Add("FontName");
            table.Columns.Add("Width");
            table.Columns.Add("Height");
            table.Columns.Add("IsLandscape");
            table.Columns.Add("PageCount");
            table.Columns.Add("IsMultiPage");
            table.Columns.Add("BypassGlobalLock");
            table.Columns.Add("HasMobileLayout");
            table.Columns.Add("DateTCreated");
            foreach (SheetDef sheetDef in listSheetDefs)
            {
                table.Rows.Add(new object[] {
                    POut.Long(sheetDef.SheetDefNum),
                    sheetDef.Description,
                    POut.Int((int)sheetDef.SheetType),
                    POut.Float(sheetDef.FontSize),
                    sheetDef.FontName,
                    POut.Int(sheetDef.Width),
                    POut.Int(sheetDef.Height),
                    POut.Bool(sheetDef.IsLandscape),
                    POut.Int(sheetDef.PageCount),
                    POut.Bool(sheetDef.IsMultiPage),
                    POut.Int((int)sheetDef.BypassGlobalLock),
                    POut.Bool(sheetDef.HasMobileLayout),
                    POut.DateT(sheetDef.DateTCreated, false),
                });
            }
            return(table);
        }
コード例 #13
0
ファイル: SheetCrud.cs プロジェクト: nampn/ODental
        ///<summary>Inserts one Sheet into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(Sheet sheet, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                sheet.SheetNum = ReplicationServers.GetKey("sheet", "SheetNum");
            }
            string command = "INSERT INTO sheet (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "SheetNum,";
            }
            command += "SheetType,PatNum,DateTimeSheet,FontSize,FontName,Width,Height,IsLandscape,InternalNote,Description,ShowInTerminal,IsWebForm) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(sheet.SheetNum) + ",";
            }
            command +=
                POut.Int((int)sheet.SheetType) + ","
                + POut.Long(sheet.PatNum) + ","
                + POut.DateT(sheet.DateTimeSheet) + ","
                + POut.Float(sheet.FontSize) + ","
                + "'" + POut.String(sheet.FontName) + "',"
                + POut.Int(sheet.Width) + ","
                + POut.Int(sheet.Height) + ","
                + POut.Bool(sheet.IsLandscape) + ","
                + "'" + POut.String(sheet.InternalNote) + "',"
                + "'" + POut.String(sheet.Description) + "',"
                + POut.Byte(sheet.ShowInTerminal) + ","
                + POut.Bool(sheet.IsWebForm) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                sheet.SheetNum = Db.NonQ(command, true);
            }
            return(sheet.SheetNum);
        }
コード例 #14
0
        ///<summary>Inserts one DispSupply into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(DispSupply dispSupply, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO dispsupply (";

            if (!useExistingPK && isRandomKeys)
            {
                dispSupply.DispSupplyNum = ReplicationServers.GetKeyNoCache("dispsupply", "DispSupplyNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "DispSupplyNum,";
            }
            command += "SupplyNum,ProvNum,DateDispensed,DispQuantity,Note) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(dispSupply.DispSupplyNum) + ",";
            }
            command +=
                POut.Long(dispSupply.SupplyNum) + ","
                + POut.Long(dispSupply.ProvNum) + ","
                + POut.Date(dispSupply.DateDispensed) + ","
                + POut.Float(dispSupply.DispQuantity) + ","
                + DbHelper.ParamChar + "paramNote)";
            if (dispSupply.Note == null)
            {
                dispSupply.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringNote(dispSupply.Note));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramNote);
            }
            else
            {
                dispSupply.DispSupplyNum = Db.NonQ(command, true, "DispSupplyNum", "dispSupply", paramNote);
            }
            return(dispSupply.DispSupplyNum);
        }
コード例 #15
0
        ///<summary>Updates one Evaluation in the database.</summary>
        public static void Update(Evaluation evaluation)
        {
            string command = "UPDATE evaluation SET "
                             + "InstructNum        =  " + POut.Long(evaluation.InstructNum) + ", "
                             + "StudentNum         =  " + POut.Long(evaluation.StudentNum) + ", "
                             + "SchoolCourseNum    =  " + POut.Long(evaluation.SchoolCourseNum) + ", "
                             + "EvalTitle          = '" + POut.String(evaluation.EvalTitle) + "', "
                             + "DateEval           =  " + POut.Date(evaluation.DateEval) + ", "
                             + "GradingScaleNum    =  " + POut.Long(evaluation.GradingScaleNum) + ", "
                             + "OverallGradeShowing= '" + POut.String(evaluation.OverallGradeShowing) + "', "
                             + "OverallGradeNumber =  " + POut.Float(evaluation.OverallGradeNumber) + ", "
                             + "Notes              =  " + DbHelper.ParamChar + "paramNotes "
                             + "WHERE EvaluationNum = " + POut.Long(evaluation.EvaluationNum);

            if (evaluation.Notes == null)
            {
                evaluation.Notes = "";
            }
            OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(evaluation.Notes));

            Db.NonQ(command, paramNotes);
        }
コード例 #16
0
        ///<summary>Updates one EvaluationCriterion in the database.</summary>
        public static void Update(EvaluationCriterion evaluationCriterion)
        {
            string command = "UPDATE evaluationcriterion SET "
                             + "EvaluationNum         =  " + POut.Long(evaluationCriterion.EvaluationNum) + ", "
                             + "CriterionDescript     = '" + POut.String(evaluationCriterion.CriterionDescript) + "', "
                             + "IsCategoryName        =  " + POut.Bool(evaluationCriterion.IsCategoryName) + ", "
                             + "GradingScaleNum       =  " + POut.Long(evaluationCriterion.GradingScaleNum) + ", "
                             + "GradeShowing          = '" + POut.String(evaluationCriterion.GradeShowing) + "', "
                             + "GradeNumber           =  " + POut.Float(evaluationCriterion.GradeNumber) + ", "
                             + "Notes                 =  " + DbHelper.ParamChar + "paramNotes, "
                             + "ItemOrder             =  " + POut.Int(evaluationCriterion.ItemOrder) + ", "
                             + "MaxPointsPoss         =  " + POut.Float(evaluationCriterion.MaxPointsPoss) + " "
                             + "WHERE EvaluationCriterionNum = " + POut.Long(evaluationCriterion.EvaluationCriterionNum);

            if (evaluationCriterion.Notes == null)
            {
                evaluationCriterion.Notes = "";
            }
            OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(evaluationCriterion.Notes));

            Db.NonQ(command, paramNotes);
        }
コード例 #17
0
ファイル: VitalsignCrud.cs プロジェクト: nampn/ODental
        ///<summary>Inserts one Vitalsign into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(Vitalsign vitalsign, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                vitalsign.VitalsignNum = ReplicationServers.GetKey("vitalsign", "VitalsignNum");
            }
            string command = "INSERT INTO vitalsign (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "VitalsignNum,";
            }
            command += "PatNum,Height,Weight,BpSystolic,BpDiastolic,DateTaken,HasFollowupPlan,IsIneligible,Documentation,ChildGotNutrition,ChildGotPhysCouns) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(vitalsign.VitalsignNum) + ",";
            }
            command +=
                POut.Long(vitalsign.PatNum) + ","
                + POut.Float(vitalsign.Height) + ","
                + POut.Float(vitalsign.Weight) + ","
                + POut.Int(vitalsign.BpSystolic) + ","
                + POut.Int(vitalsign.BpDiastolic) + ","
                + POut.Date(vitalsign.DateTaken) + ","
                + POut.Bool(vitalsign.HasFollowupPlan) + ","
                + POut.Bool(vitalsign.IsIneligible) + ","
                + "'" + POut.String(vitalsign.Documentation) + "',"
                + POut.Bool(vitalsign.ChildGotNutrition) + ","
                + POut.Bool(vitalsign.ChildGotPhysCouns) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                vitalsign.VitalsignNum = Db.NonQ(command, true);
            }
            return(vitalsign.VitalsignNum);
        }
コード例 #18
0
        ///<summary>Inserts one ClaimForm into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(ClaimForm claimForm, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO claimform (";

            if (!useExistingPK && isRandomKeys)
            {
                claimForm.ClaimFormNum = ReplicationServers.GetKeyNoCache("claimform", "ClaimFormNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "ClaimFormNum,";
            }
            command += "Description,IsHidden,FontName,FontSize,UniqueID,PrintImages,OffsetX,OffsetY,Width,Height) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(claimForm.ClaimFormNum) + ",";
            }
            command +=
                "'" + POut.String(claimForm.Description) + "',"
                + POut.Bool(claimForm.IsHidden) + ","
                + "'" + POut.String(claimForm.FontName) + "',"
                + POut.Float(claimForm.FontSize) + ","
                + "'" + POut.String(claimForm.UniqueID) + "',"
                + POut.Bool(claimForm.PrintImages) + ","
                + POut.Int(claimForm.OffsetX) + ","
                + POut.Int(claimForm.OffsetY) + ","
                + POut.Int(claimForm.Width) + ","
                + POut.Int(claimForm.Height) + ")";
            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                claimForm.ClaimFormNum = Db.NonQ(command, true, "ClaimFormNum", "claimForm");
            }
            return(claimForm.ClaimFormNum);
        }
コード例 #19
0
ファイル: SheetDefCrud.cs プロジェクト: royedwards/DRDNet
        ///<summary>Inserts one SheetDef into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(SheetDef sheetDef, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                sheetDef.SheetDefNum = ReplicationServers.GetKey("sheetdef", "SheetDefNum");
            }
            string command = "INSERT INTO sheetdef (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "SheetDefNum,";
            }
            command += "Description,SheetType,FontSize,FontName,Width,Height,IsLandscape,PageCount,IsMultiPage,BypassGlobalLock) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(sheetDef.SheetDefNum) + ",";
            }
            command +=
                "'" + POut.String(sheetDef.Description) + "',"
                + POut.Int((int)sheetDef.SheetType) + ","
                + POut.Float(sheetDef.FontSize) + ","
                + "'" + POut.String(sheetDef.FontName) + "',"
                + POut.Int(sheetDef.Width) + ","
                + POut.Int(sheetDef.Height) + ","
                + POut.Bool(sheetDef.IsLandscape) + ","
                + POut.Int(sheetDef.PageCount) + ","
                + POut.Bool(sheetDef.IsMultiPage) + ","
                + POut.Int((int)sheetDef.BypassGlobalLock) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                sheetDef.SheetDefNum = Db.NonQ(command, true, "SheetDefNum", "sheetDef");
            }
            return(sheetDef.SheetDefNum);
        }
コード例 #20
0
        ///<summary>Converts a list of ClaimForm into a DataTable.</summary>
        public static DataTable ListToTable(List <ClaimForm> listClaimForms, string tableName = "")
        {
            if (string.IsNullOrEmpty(tableName))
            {
                tableName = "ClaimForm";
            }
            DataTable table = new DataTable(tableName);

            table.Columns.Add("ClaimFormNum");
            table.Columns.Add("Description");
            table.Columns.Add("IsHidden");
            table.Columns.Add("FontName");
            table.Columns.Add("FontSize");
            table.Columns.Add("UniqueID");
            table.Columns.Add("PrintImages");
            table.Columns.Add("OffsetX");
            table.Columns.Add("OffsetY");
            table.Columns.Add("Width");
            table.Columns.Add("Height");
            foreach (ClaimForm claimForm in listClaimForms)
            {
                table.Rows.Add(new object[] {
                    POut.Long(claimForm.ClaimFormNum),
                    claimForm.Description,
                    POut.Bool(claimForm.IsHidden),
                    claimForm.FontName,
                    POut.Float(claimForm.FontSize),
                    claimForm.UniqueID,
                    POut.Bool(claimForm.PrintImages),
                    POut.Int(claimForm.OffsetX),
                    POut.Int(claimForm.OffsetY),
                    POut.Int(claimForm.Width),
                    POut.Int(claimForm.Height),
                });
            }
            return(table);
        }
コード例 #21
0
        ///<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);
        }
コード例 #22
0
        ///<summary>Inserts one VaccinePat into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(VaccinePat vaccinePat, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                vaccinePat.VaccinePatNum = ReplicationServers.GetKey("vaccinepat", "VaccinePatNum");
            }
            string command = "INSERT INTO vaccinepat (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "VaccinePatNum,";
            }
            command += "VaccineDefNum,DateTimeStart,DateTimeEnd,AdministeredAmt,DrugUnitNum,LotNumber,PatNum,NotGiven,Note) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(vaccinePat.VaccinePatNum) + ",";
            }
            command +=
                POut.Long(vaccinePat.VaccineDefNum) + ","
                + POut.DateT(vaccinePat.DateTimeStart) + ","
                + POut.DateT(vaccinePat.DateTimeEnd) + ","
                + POut.Float(vaccinePat.AdministeredAmt) + ","
                + POut.Long(vaccinePat.DrugUnitNum) + ","
                + "'" + POut.String(vaccinePat.LotNumber) + "',"
                + POut.Long(vaccinePat.PatNum) + ","
                + POut.Bool(vaccinePat.NotGiven) + ","
                + "'" + POut.String(vaccinePat.Note) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                vaccinePat.VaccinePatNum = Db.NonQ(command, true);
            }
            return(vaccinePat.VaccinePatNum);
        }
コード例 #23
0
ファイル: ClaimFormItemCrud.cs プロジェクト: nampn/ODental
        ///<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);
        }
コード例 #24
0
        ///<summary>Inserts one Supply into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(Supply supply, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                supply.SupplyNum = ReplicationServers.GetKey("supply", "SupplyNum");
            }
            string command = "INSERT INTO supply (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "SupplyNum,";
            }
            command += "SupplierNum,CatalogNumber,Descript,Category,ItemOrder,LevelDesired,IsHidden,Price) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(supply.SupplyNum) + ",";
            }
            command +=
                POut.Long(supply.SupplierNum) + ","
                + "'" + POut.String(supply.CatalogNumber) + "',"
                + "'" + POut.String(supply.Descript) + "',"
                + POut.Long(supply.Category) + ","
                + POut.Int(supply.ItemOrder) + ","
                + POut.Float(supply.LevelDesired) + ","
                + POut.Bool(supply.IsHidden) + ","
                + "'" + POut.Double(supply.Price) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                supply.SupplyNum = Db.NonQ(command, true);
            }
            return(supply.SupplyNum);
        }
コード例 #25
0
        ///<summary>Inserts one WebForms_Sheet into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(WebForms_Sheet webForms_Sheet, bool useExistingPK)
        {
            string command = "INSERT INTO webforms_sheet (";

            if (useExistingPK)
            {
                command += "SheetID,";
            }
            command += "DentalOfficeID,Description,SheetType,DateTimeSheet,FontSize,FontName,Width,Height,IsLandscape,ClinicNum,HasMobileLayout,SheetDefNum) VALUES(";
            if (useExistingPK)
            {
                command += POut.Long(webForms_Sheet.SheetID) + ",";
            }
            command +=
                POut.Long(webForms_Sheet.DentalOfficeID) + ","
                + "'" + POut.String(webForms_Sheet.Description) + "',"
                + POut.Int((int)webForms_Sheet.SheetType) + ","
                + POut.DateT(webForms_Sheet.DateTimeSheet) + ","
                + POut.Float(webForms_Sheet.FontSize) + ","
                + "'" + POut.String(webForms_Sheet.FontName) + "',"
                + POut.Int(webForms_Sheet.Width) + ","
                + POut.Int(webForms_Sheet.Height) + ","
                + POut.Bool(webForms_Sheet.IsLandscape) + ","
                + POut.Long(webForms_Sheet.ClinicNum) + ","
                + POut.Bool(webForms_Sheet.HasMobileLayout) + ","
                + POut.Long(webForms_Sheet.SheetDefNum) + ")";
            if (useExistingPK)
            {
                DataCore.NonQ(command);
            }
            else
            {
                webForms_Sheet.SheetID = DataCore.NonQ(command, true);
            }
            return(webForms_Sheet.SheetID);
        }
コード例 #26
0
ファイル: ClaimFormCrud.cs プロジェクト: steev90/opendental
        ///<summary>Inserts one ClaimForm into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(ClaimForm claimForm, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                claimForm.ClaimFormNum = ReplicationServers.GetKey("claimform", "ClaimFormNum");
            }
            string command = "INSERT INTO claimform (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ClaimFormNum,";
            }
            command += "Description,IsHidden,FontName,FontSize,UniqueID,PrintImages,OffsetX,OffsetY) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(claimForm.ClaimFormNum) + ",";
            }
            command +=
                "'" + POut.String(claimForm.Description) + "',"
                + POut.Bool(claimForm.IsHidden) + ","
                + "'" + POut.String(claimForm.FontName) + "',"
                + POut.Float(claimForm.FontSize) + ","
                + "'" + POut.String(claimForm.UniqueID) + "',"
                + POut.Bool(claimForm.PrintImages) + ","
                + POut.Int(claimForm.OffsetX) + ","
                + POut.Int(claimForm.OffsetY) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                claimForm.ClaimFormNum = Db.NonQ(command, true);
            }
            return(claimForm.ClaimFormNum);
        }
コード例 #27
0
ファイル: SheetCrud.cs プロジェクト: royedwards/DRDNet
        ///<summary>Updates one Sheet 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(Sheet sheet, Sheet oldSheet)
        {
            string command = "";

            if (sheet.SheetType != oldSheet.SheetType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SheetType = " + POut.Int((int)sheet.SheetType) + "";
            }
            if (sheet.PatNum != oldSheet.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(sheet.PatNum) + "";
            }
            if (sheet.DateTimeSheet != oldSheet.DateTimeSheet)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeSheet = " + POut.DateT(sheet.DateTimeSheet) + "";
            }
            if (sheet.FontSize != oldSheet.FontSize)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontSize = " + POut.Float(sheet.FontSize) + "";
            }
            if (sheet.FontName != oldSheet.FontName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontName = '" + POut.String(sheet.FontName) + "'";
            }
            if (sheet.Width != oldSheet.Width)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Width = " + POut.Int(sheet.Width) + "";
            }
            if (sheet.Height != oldSheet.Height)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Height = " + POut.Int(sheet.Height) + "";
            }
            if (sheet.IsLandscape != oldSheet.IsLandscape)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsLandscape = " + POut.Bool(sheet.IsLandscape) + "";
            }
            if (sheet.InternalNote != oldSheet.InternalNote)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "InternalNote = " + DbHelper.ParamChar + "paramInternalNote";
            }
            if (sheet.Description != oldSheet.Description)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Description = '" + POut.String(sheet.Description) + "'";
            }
            if (sheet.ShowInTerminal != oldSheet.ShowInTerminal)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ShowInTerminal = " + POut.Byte(sheet.ShowInTerminal) + "";
            }
            if (sheet.IsWebForm != oldSheet.IsWebForm)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsWebForm = " + POut.Bool(sheet.IsWebForm) + "";
            }
            if (sheet.IsMultiPage != oldSheet.IsMultiPage)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsMultiPage = " + POut.Bool(sheet.IsMultiPage) + "";
            }
            if (sheet.IsDeleted != oldSheet.IsDeleted)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsDeleted = " + POut.Bool(sheet.IsDeleted) + "";
            }
            if (sheet.SheetDefNum != oldSheet.SheetDefNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SheetDefNum = " + POut.Long(sheet.SheetDefNum) + "";
            }
            if (sheet.DocNum != oldSheet.DocNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DocNum = " + POut.Long(sheet.DocNum) + "";
            }
            if (sheet.ClinicNum != oldSheet.ClinicNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ClinicNum = " + POut.Long(sheet.ClinicNum) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (sheet.InternalNote == null)
            {
                sheet.InternalNote = "";
            }
            OdSqlParameter paramInternalNote = new OdSqlParameter("paramInternalNote", OdDbType.Text, POut.StringParam(sheet.InternalNote));

            command = "UPDATE sheet SET " + command
                      + " WHERE SheetNum = " + POut.Long(sheet.SheetNum);
            Db.NonQ(command, paramInternalNote);
            return(true);
        }
コード例 #28
0
        ///<summary>Updates one SheetDef 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(SheetDef sheetDef, SheetDef oldSheetDef)
        {
            string command = "";

            if (sheetDef.Description != oldSheetDef.Description)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Description = '" + POut.String(sheetDef.Description) + "'";
            }
            if (sheetDef.SheetType != oldSheetDef.SheetType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SheetType = " + POut.Int((int)sheetDef.SheetType) + "";
            }
            if (sheetDef.FontSize != oldSheetDef.FontSize)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontSize = " + POut.Float(sheetDef.FontSize) + "";
            }
            if (sheetDef.FontName != oldSheetDef.FontName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontName = '" + POut.String(sheetDef.FontName) + "'";
            }
            if (sheetDef.Width != oldSheetDef.Width)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Width = " + POut.Int(sheetDef.Width) + "";
            }
            if (sheetDef.Height != oldSheetDef.Height)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Height = " + POut.Int(sheetDef.Height) + "";
            }
            if (sheetDef.IsLandscape != oldSheetDef.IsLandscape)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsLandscape = " + POut.Bool(sheetDef.IsLandscape) + "";
            }
            if (sheetDef.PageCount != oldSheetDef.PageCount)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PageCount = " + POut.Int(sheetDef.PageCount) + "";
            }
            if (sheetDef.IsMultiPage != oldSheetDef.IsMultiPage)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsMultiPage = " + POut.Bool(sheetDef.IsMultiPage) + "";
            }
            if (sheetDef.BypassGlobalLock != oldSheetDef.BypassGlobalLock)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "BypassGlobalLock = " + POut.Int((int)sheetDef.BypassGlobalLock) + "";
            }
            if (sheetDef.HasMobileLayout != oldSheetDef.HasMobileLayout)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "HasMobileLayout = " + POut.Bool(sheetDef.HasMobileLayout) + "";
            }
            if (sheetDef.DateTCreated != oldSheetDef.DateTCreated)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTCreated = " + POut.DateT(sheetDef.DateTCreated) + "";
            }
            if (command == "")
            {
                return(false);
            }
            command = "UPDATE sheetdef SET " + command
                      + " WHERE SheetDefNum = " + POut.Long(sheetDef.SheetDefNum);
            Db.NonQ(command);
            return(true);
        }
コード例 #29
0
        ///<summary>Updates one EhrProvKey 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(EhrProvKey ehrProvKey, EhrProvKey oldEhrProvKey)
        {
            string command = "";

            if (ehrProvKey.PatNum != oldEhrProvKey.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(ehrProvKey.PatNum) + "";
            }
            if (ehrProvKey.LName != oldEhrProvKey.LName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "LName = '" + POut.String(ehrProvKey.LName) + "'";
            }
            if (ehrProvKey.FName != oldEhrProvKey.FName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FName = '" + POut.String(ehrProvKey.FName) + "'";
            }
            if (ehrProvKey.ProvKey != oldEhrProvKey.ProvKey)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProvKey = '" + POut.String(ehrProvKey.ProvKey) + "'";
            }
            if (ehrProvKey.FullTimeEquiv != oldEhrProvKey.FullTimeEquiv)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FullTimeEquiv = " + POut.Float(ehrProvKey.FullTimeEquiv) + "";
            }
            if (ehrProvKey.Notes != oldEhrProvKey.Notes)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Notes = " + DbHelper.ParamChar + "paramNotes";
            }
            if (ehrProvKey.YearValue != oldEhrProvKey.YearValue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "YearValue = " + POut.Int(ehrProvKey.YearValue) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (ehrProvKey.Notes == null)
            {
                ehrProvKey.Notes = "";
            }
            OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(ehrProvKey.Notes));

            command = "UPDATE ehrprovkey SET " + command
                      + " WHERE EhrProvKeyNum = " + POut.Long(ehrProvKey.EhrProvKeyNum);
            Db.NonQ(command, paramNotes);
            return(true);
        }
コード例 #30
0
        ///<summary>Updates one Supply 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(Supply supply, Supply oldSupply)
        {
            string command = "";

            if (supply.SupplierNum != oldSupply.SupplierNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SupplierNum = " + POut.Long(supply.SupplierNum) + "";
            }
            if (supply.CatalogNumber != oldSupply.CatalogNumber)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CatalogNumber = '" + POut.String(supply.CatalogNumber) + "'";
            }
            if (supply.Descript != oldSupply.Descript)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Descript = '" + POut.String(supply.Descript) + "'";
            }
            if (supply.Category != oldSupply.Category)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Category = " + POut.Long(supply.Category) + "";
            }
            if (supply.ItemOrder != oldSupply.ItemOrder)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ItemOrder = " + POut.Int(supply.ItemOrder) + "";
            }
            if (supply.LevelDesired != oldSupply.LevelDesired)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "LevelDesired = " + POut.Float(supply.LevelDesired) + "";
            }
            if (supply.IsHidden != oldSupply.IsHidden)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsHidden = " + POut.Bool(supply.IsHidden) + "";
            }
            if (supply.Price != oldSupply.Price)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Price = '" + POut.Double(supply.Price) + "'";
            }
            if (command == "")
            {
                return;
            }
            command = "UPDATE supply SET " + command
                      + " WHERE SupplyNum = " + POut.Long(supply.SupplyNum);
            Db.NonQ(command);
        }