public void insertKPCTDetailstoWS(string tagno) //inserting data to Web Service { if (tagno.ToString() == "") { MessageBox.Show("Tag details not found."); classLog.writeLog("Warning @: KPCT Operations: Tag details not found."); } else { string truckno = txtTruckNo.Text.Trim().Replace("'", "").Replace(" ", "").ToUpper().ToString(); string savetime = System.DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss"); string OPLOCid = cmbLocation.SelectedValue.ToString(); try { string state = ""; if (classLogin.Connectivity == "WIFI") { KPCTSDS.appserver.Service1 details = new KPCTSDS.appserver.Service1(); if (classServerDetails.DBType == "Oracle") { state = details.InsertKPCTOperationDetailsOracle(tagno, classLogin.ReaderNo.ToString(), btnSave.Text, savetime, classLogin.User, classLogin.UserType.ToString(), classLogin.Location.ToString(), txtOpQty.Text.ToString(), OPLOCid, "", "", "", "", "", ""); } } else if (classLogin.Connectivity == "GPRS") { KPCTSDS.WebReference_GPRS.Service1 details = new KPCTSDS.WebReference_GPRS.Service1(); if (classServerDetails.DBType == "Oracle") { state = details.InsertKPCTOperationDetailsOracle(tagno, classLogin.ReaderNo.ToString(), btnSave.Text, savetime, classLogin.User, classLogin.UserType.ToString(), classLogin.Location.ToString(), txtOpQty.Text.ToString(), OPLOCid, "", "", "", "", "", ""); } } //classLog.writeLog("Info @: KPCT Operations:"+TagRegid+","+ tagno+"," +truckno+","+ trucktype+","+ readerno+","+readerip+","+ User+","+ unregtime); if (state == "SUCCESS") { lblStatus.Text = "Saved..in Online."; MessageBox.Show("Saved..Successfully."); WAP3.formKPCTOps r = new WAP3.formKPCTOps(1); r.btnVerify_Click(TAG); this.Close(); } else { classLog.writeLog("Error @: KPCT Operations Tally Sheet: Connection failed."); //insertexitdatatoLocalDB(); } } catch (Exception ex) { classLog.writeLog("Error @: KPCT Operations TallySheet: Connection failed."); classLog.writeLog("Exception @: " + ex.ToString()); //insertexitdatatoLocalDB(); } } }
public void insertKPCTDetailstoWS(string tagno) //inserting data to Web Service { if (tagno.ToString() == "") { MessageBox.Show("Tag details not found."); classLog.writeLog("Warning @: KPCT Operations: Tag details not found."); } else { string savetime = System.DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss"); string OPLOCid = cmbLocation.SelectedValue.ToString(); string HandledType; if (cmbHandledType.Text == "Select") { HandledType = ""; } else { HandledType = cmbHandledType.Text; } string TallySheetType = ""; if (radioCarting.Checked == true) { TallySheetType = radioCarting.Text.ToString(); } else if (radioStuffing.Checked == true) { TallySheetType = radioStuffing.Text.ToString(); } try { string state = ""; if (classLogin.Connectivity == "WIFI") { KPCTSDS.appserver.Service1 details = new KPCTSDS.appserver.Service1(); if (classServerDetails.DBType == "Oracle") { state = details.InsertKPCTOperationDetailsOracle(tagno, classLogin.ReaderNo.ToString(), btnSave.Text, savetime, classLogin.User, classLogin.UserType.ToString(), classLogin.Location.ToString(), txtOpQty.Text.ToString(), OPLOCid, cmbCargoCondition.SelectedValue.ToString(), cmbWeatherCondition.SelectedValue.ToString(), cmbHandledBy.SelectedValue.ToString(), HandledType, TallySheetType, txtContainerNo.ToString()); } } else if (classLogin.Connectivity == "GPRS") { KPCTSDS.WebReference_GPRS.Service1 details = new KPCTSDS.WebReference_GPRS.Service1(); if (classServerDetails.DBType == "Oracle") { state = details.InsertKPCTOperationDetailsOracle(tagno, classLogin.ReaderNo.ToString(), btnSave.Text, savetime, classLogin.User, classLogin.UserType.ToString(), classLogin.Location.ToString(), txtOpQty.Text.ToString(), OPLOCid, cmbCargoCondition.SelectedValue.ToString(), cmbWeatherCondition.SelectedValue.ToString(), cmbHandledBy.SelectedValue.ToString(), HandledType, TallySheetType, txtContainerNo.ToString()); } } //classLog.writeLog("Info @: KPCT Operations:"+TagRegid+","+ tagno+"," +truckno+","+ trucktype+","+ readerno+","+readerip+","+ User+","+ unregtime); if (state == "SUCCESS") { lblStatus.Text = "Saved..in Online."; MessageBox.Show("Saved..Successfully."); WAP3.formKPCTOps r = new WAP3.formKPCTOps(1); r.btnVerify_Click(TAG); r._lbReadInfoReadWrite.Text = "Saved..in Online."; this.Close(); } else { classLog.writeLog("Error @: KPCT Operations Tally Sheet: " + state.ToString()); lblStatus.Text = state.ToString(); } } catch (Exception ex) { classLog.writeLog("Error @: KPCT Operations TallySheet: Connection failed."); classLog.writeLog("Exception @: " + ex.ToString()); lblStatus.Text = "Connection failed."; } } }