Dear Sir,
I am facing a problem in entry in asp.net c#. my textbox has value as "CYLINDER HEAD COVER AND/OR PACKING(A) R & R" but when value is store in variable it s showing "CYLINDER HEAD COVER AND/OR PACKING(A) R & R".
Please help me how to save value as per text box "CYLINDER HEAD COVER AND/OR PACKING(A) R & R".
Thnaks
Arvind
string NewLabourDescription = TxtLabourDescriptionAllocation.Text.Replace("&", "&");
ConnectionStringFunction();
SqlCn = new SqlConnection(ConPath);
SqlCn.Open();
//try
//{
SqlCommand SqlCm = new SqlCommand("SaveJobAllocation");
SqlCm.CommandType = CommandType.StoredProcedure;
SqlCm.Connection = SqlCn;
SqlCm.Parameters.AddWithValue("JobAllocateDate", TransactionDate);
SqlCm.Parameters.AddWithValue("TechGroupCode", int.Parse(TxtTechnicianGroupCodeAllocation.Text) );
SqlCm.Parameters.AddWithValue("JobNoDetail", TxtRoNoAllocate.Text.Trim());
SqlCm.Parameters.AddWithValue("RegNo", TxtRegNoAllocate.Text.Trim());
SqlCm.Parameters.AddWithValue("LabourCode", TxtLabourCodeAllocation.Text.Trim());
SqlCm.Parameters.AddWithValue("LabourDescription", NewLabourDescription.Trim());
SqlCm.Parameters.AddWithValue("LabourType", LabourTypeCode);
SqlCm.Parameters.AddWithValue("TechnicianCode",int.Parse(TxtTechnicianCodeAllocation.Text) );
SqlCm.Parameters.AddWithValue("TechnicianName", (TxtTechnicianNameAllocation.Text));
SqlCm.Parameters.AddWithValue("MfgTU", int.Parse(TxtMfgTuAllocation.Text));
SqlCm.Parameters.AddWithValue("MfgTime", TxtMfgTimeAllocation.Text);
SqlCm.Parameters.AddWithValue("BrandCode", int.Parse(TxtBrandCodeMain.Text));
SqlCm.Parameters.AddWithValue("ModelCode", int.Parse(TxtModelCodeMain.Text));
SqlCm.Parameters.AddWithValue("MainCompanyCode", int.Parse(TxtUserCompanyCode.Text) );
SqlCm.Parameters.AddWithValue("CustomerVoiceRefNo", int.Parse( TxtCustomerVoiceIdAllocation.Text));
SqlCm.Parameters.AddWithValue("MainBranchCode", int.Parse(TxtUserBranchCode.Text));
SqlCm.Parameters.AddWithValue("LastNo", LastNo);
SqlCm.Parameters.AddWithValue("EntryBy", NewEntry);
SqlCm.Parameters.AddWithValue("ChargeToCode",ChargeToCode);
SqlCm.Parameters.AddWithValue("InvoiceTypeCode", InvoiceTypeCode);
SqlCm.Parameters.AddWithValue("ChargeToPrice", ChargeToAmountTotalPrice);
SqlCm.Parameters.AddWithValue("ChargeToCost", ChargeToCost);
SqlCm.Parameters.AddWithValue("ItemCostLC", ChargeToFrtCost);
SqlCm.Parameters.AddWithValue("ItemCostFC", WarrantyFCAmount);
SqlCm.Parameters.AddWithValue("ItemPriceLC", ChargeToFrtRate);
SqlCm.Parameters.AddWithValue("ItemPriceFC", WarrantyFCAmount);
SqlCm.Parameters.AddWithValue("VatCategory", TxtCustomerTaxCategoryMain.Text.Trim().ToUpper());
SqlCm.Parameters.AddWithValue("Tax1Name", Tax1Name);
SqlCm.Parameters.AddWithValue("Tax2Name", Tax2Name);
SqlCm.Parameters.AddWithValue("Tax3Name", Tax3Name);
SqlCm.Parameters.AddWithValue("Tax4Name", Tax4Name);
SqlCm.Parameters.AddWithValue("Tax1PerService", Tax1PerService);
SqlCm.Parameters.AddWithValue("Tax2PerService", Tax2PerService);
SqlCm.Parameters.AddWithValue("Tax3PerService", Tax3PerService);
SqlCm.Parameters.AddWithValue("Tax4PerService", Tax4PerService);
SqlCm.Parameters.AddWithValue("FrtCostPerHourLC", ChargeToFrtCost);
SqlCm.Parameters.AddWithValue("FrtRatePerHourLC", ChargeToFrtRate);
SqlCm.Parameters.AddWithValue("FrtRatePerHourFC", OEMWarrantyLabourPerHrsFC); //
SqlCm.Parameters.AddWithValue("FrtFactor", ChargeToFactorPercent);
SqlCm.Parameters.AddWithValue("UserIdandName", UserIdandName);
// ================================================================ //
SqlCm.Parameters.Add("@ERROR", SqlDbType.Char, 500);
SqlCm.Parameters["@ERROR"].Direction = ParameterDirection.Output;
//SqlCm.Parameters.Add("@ERRORDOCUMENT", SqlDbType.Char, 500);
//SqlCm.Parameters["@ERRORDOCUMENT"].Direction = ParameterDirection.Output;
SqlTran = SqlCn.BeginTransaction();
SqlCm.Transaction = SqlTran;
SqlCm.ExecuteNonQuery();
SqlTran.Commit();
TmpMessage = (string)SqlCm.Parameters["@ERROR"].Value;
//TmpDocumentNo = (string)SqlCm.Parameters["@ERRORDOCUMENT"].Value;
//TmpDocumentNoGenerate = TmpDocumentNo;
if (TmpMessage.Substring(0, 2) == "OK")
{
//MessageTitle = "Vehicle Not Delivered \\n\\Location : " + LocationNameTmp + "\\n\\Repair Order No : " + RepairOrderNoTmp;
MessageTitle = "Transaction Successful" + "<br/>" + "Job Allocated to technician ";
TransactionStatus = true;
}
else
{
if (TmpMessage.Substring(0, 9) == "Duplicate")
{
MessageTitle = "Transaction Failed !!!!" + "<br/>" + "Duplicate Labour ";
//MessageTitle = "Transaction Failed \\n\\ Duplicate Job Card No : " + TmpDocumentNo;
TransactionStatus = false;
}
else
{
//MessageTitle = "Transaction Failed \\n\\ Error : " + TmpMessage;
MessageTitle = "Transaction Failed !!!!" + "<br/>" + TmpMessage;
TransactionStatus = false;
}
}
// ================================================================ //
//}
//catch (Exception ex)
//{
// //MessageTitle = "Transaction Successful \\n\\Job Card No : " + TmpDocumentNo.Trim() + " Generated";
// TransactionStatus = false;
// //SqlTran.Rollback();
// MessageTitle = "Transaction Failed !!!!" + "<br/>" + ex.Message.ToString();
//}
//finally
//{
// SqlCn.Close();
//}
////End Finally
//// ========================= End Try