public DataSet GetStandardGlobalTag() { DataSet ds = new DataSet(); try { string strSql = "select ID,UTAGID,UserID,Tag,Orig,GlobPri,Description from tbl_StandardGlobalTag order by ID desc"; con = ConnectionClass.getConnection(); SqlDataAdapter da = new SqlDataAdapter(strSql, con); da.Fill(ds); ConnectionClass.closeconnection(con); } catch (Exception ex) { ConnectionClass.closeconnection(con); DataLogger.Write("FHFile-GetStandardGlobalTag", ex.Message); } finally { ConnectionClass.closeconnection(con); } return(ds); }
public DataSet GetFileDetails(int FileID) { DataSet ds = new DataSet(); try { string strSql = "select sf.ID as FileID, sf.fileext,sf.targetfilepath,sf.NewFileName,substring(sf.OrignalFileName, 1, charindex('.', sf.OrignalFileName)-1) As TemplateName,tp.TemplateName as DFileName from tbl_SourceFileHistory sf Inner Join tbl_Templates tp on tp.FileID=sf.ID where sf.ID=" + FileID; con = ConnectionClass.getConnection(); SqlDataAdapter da = new SqlDataAdapter(strSql, con); da.Fill(ds); ConnectionClass.closeconnection(con); } catch (Exception ex) { ConnectionClass.closeconnection(con); DataLogger.Write("FHFile-GetFileDetails", ex.Message); } finally { ConnectionClass.closeconnection(con); } return(ds); }
public DataSet GetRepositoryByTemplateID(int TemplateID) { DataSet ds = new DataSet(); try { string strSql = "SELECT ID,TemplateID,BPID,UserID,UTAGID,Tag ,Description,Org,GlobPri,Share,CreatedDate,UpdateDate FROM tbl_Repository where TemplateID=" + TemplateID; con = ConnectionClass.getConnection(); SqlDataAdapter da = new SqlDataAdapter(strSql, con); da.Fill(ds); ConnectionClass.closeconnection(con); } catch (Exception ex) { ConnectionClass.closeconnection(con); DataLogger.Write("FHFile-GetRepositoryByTemplateID", ex.Message); } finally { ConnectionClass.closeconnection(con); } return(ds); }
public DataSet GetRepository() { DataSet ds = new DataSet(); try { con = ConnectionClass.getConnection(); SqlCommand cmd = new SqlCommand("sp_GetRepository", con); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); ConnectionClass.closeconnection(con); } catch (Exception ex) { ConnectionClass.closeconnection(con); DataLogger.Write("FHFile-GetRepository", ex.Message); } finally { ConnectionClass.closeconnection(con); } return(ds); }
public string GetUserid(string FHnumber) { // List<Association> lstAssociation = new List<Association>(); string userid = ""; con = ConnectionClass.getConnection(); SqlCommand cmd = new SqlCommand(); try { cmd.Connection = con; cmd.CommandText = "sp_GetUserId"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@FHnumber", SqlDbType.NVarChar).Value = FHnumber; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { userid = ds.Tables[0].Rows[0]["userid"].ToString(); } ConnectionClass.closeconnection(con); } catch (Exception ex) { ConnectionClass.closeconnection(con); DataLogger.Write("Report-GetUserID", ex.Message); } finally { ConnectionClass.closeconnection(con); } return(userid); }
public int RemoveAssociation(int RecordID) { int retValue = -1; try { con = ConnectionClass.getConnection(); SqlCommand cmd = new SqlCommand("update tbl_Association set assocStatus=0 where ID=" + Convert.ToInt32(RecordID)); cmd.Connection = con; retValue = cmd.ExecuteNonQuery(); ConnectionClass.closeconnection(con); } catch (Exception ex) { ConnectionClass.closeconnection(con); retValue = -1; DataLogger.Write("Association-UpdateAssociation", ex.Message); } finally { ConnectionClass.closeconnection(con); } return(retValue); }
public string GetFHFileID(string FileID, string op) { string sql = ""; string returnData = ""; try { if (op == "F") { sql = "select TargetFilePath from tbl_SourceFileHistory where ID='" + FileID + "'"; } else { sql = "select TemplatePath from tbl_HarminizedTemplete where ID='" + FileID + "'"; } con = ConnectionClass.getConnection(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = sql; cmd.CommandType = CommandType.Text; returnData = (string)cmd.ExecuteScalar(); ConnectionClass.closeconnection(con); } catch (Exception ex) { ConnectionClass.closeconnection(con); returnData = ""; DataLogger.Write("FHMnage-GetFHFileID", ex.Message); } finally { ConnectionClass.closeconnection(con); } return(returnData); }