protected void btnUpload_Click(object sender, EventArgs e)
    {
        string Style, StrStatus;
        int    Status;

        string Error = string.Empty;


        StoreFront ObjStoreFront = new StoreFront();
        DataSet    ds            = new DataSet();
        string     strExtension;

        strExtension = Path.GetExtension(flUpload.Value);
        if (strExtension == ".CSV" || strExtension == ".csv")
        {
            string       fileName;
            string       line;
            string       fileDir;
            StreamReader sr;
            fileDir  = Server.MapPath("../StoreData/");
            fileName = fileDir + "/" + Convert.ToString(DateTime.Now.Ticks) + ".txt";
            flUpload.PostedFile.SaveAs(fileName);
            sr = File.OpenText(fileName);
            int recordCount = 0;
            while (sr.Peek() != -1)
            {
                line = sr.ReadLine();
                string[] recordArray;
                char[]   splitter = { ',' };
                recordArray = line.Split(splitter);
                if (recordArray[0].Replace(",", "") == "StyleName")
                {
                    continue;
                }
                else
                {
                    if (recordArray.Length == 2)
                    {
                        Style     = (recordArray[0].Trim().Replace('#', ','));
                        StrStatus = recordArray[1].Trim().Replace('#', ',');
                        if (StrStatus == "Active")
                        {
                            Status = 1;
                        }
                        else if (StrStatus == "Inactive")
                        {
                            Status = 0;
                        }
                        else
                        {
                            Status = 1;
                        }


                        int Dup = ObjStoreFront.AddStyleExcel(Style, Status);
                        if (Dup == 0)
                        {
                            if (Error == "")
                            {
                                Error = "Duplicate Style - " + Style;
                            }
                            else
                            {
                                Error = Error + ", " + Style;
                            }
                        }
                        recordCount++;
                    }
                    else
                    {
                        Error = "coloumn count does not match";
                    }
                }
            }
            if (Error == "")
            {
                SuccesfullMessage("Record Added successfully.");
            }
            else
            {
                ErrMessage(Error);
            }
        }

        else
        {
            ErrMessage("Sorry, File Format Not Supported. You can upload files in .csv format only.");
        }
        BindGrid();
    }