private void Config_Click(object sender, RoutedEventArgs e) { RetailClusterSource.Group group = (RetailClusterSource.Group)(((Button)e.OriginalSource).DataContext); frmConfigureSupplierQAToCluster win = new frmConfigureSupplierQAToCluster(loginstateid, group, loginuser, "GROUP"); win.ShowDialog(); }
public frmConfigureSupplierQAToCluster(int pstateid, object source, string pusercode, string configuretype) { loginstateid = pstateid; configType = configuretype; if (configuretype.ToUpper() == "RETAILCLUSTER") { rcluster = (RetailClusterSource.RetailCluster)source; clusterid = rcluster.RetailClusterID; id = clusterid.ToString(); } else if (configuretype.ToUpper() == "GROUP") { group = (RetailClusterSource.Group)source; groupid = group.GroupID; id = groupid.ToString(); } rs = new RetailClusterSource(loginstateid, pusercode); InitializeComponent(); if (configuretype.ToUpper() == "RETAILCLUSTER") { txtclustername.Text = txtclustername.Text + "Retail Clusters - " + rcluster.RetailClusterName; btnConfig.Content = "Save Template To Cluster"; } else { txtclustername.Text = txtclustername.Text + "Group - " + group.GroupName; btnConfig.Content = "Save Template To Groups"; } this.DataContext = rs; rs.LoadSuppliers(loginstateid); rs.LoadQuestions(loginstateid); rs.LoadQAndA(id, configType); this.Title = this.Title + " - " + CommonVariables.WindowTitleInfo; }