//Copy Function protected void btnCopySignatureValue_Click(object sender, EventArgs e) { try { int index = Convert.ToInt32(((sender as LinkButton).NamingContainer as GridViewRow).RowIndex); string machine = ddlMachine.SelectedValue; string company = ddlCompany.SelectedValue; string plant = ddlPlant.SelectedValue; string parameter = (gvSignatureComparisionDetails.Rows[index].FindControl("lblParemeterID") as Label).Text; string signatueID = (gvSignatureComparisionDetails.Rows[index].FindControl("lblSignatureID") as Label).Text; lblSrcCopyCompany.Text = company; lblSrcCopyPlant.Text = plant; lblSrcCopyMachine.Text = machine; lblSrcCopyParameter.Text = parameter; lblSrcCopySignature.Text = signatueID; ddlDestiCopyMachine.DataSource = MongoDBAccess.getMachineID(company, plant); ddlDestiCopyMachine.DataBind(); txtDestiCopySignature.Text = ""; ddlDestiCopyMachine_SelectedIndexChanged(null, null); ScriptManager.RegisterStartupScript(this, GetType(), "warning", "openCopySignatureValueModal();", true); } catch (Exception ex) { } }
private void bindMachineID() { try { ddlMachine.DataSource = MongoDBAccess.getMachineID(ddlCompany.SelectedValue, ddlPlant.SelectedValue); ddlMachine.DataBind(); BindParameters(); } catch (Exception ex) { } }
private void bindMachineID() { try { //List<ListItem> listItemList = new List<ListItem>(); //listItemList = DBAccess.getMachineIDs(ddlCompany.SelectedValue == null ? "" : ddlCompany.SelectedValue.ToString(), ddlPlant.SelectedValue == null ? "" : ddlPlant.SelectedValue.ToString()); //multiselectddlMachineID.DataSource = listItemList; //multiselectddlMachineID.DataTextField = "Text"; //multiselectddlMachineID.DataValueField = "Value"; //multiselectddlMachineID.DataBind(); List <string> listItemList = new List <string>(); listItemList = MongoDBAccess.getMachineID(ddlCompany.SelectedValue == null ? "" : ddlCompany.SelectedValue.ToString(), ddlPlant.SelectedValue == null ? "" : ddlPlant.SelectedValue.ToString()); multiselectddlMachineID.DataSource = listItemList; multiselectddlMachineID.DataBind(); if (Session["PPMachines"] == null) { if (listItemList.Count > 0) { multiselectddlMachineID.Items[0].Selected = true; } } else { List <string> machines = (List <string>)Session["PPMachines"]; // Session["PPMachines"] = null; foreach (ListItem item in multiselectddlMachineID.Items) { item.Selected = false; } for (int i = 0; i < machines.Count; i++) { foreach (ListItem item in multiselectddlMachineID.Items) { if (item.Text == machines[i]) { item.Selected = true; } } } } bindParameters(); } catch (Exception ex) { } }