protected void btnClearBottom_Click(object sender, EventArgs e) { if (txtTransCode.Text.Trim() == "") { lblMSG.Text = "Please select a location"; PopupControlMSG.ShowOnPageLoad = true; return; } string tlcode = txtTransLocCode.Text.Trim() + txtTransSubLocCode.Text.Trim() + txtTransCode.Text.Trim(); string sql = "update PartsTransLocation set PartsTransLocDesc='" + txtTransLocDesc.Text.Trim().ToUpper() + "' where PartsTransLocCode='" + tlcode + "'"; myFunc.GetData(sql); lblMSG.Text = "Location has been updated"; PopupControlMSG.ShowOnPageLoad = true; //txtTransCode.Text = ""; //txtTransLocDesc.Text = ""; txtTransLocDesc.Enabled = true; btnCreateLocation.Enabled = true; btnDeleteLocation.Enabled = true; btnSelectTransCode.Visible = true; GridViewTransLocs.Visible = true; SqlDataSourceTransLocations.SelectCommand = "select * from PartsTransLocation where PartsLocCode='" + txtTransLocCode.Text.ToUpper().Trim() + "' and PartsSubLocCode='" + txtTransSubLocCode.Text.Trim().ToUpper() + "'"; SqlDataSourceTransLocations.Select(DataSourceSelectArguments.Empty); GridViewTransLocs.Visible = true; GridViewTransLocs.DataBind(); }
protected void txtSubLocCode_TextChanged(object sender, EventArgs e) { string lcode = txtSubLocCode.Text; if (lcode == "") { txtSubCodeDesc.Text = ""; txtSubCodeDesc.Enabled = false; btnSaveSubLoc.Enabled = false; btnDeleteSubLoc.Enabled = false; FormLayoutDetail.Visible = false; btnSelectTransCode.Visible = false; GridViewTransLocs.Visible = false; return; } if (myFunc.isSubLocCodeExist(txtLocCode.Text, lcode)) { txtSubCodeDesc.Enabled = true; txtSubCodeDesc.Text = myFunc.GetSubLocDesc(txtLocCode.Text, lcode); btnSaveSubLoc.Enabled = true; btnDeleteSubLoc.Enabled = true; txtTransLocCode.Text = txtLocCode.Text.ToUpper(); txtTransSubLocCode.Text = txtSubLocCode.Text.ToUpper(); FormLayoutDetail.Visible = true; GridViewTransLocs.Visible = true; SqlDataSourceTransLocations.SelectCommand = "select * from PartsTransLocation where PartsLocCode='" + txtLocCode.Text + "' and PartsSubLocCode='" + txtSubLocCode.Text + "'"; SqlDataSourceTransLocations.Select(DataSourceSelectArguments.Empty); GridViewTransLocs.Visible = true; btnSelectTransCode.Visible = true; GridViewTransLocs.DataBind(); btnCreateLocation.Enabled = true; } else { txtSubCodeDesc.Enabled = true; txtSubCodeDesc.Text = ""; txtSubCodeDesc.Focus(); btnSaveSubLoc.Enabled = true; btnDeleteSubLoc.Enabled = false; FormLayoutDetail.Visible = false; GridViewTransLocs.Visible = false; btnSelectTransCode.Visible = false; } }
protected void txtTransCode_TextChanged(object sender, EventArgs e) { string tlcode = txtTransLocCode.Text.Trim() + txtTransSubLocCode.Text.Trim() + txtTransCode.Text.Trim(); if (!myFunc.isTransLocCodeExist(tlcode)) { txtTransLocDesc.Text = ""; txtTransLocDesc.Enabled = true; txtTransLocDesc.Focus(); btnSave.Enabled = true; btnDelete.Enabled = false; //btnSaveBottom.Enabled=true; //btnDeleteBottom.Enabled=false; GridViewTransLocs.Visible = true; SqlDataSourceTransLocations.SelectCommand = "select * from PartsTransLocation where PartsLocCode='" + txtLocCode.Text.Trim() + "' and PartsSubLocCode='" + txtSubLocCode.Text.Trim() + "'"; SqlDataSourceTransLocations.Select(DataSourceSelectArguments.Empty); GridViewTransLocs.Visible = true; GridViewTransLocs.DataBind(); } else { txtTransLocDesc.Text = myFunc.GetTransLocDesc(tlcode); txtTransLocDesc.Enabled = true; btnSave.Enabled = false; btnDelete.Enabled = true; //btnSaveBottom.Enabled = false; //btnDeleteBottom.Enabled = true; GridViewTransLocs.Visible = true; SqlDataSourceTransLocations.SelectCommand = "select * from PartsTransLocation where PartsTransLocCode='" + tlcode + "'"; SqlDataSourceTransLocations.SelectCommand = "select * from PartsTransLocation where PartsLocCode='" + txtLocCode.Text.Trim() + "' and PartsSubLocCode='" + txtSubLocCode.Text.Trim() + "'"; SqlDataSourceTransLocations.Select(DataSourceSelectArguments.Empty); GridViewTransLocs.Visible = true; GridViewTransLocs.DataBind(); } }