public bool UpdateVersionInfo(VersionInfoTask VersionObject, string Mode, string CustId) { bool Update; try { string SqlQuery; if (Mode == "Update") { SqlQuery = "Update VersionInfo Set VersionNumber='" + VersionObject.VersionNumber + "', Details='" + VersionObject.Details + "', InstallDate='" + VersionObject.InstallDate + "' where ID=" + VersionObject.ID; } else { SqlQuery = "Insert into VersionInfo(CustId, VersionNumber,InstallDate, Details) values (" + CustId + ", '" + VersionObject.VersionNumber + "','" + VersionObject.InstallDate + "', '" + VersionObject.Details + "')"; } Update = objAdaptor.ExecuteNonQuery(SqlQuery); } catch { Update = false; } finally { } return(Update); }
public VersionInfoTask GetVersionInfoDataForID(VersionInfoTask VersionInfObject, string Mode) { DataTable VersionInfoTable = new DataTable(); VersionInfoTask ReturnVersionInfoObject = new VersionInfoTask(); try { string SqlQuery = "Select vi.* from VersionInfo vi where vi.ID =" + VersionInfObject.ID.ToString(); VersionInfoTable = objAdaptor.FetchData(SqlQuery); if (VersionInfoTable != null && VersionInfoTable.Rows.Count == 1) { ReturnVersionInfoObject.ID = int.Parse(VersionInfoTable.Rows[0]["ID"].ToString()); ReturnVersionInfoObject.CustID = int.Parse(VersionInfoTable.Rows[0]["CustID"].ToString()); ReturnVersionInfoObject.VersionNumber = VersionInfoTable.Rows[0]["VersionNumber"].ToString(); ReturnVersionInfoObject.InstallDate = VersionInfoTable.Rows[0]["InstallDate"].ToString(); ReturnVersionInfoObject.Details = VersionInfoTable.Rows[0]["Details"].ToString(); } } catch { } finally { } return(ReturnVersionInfoObject); }
private void InsertVersionInfo() { try { bool update = false; VersionInfoTask VersionObject = new VersionInfoTask(); //VersionObject.ID = Convert.ToInt32(Request.QueryString["VersionInfoID"].ToString()); VersionObject.CustID = Convert.ToInt32(CustomerComboBox.SelectedItem.Value); VersionObject.VersionNumber = VersionNumberTextbox.Text; //VersionObject.InstallDate = InstallDateTextbox.Text; VersionObject.InstallDate = InstallDateEdit.Text; VersionObject.Details = VersionDetailsTextbox.Text; update = CustomerServiceBL.CustomerDetails.Ins.UpdateVersionInfo(VersionObject, "Insert", CustomerComboBox.SelectedItem.Value.ToString()); if (update) { successDiv.Style.Value = "display: block"; errorDiv1.Style.Value = "display: none"; successDiv.InnerText = "New Version has been successfully created"; } else { successDiv.Style.Value = "display: none"; errorDiv1.Style.Value = "display: block"; errorDiv1.InnerText = "Version has NOT been created"; } } catch (Exception ex) { throw ex; } finally { } }
public DataTable GetAllVersionInfoData() { DataTable NotesDataTable = new DataTable(); VersionInfoTask ReturnObject = new VersionInfoTask(); try { string SqlQuery = "Select * from Customer, VersionInfo"; NotesDataTable = objAdaptor.FetchData(SqlQuery); } catch (Exception ex) { } finally { } return(NotesDataTable); }
private void FillVersionDetails(int ID) { try { VersionInfoTask VersionInfoObject = new VersionInfoTask(); VersionInfoTask ReturnContactsObject = new VersionInfoTask(); VersionInfoObject.ID = ID; ReturnContactsObject = CustomerServiceBL.CustomerDetails.Ins.GetVersionInfoDataForID(VersionInfoObject, ""); if (ReturnContactsObject != null) { VersionNumberTextbox.Text = ReturnContactsObject.VersionNumber.ToString(); InstallDateEdit.Date = DateTime.Parse(ReturnContactsObject.InstallDate.ToString()); //InstallDateTextbox.Text = ReturnContactsObject.InstallDate.ToString(); VersionDetailsTextbox.Text = ReturnContactsObject.Details.ToString(); } } catch (Exception ex) { throw ex; } finally { } }
public bool UpdateVersionInfo(VersionInfoTask VersionObject, string Mode, string CustId) { return(CustomerTrackingDL.CustomerDetails.Ins.UpdateVersionInfo(VersionObject, Mode, CustId)); }
public VersionInfoTask GetVersionInfoDataForID(VersionInfoTask VersioInfObject, string Mode) { return(CustomerTrackingDL.CustomerDetails.Ins.GetVersionInfoDataForID(VersioInfObject, Mode)); }