string mac_rate_eff_date = DateTime.Now.ToString("yy-M-dd"); string FromDate = ""; if (tabname == "ItemOfMachinery") { if (dbwork == "Insert") { imacc_id = int.Parse(drpcategoryofmachinery.SelectedValue); mac_code = txtcode.Text; ma_short_desc = txtshort.Text; mac_long_desc = txtDescription.Text; mac_unit = int.Parse(drpUnit.SelectedItem.Value); mac_rate = double.Parse(drpcategoryofmachinery.SelectedValue); FromDate = txteffdate.Text; string[] datesplit = FromDate.Split('-'); mac_rate_eff_date = datesplit[2] + "-" + datesplit[1] + "-" + datesplit[0]; if (datesplit[0].Length == 4) { mac_rate_eff_date = datesplit[0] + "-" + datesplit[1] + "-" + datesplit[2]; } } else { mac_id = int.Parse(hdnmac_id.Value); mac_rate_id = int.Parse(hdnmac_rate_id.Value); imacc_id = int.Parse(drpcategoryofmachinery.SelectedValue); ma_short_desc = hdnshortdesc.Value; mac_long_desc = hdnlongdesc.Value; mac_unit = 0; mac_rate =double.Parse(hdnrate.Value); FromDate = hdnmac_effdate.Value; string[] datesplit = FromDate.Split('-'); mac_rate_eff_date = datesplit[2] + "-" + datesplit[1] + "-" + datesplit[0]; //if(datesplit[0].Length==4) //{ // mac_rate_eff_date = datesplit[0] + "-" + datesplit[1] + "-" + datesplit[2]; //} } if (tabname == "ItemOfMachinery") { if (dbwork == "delete") { mac_id = Convert.ToInt32(hdnmac_id.Value); mac_rate_id = int.Parse(hdnmac_rate_id.Value); } else { //imc_id = int.Parse(hdnworkid.Value); //icode = hdncategorycode.Value; //icatname = hdncategoryname.Value; } }
ToString("yyyy/MM/dd")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)