Exemplo n.º 1
0
        public DataSet GetTextModuleAreas()
        {
            DataSet dsTextModuleAreas = new DataSet();

            try
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = SQLCon.Sqlconn();
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "[P_Get_TextModuleAreas]";
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(dsTextModuleAreas);
                    }
                }
            }
            catch (Exception ex)
            {
                if (System.Threading.Thread.CurrentThread.CurrentCulture.Name.ToString() == "de-DE")
                {
                    // throw new Exception("Fehler beim Laden des Kunden");
                }
                else
                {
                    throw new Exception("Error Occured While Retreiving the data");
                }
            }
            finally
            {
                SQLCon.Sqlconn().Close();
            }
            return(dsTextModuleAreas);
        }
Exemplo n.º 2
0
        public DataSet GetCategories(int _textID)
        {
            DataSet dsCategory = new DataSet();

            try
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = SQLCon.Sqlconn();
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "[P_Get_Category]";
                    cmd.Parameters.AddWithValue("@TextareaID", _textID);
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(dsCategory);
                    }
                }
            }
            catch (Exception ex)
            {
                if (System.Threading.Thread.CurrentThread.CurrentCulture.Name.ToString() == "de-DE")
                {
                    // throw new Exception("Fehler beim Laden des Kunden");
                }
                else
                {
                    throw new Exception("Error Occured While Retreiving the data");
                }
            }
            finally
            {
                SQLCon.Sqlconn().Close();
            }
            return(dsCategory);
        }
Exemplo n.º 3
0
        public DataSet GetOTTODetails()
        {
            DataSet dsOTTO = new DataSet();

            try
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = SQLCon.Sqlconn();
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "[P_Get_OTTODetails]";
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(dsOTTO);
                    }
                }
            }
            catch (Exception ex)
            {
                if (System.Threading.Thread.CurrentThread.CurrentCulture.Name.ToString() == "de-DE")
                {
                    throw new Exception("Fehler beim Laden der Daten zu OTTO");
                }
                else
                {
                    throw new Exception("Error Occured While Retreiving OTTO details");
                }
            }
            finally
            {
                SQLCon.Sqlconn().Close();
            }
            return(dsOTTO);
        }
Exemplo n.º 4
0
        public int SaveCategory(XmlDocument XmlDoc)
        {
            int CategoryID = -1;

            try
            {
                string innerxml = XmlDoc.InnerXml.Replace(',', '.');
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = SQLCon.Sqlconn();
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "[P_Ins_Category]";
                    SqlParameter param = new SqlParameter("@XMLCategory", SqlDbType.Xml);
                    param.Value = innerxml;
                    cmd.Parameters.Add(param);

                    object returnObj = cmd.ExecuteScalar();
                    if (returnObj != null)
                    {
                        if (!int.TryParse(returnObj.ToString(), out CategoryID))
                        {
                            throw new Exception(returnObj.ToString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                SQLCon.Sqlconn().Close();
            }
            return(CategoryID);
        }