private void dgvAdm_FinalProcurement_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
        {
            object item = dgvSale_ContactCustDetails.SelectedItem;

            ContactCID = Convert.ToInt32((dgvSale_ContactCustDetails.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text);
            //loadStockProducts();
            frmCRM_Adm_Dashbord ad2 = new frmCRM_Adm_Dashbord();

            txtCCDID.Text = ContactCID.ToString();
            ad2.ContactCDname(txtCCDID.Text);
            DialogResult = true;
            this.Close();
        }
Exemple #2
0
 private void dgvAdm_AllProducts_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
 {
     btnFollowupBrowse.IsEnabled = false;
     try
     {
         var id1 = (DataRowView)dgvAdm_AllProducts.SelectedItem; //get specific ID from          DataGrid after click on Edit button in DataGrid
         PK_ID = Convert.ToInt32(id1.Row["ID"].ToString());
         con.Open();
         //string sqlquery = "SELECT * FROM Pre_Products where ID='" + PK_ID + "' ";
         string sqlquery = "SELECT P.[ID],P.[Domain_ID],P.[Product_ID],P.[Brand_ID],P.[P_Category],P.[Model_No_ID],P.[Color_ID],P.[Price] " +
                           ",DM.[Domain_Name],PM.[Product_Name], B.[Brand_Name] , PC.[Product_Category] ,MN.[Model_No] ,C.[Color] " +
                           "FROM [Pre_Products] P " +
                           "INNER JOIN [tb_Domain] DM ON DM.[ID]=P.[Domain_ID] " +
                           "INNER JOIN [tlb_Products] PM ON PM.[ID]=P.[Product_ID] " +
                           "INNER JOIN [tlb_Brand] B ON B.[ID]=P.[Brand_ID] " +
                           "INNER JOIN [tlb_P_Category] PC ON PC.[ID]=P.[P_Category]" +
                           "INNER JOIN [tlb_Model] MN ON MN.[ID]=P.[Model_No_ID] " +
                           "INNER JOIN [tlb_Color] C ON C.[ID]=P.[Color_ID] " +
                           "WHERE P.[ID]= '" + PK_ID + "'";
         SqlCommand     cmd = new SqlCommand(sqlquery, con);
         SqlDataAdapter adp = new SqlDataAdapter(cmd);
         DataTable      dt  = new DataTable();
         adp.Fill(dt);
         if (dt.Rows.Count > 0)
         {
             txtProductsID.Text      = dt.Rows[0]["ID"].ToString();
             txtPRoductName.Text     = dt.Rows[0]["Product_Name"].ToString();
             txtBrandName.Text       = dt.Rows[0]["Brand_Name"].ToString();
             txtPRoductCategory.Text = dt.Rows[0]["Product_Category"].ToString();
             txtModelNo.Text         = dt.Rows[0]["Model_No"].ToString();
             txtColor.Text           = dt.Rows[0]["Color"].ToString();
             txtPrice.Text           = dt.Rows[0]["Price"].ToString();
         }
         frmCRM_Adm_Dashbord obj = new frmCRM_Adm_Dashbord();
         obj.ProductID123(txtProductsID.Text);
     }
     catch
     {
         throw;
     }
     finally
     {
         con.Close();
     }
 }
      private void dgrdFEmployeeDetails_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
      {
          try
          {
              var id1 = (DataRowView)dgrdFEmployeeDetails.SelectedItem;   //get specific ID from          DataGrid after click on Edit button in DataGrid
              PK_ID = Convert.ToInt32(id1.Row["ID"].ToString());
              con.Open();
              //string sqlquery = "SELECT * FROM Pre_Products where ID='" + PK_ID + "' ";
              string         sqlquery = "SELECT [ID],[EmployeeFirstName] + ' ' + [EmployeeLastName] AS [EmpName] FROM [tbl_Employee] WHERE [ID]= '" + PK_ID + "'";
              SqlCommand     cmd      = new SqlCommand(sqlquery, con);
              SqlDataAdapter adp      = new SqlDataAdapter(cmd);
              DataTable      dt       = new DataTable();
              adp.Fill(dt);
              if (dt.Rows.Count > 0)
              {
                  txtFEmpID.Text   = dt.Rows[0]["ID"].ToString();
                  txtFEmpName.Text = dt.Rows[0]["EmpName"].ToString();
              }
              frmCRM_Adm_Dashbord obj = new frmCRM_Adm_Dashbord();
              obj.femp(txtFEmpID.Text, txtFEmpName.Text);
          }
          catch
          {
              throw;
          }
          finally
          {
              con.Close();
          }

          // object item = dgrdFEmployeeDetails .SelectedItem;
          // FEmpID = Convert.ToInt32((dgrdFEmployeeDetails.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text);
          // FEName=(dgrdFEmployeeDetails.SelectedCells[2].Column.GetCellContent(item) as TextBlock).Text;
          // FEName2 = (dgrdFEmployeeDetails.SelectedCells[3].Column.GetCellContent(item) as TextBlock).Text;
          // cmbname = FEName + FEName2;
          // //loadStockProducts();
          // frmCRM_Adm_Dashbord ad = new frmCRM_Adm_Dashbord();
          //// ad.FEmpID = FEmpID;
          //// ad.cmbname = cmbname;
          //// ad.Show();
          // eid = FEmpID.ToString();
          // ad.femp(eid);
      }
Exemple #4
0
        private void dgvCampaignDetails_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
        {
            btnFollowupSearch.IsEnabled = false;
            try
            {
                var id1 = (DataRowView)dgvCampaignDetails.SelectedItem; //get specific ID from          DataGrid after click on Edit button in DataGrid
                PK_ID = Convert.ToInt32(id1.Row["ID"].ToString());
                con.Open();
                //string sqlquery = "SELECT * FROM Pre_Products where ID='" + PK_ID + "' ";
                string sqlquery = "SELECT [ID],[CampaignName],[CampaignType],[StartDate],[EndDate],[ExpectedRevenue],[BudgetedCost],[Status] " +
                                  ",[ExpectedResponse],[Description] " +
                                  "FROM [tlb_FollowUpCampaign] " +
                                  "WHERE [ID]= '" + PK_ID + "'";

                SqlCommand     cmd = new SqlCommand(sqlquery, con);
                SqlDataAdapter adp = new SqlDataAdapter(cmd);
                DataTable      dt  = new DataTable();
                adp.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    txtCampaignID.Text   = dt.Rows[0]["ID"].ToString();
                    txtCampaignName.Text = dt.Rows[0]["CampaignName"].ToString();
                    txtCampaignType.Text = dt.Rows[0]["CampaignType"].ToString();
                    dtpStartDate.Text    = dt.Rows[0]["StartDate"].ToString();
                    dtpEndDate.Text      = dt.Rows[0]["EndDate"].ToString();
                    txtStatus.Text       = dt.Rows[0]["Status"].ToString();
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                con.Close();
            }
            frmCRM_Adm_Dashbord obj = new frmCRM_Adm_Dashbord();

            obj.CampaignID123(txtCampaignID.Text);
        }