guardar archivos modsalario
This commit is contained in:
@@ -686,7 +686,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
|||||||
$"************* 00{(contador < 1000 ? "0" : "")}{(contador < 100 ? "0" : "")}{(contador < 10 ? "0" : "")}{contador} 00001 9");
|
$"************* 00{(contador < 1000 ? "0" : "")}{(contador < 100 ? "0" : "")}{(contador < 10 ? "0" : "")}{contador} 00001 9");
|
||||||
|
|
||||||
Script = string.Format("{0}SaveCsv(\"Movtos{3}_{2:ddMMMyyyy}.txt\", '{1}');", Script, MovtosmodSalario, TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy"), oldRegistroPatronal);
|
Script = string.Format("{0}SaveCsv(\"Movtos{3}_{2:ddMMMyyyy}.txt\", '{1}');", Script, MovtosmodSalario, TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy"), oldRegistroPatronal);
|
||||||
|
guardarArchivomodsalario(MovtosmodSalario);
|
||||||
MovtosmodSalario = "";
|
MovtosmodSalario = "";
|
||||||
concater = "";
|
concater = "";
|
||||||
contador = 0;
|
contador = 0;
|
||||||
@@ -706,30 +706,6 @@ public partial class RH_CalculoSBC : ClsPaginas
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string rutarchivos = string.Format("{0}modificacionsalarios\\", UsuarioActual.Empresa.Ruta);
|
|
||||||
if (!System.IO.Directory.Exists(rutarchivos))
|
|
||||||
{
|
|
||||||
System.IO.Directory.CreateDirectory(rutarchivos);
|
|
||||||
}
|
|
||||||
string namearchivoO = TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy-MM-dd");
|
|
||||||
string namearchivo = namearchivoO;
|
|
||||||
int contadorz = 1;
|
|
||||||
while (System.IO.File.Exists(string.Format("{0}{1}", rutarchivos, namearchivo)))
|
|
||||||
{
|
|
||||||
namearchivo = string.Format("{0}({1})", namearchivoO, contadorz++);
|
|
||||||
}
|
|
||||||
System.IO.StreamWriter archivoW = null;
|
|
||||||
try { archivoW = new System.IO.StreamWriter(string.Format("{0}{1}", rutarchivos, namearchivo), true, System.Text.Encoding.UTF8); } catch (Exception) { }
|
|
||||||
if (archivoW != null)
|
|
||||||
{
|
|
||||||
try { archivoW.WriteLine(MovtosmodSalario); } catch (Exception) { }
|
|
||||||
try
|
|
||||||
{
|
|
||||||
archivoW.Close();
|
|
||||||
archivoW.Dispose();
|
|
||||||
}
|
|
||||||
catch (Exception) { }
|
|
||||||
}
|
|
||||||
RegistraScript(Script);
|
RegistraScript(Script);
|
||||||
|
|
||||||
// RegistraScript(string.Format("SaveCsv(\"MovtosmodSalario{1:ddMMMyyyy}.txt\", '{0}');", MovtosmodSalario, TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy")));
|
// RegistraScript(string.Format("SaveCsv(\"MovtosmodSalario{1:ddMMMyyyy}.txt\", '{0}');", MovtosmodSalario, TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy")));
|
||||||
@@ -737,7 +713,34 @@ public partial class RH_CalculoSBC : ClsPaginas
|
|||||||
//RegistraScript("$('#DmodalGetSua').modal('hide');");
|
//RegistraScript("$('#DmodalGetSua').modal('hide');");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private void guardarArchivomodsalario(string MovtosmodSalario)
|
||||||
|
{
|
||||||
|
|
||||||
|
string rutarchivos = string.Format("{0}modificacionsalarios\\", UsuarioActual.Empresa.Ruta);
|
||||||
|
if (!System.IO.Directory.Exists(rutarchivos))
|
||||||
|
{
|
||||||
|
System.IO.Directory.CreateDirectory(rutarchivos);
|
||||||
|
}
|
||||||
|
string namearchivoO = TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy-MM-dd");
|
||||||
|
string namearchivo = namearchivoO;
|
||||||
|
int contadorz = 1;
|
||||||
|
while (System.IO.File.Exists(string.Format("{0}{1}", rutarchivos, namearchivo)))
|
||||||
|
{
|
||||||
|
namearchivo = string.Format("{0}({1})", namearchivoO, contadorz++);
|
||||||
|
}
|
||||||
|
System.IO.StreamWriter archivoW = null;
|
||||||
|
try { archivoW = new System.IO.StreamWriter(string.Format("{0}{1}.txt", rutarchivos, namearchivo), true, System.Text.Encoding.UTF8); } catch (Exception) { }
|
||||||
|
if (archivoW != null)
|
||||||
|
{
|
||||||
|
try { archivoW.WriteLine(MovtosmodSalario); } catch (Exception) { }
|
||||||
|
try
|
||||||
|
{
|
||||||
|
archivoW.Close();
|
||||||
|
archivoW.Dispose();
|
||||||
|
}
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
protected void LnkGuardarCambios_Click(object sender, EventArgs e)
|
protected void LnkGuardarCambios_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string fecha = TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd");
|
string fecha = TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd");
|
||||||
|
|||||||
Reference in New Issue
Block a user