<td style="width: 112px;">@common.GetTranslations("File Name", LID)</td>
<td>@Html.TextBox("Dfilename", "", new { type = "file", Class = "Dtext tht fs fel", @onchange = "ValidateCsv(this);" })</td>
<td><input type="submit" value="@common.GetTranslations("Upload file", LID)" id="btnupload" class="formBtn" onclick="Loader();" style="min-width: 130px !important; padding: 3px 0px !important; background-color:gray; font-size: 15px !important;" disabled /></td>
public ActionResult Diamondfile(HttpPostedFileBase Dfilename)
{
if (Dfilename != null && Dfilename.ContentLength > 0)
{
var attachedFile = Dfilename;
var csvReader = new StreamReader(attachedFile.InputStream, Encoding.UTF8);
string inputDataRead;
var values = new List<string>();
while ((inputDataRead = csvReader.ReadLine()) != null)
{
values.Add(inputDataRead);
}
values.Remove(values[0]);
string StockNumbers = string.Empty;
string Stockexist = string.Empty;
if (values.Count > 0)
{
foreach (var value in values)
{
var eachValue = new string[61];
var myList = value.Split(',');
for (int i = 0; i < 61; i++)
{
eachValue[i] = i < myList.Length ? myList[i] : "";
}
//Diamond objdiamond = new Diamond();
#region get value
string dAvailabilityStatusID = eachValue[1].ToString();
}
}
<td>@Html.TextBox("Dfilename", "", new { type = "file", Class = "Dtext tht fs fel", @onchange = "ValidateCsv(this);" })</td>
<td><input type="submit" value="@common.GetTranslations("Upload file", LID)" id="btnupload" class="formBtn" onclick="Loader();" style="min-width: 130px !important; padding: 3px 0px !important; background-color:gray; font-size: 15px !important;" disabled /></td>
public ActionResult Diamondfile(HttpPostedFileBase Dfilename)
{
if (Dfilename != null && Dfilename.ContentLength > 0)
{
var attachedFile = Dfilename;
var csvReader = new StreamReader(attachedFile.InputStream, Encoding.UTF8);
string inputDataRead;
var values = new List<string>();
while ((inputDataRead = csvReader.ReadLine()) != null)
{
values.Add(inputDataRead);
}
values.Remove(values[0]);
string StockNumbers = string.Empty;
string Stockexist = string.Empty;
if (values.Count > 0)
{
foreach (var value in values)
{
var eachValue = new string[61];
var myList = value.Split(',');
for (int i = 0; i < 61; i++)
{
eachValue[i] = i < myList.Length ? myList[i] : "";
}
//Diamond objdiamond = new Diamond();
#region get value
string dAvailabilityStatusID = eachValue[1].ToString();
}
}
No comments:
Post a Comment