internal void Update(CompanyDetailsSetup objCompanyDetailsSetup)
        {
            try
            {
                if (objCompanyDetailsSetup.CountryID == -1)
                {
                    throw new Exception(" country name is required ");
                }


                var storedProcedureComandText = "UPDATE [comCompanySetup] " +
                                                " SET [CountryID] = ISNULL(" + objCompanyDetailsSetup.CountryID + ",[CountryID]) " +
                                                " ,[CompanyName] = ISNULL('" + objCompanyDetailsSetup.CompanyName + "',[CompanyName]) " +
                                                " ,[CompanyMobile] = ISNULL('" + objCompanyDetailsSetup.CompanyMobile + "',[CompanyMobile]) " +
                                                " ,[CompanyEmail] = ISNULL('" + objCompanyDetailsSetup.CompanyEmail + "',[CompanyEmail]) " +
                                                " ,[LastUpdateDate] = CAST(GETDATE() AS DateTime) " +
                                                " ,[LastUpdateUserID] = '160ea939-7633-46a8-ae49-f661d12abfd5' " +
                                                " WHERE [CompanyID] = " + objCompanyDetailsSetup.CompanyID + "";
                clsDataManipulation.StoredProcedureExecuteNonQuery(this.ConnectionString, storedProcedureComandText);
                if (objCompanyDetailsSetup.CompanyLogo != null)
                {
                    this.UpdateLogo(objCompanyDetailsSetup);
                }

                UpdateCompanyChart(objCompanyDetailsSetup);
            }
            catch (Exception msgException)
            {
                throw msgException;
            }
        }
        internal void Save(CompanyDetailsSetup objCompanyDetailsSetup)
        {
            try
            {
                if (objCompanyDetailsSetup.CountryID == -1)
                {
                    throw new Exception(" country name is required ");
                }


                objCompanyDetailsSetup.CompanyID = this.GetMaxCompanyID();
                var storedProcedureComandText = "INSERT INTO [comCompanySetup] ([CompanyID],[CountryID],[CompanyName],[CompanyMobile],[CompanyEmail] " +
                                                " ,[DataUsed],[EntryUserID],[EntryDate]) VALUES ( " +
                                                objCompanyDetailsSetup.CompanyID + "," +
                                                objCompanyDetailsSetup.CountryID + ", '" +
                                                objCompanyDetailsSetup.CompanyName + "', '" +
                                                objCompanyDetailsSetup.CompanyMobile + "', '" +
                                                objCompanyDetailsSetup.CompanyEmail + "', '" +
                                                "A" + "', '" +
                                                "160ea939-7633-46a8-ae49-f661d12abfd5" + "'," +
                                                "CAST(GETDATE() AS DateTime));";
                clsDataManipulation.StoredProcedureExecuteNonQuery(this.ConnectionString, storedProcedureComandText);
                if (objCompanyDetailsSetup.CompanyLogo != null)
                {
                    this.UpdateLogo(objCompanyDetailsSetup);
                }

                SaveCompanyChart(objCompanyDetailsSetup);
            }
            catch (Exception msgException)
            {
                throw msgException;
            }
        }
예제 #3
0
        protected void grdCompany_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                int    selectedIndex = Convert.ToInt32(e.CommandArgument.ToString());
                string lblCompanyID  = ((Label)grdCompany.Rows[selectedIndex].FindControl("lblCompanyID")).Text;
                if (e.CommandName.Equals("Select"))
                {
                    string lblCountryID     = ((Label)grdCompany.Rows[selectedIndex].FindControl("lblCountryID")).Text;
                    string lblCompanyName   = ((Label)grdCompany.Rows[selectedIndex].FindControl("lblCompanyName")).Text;
                    string lblCompanyEmail  = ((Label)grdCompany.Rows[selectedIndex].FindControl("lblCompanyEmail")).Text;
                    string lblCompanyMobile = ((Label)grdCompany.Rows[selectedIndex].FindControl("lblCompanyMobile")).Text;

                    ddlCountry.SelectedValue     = lblCountryID;
                    txtCompanyName.Text          = lblCompanyName;
                    txtEmail.Text                = lblCompanyEmail;
                    txtMobile.Text               = lblCompanyMobile;
                    Session["selectedCompanyID"] = lblCompanyID;
                    btnSave.Text = "Update";
                    ShowLogo();
                }
                else if (e.CommandName.Equals("Delete"))
                {
                    _objCompanyDetailsSetup           = new CompanyDetailsSetup();
                    _objCompanyDetailsSetup.CompanyID = Convert.ToInt32(lblCompanyID);
                    _objCompanySetupController        = new CompanySetupController();
                    _objCompanySetupController.Delete(_objCompanyDetailsSetup);
                    this.LoadCompanyDetails();
                }
            }
            catch (Exception msgException)
            {
                clsTopMostMessageBox.Show(msgException.Message);
            }
        }
예제 #4
0
 private void AddCompanyValues()
 {
     try
     {
         _objCompanyDetailsSetup               = new CompanyDetailsSetup();
         _objCompanyDetailsSetup.CountryID     = Convert.ToInt32(ddlCountry.SelectedValue);
         _objCompanyDetailsSetup.CompanyName   = txtCompanyName.Text == string.Empty ? null : txtCompanyName.Text;
         _objCompanyDetailsSetup.CompanyEmail  = txtEmail.Text == string.Empty ? null : txtEmail.Text;
         _objCompanyDetailsSetup.CompanyMobile = txtMobile.Text == string.Empty ? null : txtMobile.Text;
         _objCompanyDetailsSetup.CompanyLogo   = (byte[])ViewState["profileImage"];
         _objCompanySetupController            = new CompanySetupController();
         if (btnSave.Text == "Update")
         {
             _objCompanyDetailsSetup.CompanyID = Convert.ToInt32(Session["selectedCompanyID"].ToString());
             _objCompanySetupController.Update(_objCompanyDetailsSetup);
         }
         else
         {
             _objCompanySetupController.Save(_objCompanyDetailsSetup);
         }
     }
     catch (Exception msgException)
     {
         throw msgException;
     }
 }
        private void AddCompanyValues()
        {
            try
            {
                _objCompanyDetailsSetup               = new CompanyDetailsSetup();
                _objCompanyDetailsSetup.CountryID     = Convert.ToInt32(ddlCountry.SelectedValue);
                _objCompanyDetailsSetup.CompanyName   = txtCompanyName.Text == string.Empty ? null : txtCompanyName.Text;
                _objCompanyDetailsSetup.CompanyEmail  = txtEmail.Text == string.Empty ? null : txtEmail.Text;
                _objCompanyDetailsSetup.CompanyMobile = txtMobile.Text == string.Empty ? null : txtMobile.Text;
                _objCompanyDetailsSetup.CompanyLogo   = (byte[])ViewState["profileImage"];

                _objCompanyDetailsSetup.CompanyShortName                    = txtShortName.Text == string.Empty ? null : txtShortName.Text;
                _objCompanyDetailsSetup.CompanySlogun                       = txtSlogun.Text == string.Empty ? null : txtSlogun.Text;
                _objCompanyDetailsSetup.House                               = txtHouse.Text == string.Empty ? null : txtHouse.Text;
                _objCompanyDetailsSetup.Road                                = txtRoad.Text == string.Empty ? null : txtRoad.Text;
                _objCompanyDetailsSetup.Sector                              = txtSector.Text == string.Empty ? null : txtSector.Text;
                _objCompanyDetailsSetup.Landmark                            = txtLandmark.Text == string.Empty ? null : txtLandmark.Text;
                _objCompanyDetailsSetup.ContactPersonName                   = txtContactPersonName.Text == string.Empty ? null : txtContactPersonName.Text;
                _objCompanyDetailsSetup.ContactPersonDesignation            = ddlContactPersonDesignation.SelectedValue == "-1" ? null : ddlContactPersonDesignation.SelectedValue;
                _objCompanyDetailsSetup.ContactPersonContactNumber          = txtContactNumber.Text == string.Empty ? null : txtContactNumber.Text;
                _objCompanyDetailsSetup.AlternateContactPersonName          = txtAltContName.Text == string.Empty ? null : txtAltContName.Text;
                _objCompanyDetailsSetup.AlternateContactPersonDesignation   = ddlAltContDesignation.SelectedValue == "-1" ? null : ddlAltContDesignation.SelectedValue;
                _objCompanyDetailsSetup.AlternateContactPersonContactNumber = txtAltContactNumber.Text == string.Empty ? null : txtAltContactNumber.Text;
                _objCompanyDetailsSetup.CompanyPhones                       = txtPhone.Text == string.Empty ? null : txtPhone.Text;
                _objCompanyDetailsSetup.CompanyFax                          = txtFax.Text == string.Empty ? null : txtFax.Text;
                _objCompanyDetailsSetup.CompanyURL                          = txtURL.Text == string.Empty ? null : txtURL.Text;

                _objCompanyDetailsSetup.LicenceID  = Convert.ToInt32(txtLicence.Text == string.Empty ? null : txtLicence.Text);
                _objCompanyDetailsSetup.FaceBookID = txtFaceBook.Text == string.Empty ? null : txtFaceBook.Text;
                _objCompanyDetailsSetup.LinkedInID = txtLinkedInID.Text == string.Empty ? null : txtLinkedInID.Text;
                _objCompanyDetailsSetup.TwitterID  = txtTwitterID.Text == string.Empty ? null : txtTwitterID.Text;
                _objCompanyDetailsSetup.YouTubeID  = txtYouTubeID.Text == string.Empty ? null : txtYouTubeID.Text;
                _objBusinessType = new BusinessType();
                _objBusinessType.BusinessTypeID = ddlBusinessType.SelectedValue == "-1" ? Convert.ToInt32(null) : Convert.ToInt32(ddlBusinessType.SelectedValue);
                _objOwnershipType = new OwnershipType();
                _objOwnershipType.OwnershipTypeID = ddlOwnershipType.SelectedValue == "-1" ? Convert.ToInt32(null) : Convert.ToInt32(ddlOwnershipType.SelectedValue);
                _objDistrictSetup            = new DistrictSetup();
                _objDistrictSetup.DistrictID = ddlDistrict.SelectedValue == "-1" ? Convert.ToInt32(null) : Convert.ToInt32(ddlDistrict.SelectedValue);

                _objCompanySetupController = new CompanySetupController();
                if (btnSave.Text == "Update")
                {
                    _objCompanyDetailsSetup.CompanyID = Convert.ToInt32(Session["selectedCompanyID"].ToString());
                    _objCompanySetupController.Update(_objCompanyDetailsSetup);
                    _objCompanySetupController.UpdateByUser(_objCompanyDetailsSetup, _objBusinessType, _objOwnershipType, _objDistrictSetup);
                }
            }
            catch (Exception msgException)
            {
                throw msgException;
            }
        }
 internal DataTable GetLogo(CompanyDetailsSetup objCompanyDetailsSetup)
 {
     try
     {
         DataTable dtLogo = null;
         var       storedProcedureComandText = @"select CompanyLogo from [comCompanySetup] WHERE CompanyID = '" + objCompanyDetailsSetup.CompanyID + "'";
         dtLogo = clsDataManipulation.GetData(this.ConnectionString, storedProcedureComandText);
         return(dtLogo);
     }
     catch (Exception msgException)
     {
         throw msgException;
     }
 }
 private void DeleteCompanyChart(CompanyDetailsSetup objCompanyDetailsSetup)
 {
     try
     {
         _objOrganizationalChartSetup           = new OrganizationalChartSetup();
         _objOrganizationalChartSetup.EntityID  = objCompanyDetailsSetup.CompanyID;
         _objOrganizationalChartSetupController = new OrganizationalChartSetupController();
         _objOrganizationalChartSetupController.DeleteChart(_objOrganizationalChartSetup);
     }
     catch (Exception msgException)
     {
         throw msgException;
     }
 }
        internal void Delete(CompanyDetailsSetup objCompanyDetailsSetup)
        {
            try
            {
                var storedProcedureComandText = "UPDATE [comCompanySetup] SET DataUsed	= 'I' WHERE CompanyID = "+ objCompanyDetailsSetup.CompanyID + "";
                clsDataManipulation.StoredProcedureExecuteNonQuery(this.ConnectionString, storedProcedureComandText);

                DeleteCompanyChart(objCompanyDetailsSetup);
            }
            catch (Exception msgException)
            {
                throw msgException;
            }
        }
 private void UpdateCompanyChart(CompanyDetailsSetup objCompanyDetailsSetup)
 {
     try
     {
         _objOrganizationalChartSetup               = new OrganizationalChartSetup();
         objCompanyDetailsSetup.EntryUserName       = "******";
         _objOrganizationalChartSetup.EntityID      = objCompanyDetailsSetup.CompanyID;
         _objOrganizationalChartSetup.EntityName    = objCompanyDetailsSetup.CompanyName;
         _objOrganizationalChartSetup.EntryUserName = objCompanyDetailsSetup.EntryUserName;
         _objOrganizationalChartSetupController     = new OrganizationalChartSetupController();
         _objOrganizationalChartSetupController.UpdateChart(_objOrganizationalChartSetup);
     }
     catch (Exception msgException)
     {
         throw msgException;
     }
 }
 internal void UpdateLogo(CompanyDetailsSetup objCompanyDetailsSetup)
 {
     try
     {
         SqlConnection con = null;
         con = new SqlConnection(this.ConnectionString);
         SqlCommand cmd = new SqlCommand();
         cmd.CommandText = "UPDATE [comCompanySetup] SET CompanyLogo = @CompanyLogo WHERE CompanyID = @CompanyID";
         cmd.Connection  = con;
         cmd.Parameters.AddWithValue("@CompanyLogo", objCompanyDetailsSetup.CompanyLogo);
         cmd.Parameters.AddWithValue("@CompanyID", objCompanyDetailsSetup.CompanyID);
         con.Open();
         cmd.ExecuteNonQuery();
         con.Close();
     }
     catch (Exception msgException)
     {
         throw msgException;
     }
 }
        internal void UpdateByUser(CompanyDetailsSetup objCompanyDetailsSetup, BusinessType objBusinessType, OwnershipType objOwnershipType, DistrictSetup objDistrictSetup)
        {
            try
            {
                var storedProcedureComandText = "UPDATE [comCompanySetup] " +
                                                " SET [CompanyShortName] = ISNULL('" + objCompanyDetailsSetup.CompanyShortName + "',[CompanyShortName]) " +
                                                " ,[CompanySlogun] = ISNULL('" + objCompanyDetailsSetup.CompanySlogun + "',[CompanySlogun]) " +
                                                " ,[House] = ISNULL('" + objCompanyDetailsSetup.House + "',[House]) " +
                                                " ,[Road] = ISNULL('" + objCompanyDetailsSetup.Road + "',[Road]) " +
                                                " ,[Sector] = ISNULL('" + objCompanyDetailsSetup.Sector + "',[Sector]) " +
                                                " ,[Landmark] = ISNULL('" + objCompanyDetailsSetup.Landmark + "',[Landmark]) " +
                                                " ,[ContactPersonName] = ISNULL('" + objCompanyDetailsSetup.ContactPersonName + "',[ContactPersonName]) " +
                                                " ,[ContactPersonDesignation] = ISNULL('" + objCompanyDetailsSetup.ContactPersonDesignation + "',[ContactPersonDesignation]) " +
                                                " ,[ContactPersonContactNumber] = ISNULL('" + objCompanyDetailsSetup.ContactPersonContactNumber + "',[ContactPersonContactNumber]) " +
                                                " ,[AlternateContactPersonName] = ISNULL('" + objCompanyDetailsSetup.AlternateContactPersonName + "',[AlternateContactPersonName]) " +
                                                " ,[AlternateContactPersonDesignation] = ISNULL('" + objCompanyDetailsSetup.AlternateContactPersonDesignation + "',[AlternateContactPersonDesignation]) " +
                                                " ,[AlternateContactPersonContactNumber] = ISNULL('" + objCompanyDetailsSetup.AlternateContactPersonContactNumber + "',[AlternateContactPersonContactNumber]) " +
                                                " ,[CompanyPhones] = ISNULL('" + objCompanyDetailsSetup.CompanyPhones + "',[CompanyPhones]) " +
                                                " ,[CompanyFax] = ISNULL('" + objCompanyDetailsSetup.CompanyFax + "',[CompanyFax]) " +
                                                " ,[CompanyURL] = ISNULL('" + objCompanyDetailsSetup.CompanyURL + "',[CompanyURL]) " +
                                                " ,[LicenceID] = ISNULL(" + objCompanyDetailsSetup.LicenceID + ",[LicenceID]) " +
                                                " ,[FaceBookID] = ISNULL('" + objCompanyDetailsSetup.FaceBookID + "',[FaceBookID]) " +
                                                " ,[LinkedInID] = ISNULL('" + objCompanyDetailsSetup.LinkedInID + "',[LinkedInID]) " +
                                                " ,[TwitterID] = ISNULL('" + objCompanyDetailsSetup.TwitterID + "',[TwitterID]) " +
                                                " ,[YouTubeID] = ISNULL('" + objCompanyDetailsSetup.YouTubeID + "',[YouTubeID]) " +
                                                " ,[BusinessTypeID] = ISNULL(" + objBusinessType.BusinessTypeID + ",[BusinessTypeID]) " +
                                                " ,[OwnershipTypeID] = ISNULL(" + objOwnershipType.OwnershipTypeID + ",[OwnershipTypeID]) " +
                                                " ,[DistrictID] = ISNULL(" + objDistrictSetup.DistrictID + ",[DistrictID]) " +
                                                " ,[LastUpdateDate] = CAST(GETDATE() AS DateTime) " +
                                                " ,[LastUpdateUserID] = '160ea939-7633-46a8-ae49-f661d12abfd5' " +
                                                " WHERE [CompanyID] = " + objCompanyDetailsSetup.CompanyID + "";
                clsDataManipulation.StoredProcedureExecuteNonQuery(this.ConnectionString, storedProcedureComandText);

                this.UpdateCompanyChart(objCompanyDetailsSetup);
            }
            catch (Exception msgException)
            {
                throw msgException;
            }
        }
 private void SaveCompanyChart(CompanyDetailsSetup objCompanyDetailsSetup)
 {
     try
     {
         _objOrganizationalChartSetup                = new OrganizationalChartSetup();
         objCompanyDetailsSetup.EntryUserName        = "******";
         _objOrganizationalChartSetup.CompanyID      = objCompanyDetailsSetup.CompanyID;
         _objOrganizationalChartSetup.ParentEntityID = 111;
         _objOrganizationalChartSetup.EntityID       = objCompanyDetailsSetup.CompanyID;
         _objOrganizationalChartSetup.AddressTag     = "N";
         _objOrganizationalChartSetup.AddressID      = objCompanyDetailsSetup.CompanyID;
         _objOrganizationalChartSetup.EntityName     = objCompanyDetailsSetup.CompanyName;
         _objOrganizationalChartSetup.EntityTypeID   = 1;
         _objOrganizationalChartSetup.EntryUserName  = objCompanyDetailsSetup.EntryUserName;
         _objOrganizationalChartSetupController      = new OrganizationalChartSetupController();
         _objOrganizationalChartSetupController.SaveChart(_objOrganizationalChartSetup);
     }
     catch (Exception msgException)
     {
         throw msgException;
     }
 }
        internal DataTable GetDataOfUser(CompanyDetailsSetup objCompanyDetailsSetup)
        {
            try
            {
                DataTable dtRecord = null;
                var       storedProcedureComandText = @"SELECT
	                [CompanyShortName]
                      ,[BusinessTypeID]
                      ,[OwnershipTypeID]
                      ,[CompanySlogun]
                      ,[House]
                      ,[Road]
                      ,[Sector]
                      ,[Landmark]
                      ,[DistrictID]
                      ,[ContactPersonName]
                      ,[ContactPersonDesignation]
                      ,[ContactPersonContactNumber]
                      ,[AlternateContactPersonName]
                      ,[AlternateContactPersonDesignation]
                      ,[AlternateContactPersonContactNumber]
                      ,[CompanyPhones]
                      ,[CompanyFax]
                      ,[CompanyURL]
                      ,[LicenceID]
                      ,[FaceBookID]
                      ,[LinkedInID]
                      ,[TwitterID]
                      ,[YouTubeID]
                  FROM [comCompanySetup]
                  WHERE CompanyID = " + objCompanyDetailsSetup.CompanyID + "";
                dtRecord = clsDataManipulation.GetData(this.ConnectionString, storedProcedureComandText);
                return(dtRecord);
            }
            catch (Exception msgException)
            {
                throw msgException;
            }
        }
 private void ShowLogo()
 {
     try
     {
         ViewState["profileImage"]         = null;
         lblImage.Text                     = "<br />  Logo <br />  Not <br />  Available ";
         _objCompanyDetailsSetup           = new CompanyDetailsSetup();
         _objCompanyDetailsSetup.CompanyID = Convert.ToInt32(Session["selectedCompanyID"].ToString());
         _objCompanySetupController        = new CompanySetupController();
         DataTable dtLogo = _objCompanySetupController.GetLogo(_objCompanyDetailsSetup);
         if (dtLogo.Rows.Count > 0)
         {
             var    img          = (byte[])dtLogo.Rows[0].ItemArray[0];
             string base64string = Convert.ToBase64String(img, 0, img.Length);
             lblImage.Text             = "<img src='data:image/png;base64," + base64string + "' alt='<br />  Logo <br />  Not <br />  Available ' width='150px' hight='150px' vspace='5px' hspace='5px' />";
             ViewState["profileImage"] = img;
         }
     }
     catch (Exception msgException)
     {
         throw msgException;
     }
 }
        private void ShowDataOfUser()
        {
            try
            {
                _objCompanyDetailsSetup           = new CompanyDetailsSetup();
                _objCompanyDetailsSetup.CompanyID = Convert.ToInt32(Session["selectedCompanyID"].ToString());
                _objCompanySetupController        = new CompanySetupController();
                DataTable dtUserData = _objCompanySetupController.GetDataOfUser(_objCompanyDetailsSetup);
                this.ClearControlByUser();
                foreach (DataRow rowNo in dtUserData.Rows)
                {
                    txtShortName.Text         = rowNo["CompanyShortName"].ToString() == null ? string.Empty : rowNo["CompanyShortName"].ToString();
                    txtSlogun.Text            = rowNo["CompanySlogun"].ToString() == null ? string.Empty : rowNo["CompanySlogun"].ToString();
                    txtHouse.Text             = rowNo["House"].ToString() == null ? string.Empty : rowNo["House"].ToString();
                    txtRoad.Text              = rowNo["Road"].ToString() == null ? string.Empty : rowNo["Road"].ToString();
                    txtSector.Text            = rowNo["Sector"].ToString() == null ? string.Empty : rowNo["Sector"].ToString();
                    txtLandmark.Text          = rowNo["Landmark"].ToString() == null ? string.Empty : rowNo["Landmark"].ToString();
                    txtContactPersonName.Text = rowNo["ContactPersonName"].ToString() == null ? string.Empty : rowNo["ContactPersonName"].ToString();

                    var contactPersonDesignation = rowNo["ContactPersonDesignation"].ToString();
                    if (contactPersonDesignation == null || contactPersonDesignation == "0" || contactPersonDesignation == "")
                    {
                        ddlContactPersonDesignation.SelectedValue = "-1";
                    }
                    else
                    {
                        ddlContactPersonDesignation.SelectedValue = contactPersonDesignation;
                    }


                    txtContactNumber.Text = rowNo["ContactPersonContactNumber"].ToString() == null ? string.Empty : rowNo["ContactPersonContactNumber"].ToString();
                    txtAltContName.Text   = rowNo["AlternateContactPersonName"].ToString() == null ? string.Empty : rowNo["AlternateContactPersonName"].ToString();

                    var AltContDesignation = rowNo["AlternateContactPersonDesignation"].ToString();
                    if (AltContDesignation == null || AltContDesignation == "0" || AltContDesignation == "")
                    {
                        ddlAltContDesignation.SelectedValue = "-1";
                    }
                    else
                    {
                        ddlAltContDesignation.SelectedValue = AltContDesignation;
                    }


                    txtAltContactNumber.Text = rowNo["AlternateContactPersonContactNumber"].ToString() == null ? string.Empty : rowNo["AlternateContactPersonContactNumber"].ToString();
                    txtPhone.Text            = rowNo["CompanyPhones"].ToString() == null ? string.Empty : rowNo["CompanyPhones"].ToString();
                    txtFax.Text = rowNo["CompanyFax"].ToString() == null ? string.Empty : rowNo["CompanyFax"].ToString();
                    txtURL.Text = rowNo["CompanyURL"].ToString() == null ? string.Empty : rowNo["CompanyURL"].ToString();
                    var licenceNo = rowNo["LicenceID"].ToString();
                    if (licenceNo == null || licenceNo == "0" || licenceNo == "")
                    {
                        txtLicence.Text = string.Empty;
                    }
                    else
                    {
                        txtLicence.Text = licenceNo;
                    }


                    txtFaceBook.Text   = rowNo["FaceBookID"].ToString() == null ? string.Empty : rowNo["FaceBookID"].ToString();
                    txtLinkedInID.Text = rowNo["LinkedInID"].ToString() == null ? string.Empty : rowNo["LinkedInID"].ToString();
                    txtTwitterID.Text  = rowNo["TwitterID"].ToString() == null ? string.Empty : rowNo["TwitterID"].ToString();
                    txtYouTubeID.Text  = rowNo["YouTubeID"].ToString() == null ? string.Empty : rowNo["YouTubeID"].ToString();
                    var businessType = rowNo["BusinessTypeID"].ToString();
                    if (businessType == null || businessType == "0" || businessType == "")
                    {
                        ddlBusinessType.SelectedValue = "-1";
                    }
                    else
                    {
                        ddlBusinessType.SelectedValue = businessType;
                    }

                    var ownershipType = rowNo["OwnershipTypeID"].ToString();
                    if (ownershipType == null || ownershipType == "-1" || ownershipType == "")
                    {
                        ddlOwnershipType.SelectedValue = "-1";
                    }
                    else
                    {
                        ddlOwnershipType.SelectedValue = ownershipType;
                    }

                    var districtID = rowNo["DistrictID"].ToString();
                    if (districtID == null || districtID == "-1" || districtID == "")
                    {
                        ddlDistrict.SelectedValue = "-1";
                    }
                    else
                    {
                        ddlDistrict.SelectedValue = districtID;
                    }
                }
            }
            catch (Exception msgException)
            {
                throw msgException;
            }
        }