public void savecategoryinmssqldb(categorydto _categorydto) { string saveinmssql = utilzsingleton.getInstance(_notificationmessageEventname).getappsettinggivenkey("saveinmssql", "false"); bool _saveinmssql; bool _trysaveinmssql = bool.TryParse(saveinmssql, out _saveinmssql); if (_saveinmssql) { bool numberOfRowsAffected = false; numberOfRowsAffected = mssqlapisingleton.getInstance(_notificationmessageEventname, _progressBarNotificationEventname).createcategoryindatabase(_categorydto, DBContract.getdefaultmssqlconnectionstring()); if (numberOfRowsAffected) { _notificationmessageEventname.Invoke(this, new notificationmessageEventArgs("successfully created category in mssql db { " + Environment.NewLine + "category name: " + _categorydto.category_name + "," + Environment.NewLine + "status: " + _categorydto.category_status + " }.", TAG)); printrecordcountoninsert(systementityconstants.category, datastoreconstants.mssql); } } }
public void savepestinsecticideinmssqldb(pestinsecticidedto _pestinsecticidedto) { string saveinmssql = utilzsingleton.getInstance(_notificationmessageEventname).getappsettinggivenkey("saveinmssql", "false"); bool _saveinmssql; bool _trysaveinmssql = bool.TryParse(saveinmssql, out _saveinmssql); if (_saveinmssql) { bool numberOfRowsAffected = false; numberOfRowsAffected = mssqlapisingleton.getInstance(_notificationmessageEventname, _progressBarNotificationEventname).createpestinsecticideindatabase(_pestinsecticidedto, DBContract.getdefaultmssqlconnectionstring()); if (numberOfRowsAffected) { _notificationmessageEventname.Invoke(this, new notificationmessageEventArgs("successfully created pesticide/insecticide in mssql db { " + Environment.NewLine + "pestinsecticidename: " + _pestinsecticidedto.pestinsecticide_name + "," + Environment.NewLine + " category: " + _pestinsecticidedto.pestinsecticide_category + "," + Environment.NewLine + " manufacturer: " + _pestinsecticidedto.pestinsecticide_manufacturer_id + "," + Environment.NewLine + " disease/pest: " + _pestinsecticidedto.pestinsecticide_crop_disease_id + "," + Environment.NewLine + " status: " + _pestinsecticidedto.pestinsecticide_status + " }.", TAG)); printrecordcountoninsert(systementityconstants.pestinsecticide, datastoreconstants.mssql); } } }