Esempio n. 1
0
 private void defaultPopClients()
 {
     List<ClientBE> objClientBE = new List<ClientBE>();
     // objClientBE = objClientDA.GetClientDetailDA(objUtil.FormDBDate(DateTime.Now.AddMonths(-3)), objUtil.FormDBDate(DateTime.Now.AddMonths(3)));
     dpFrom.SelectedDate = DateTime.Now.AddDays(-30);
     dpTo.SelectedDate = DateTime.Now.AddDays(30);
     objClientBE = objClientDA.GetClientDetailDA(objUtil.FormDBDate(DateTime.Now.AddDays(-30)), objUtil.FormDBDate(DateTime.Now.AddDays(30)));
     tgrdClientList.DataSource = objClientBE;
     tgrdClientList.DataBind();
 }
Esempio n. 2
0
        private void popClients()
        {
            string errMsg = "";

            List<ClientBE> objClientBE = new List<ClientBE>();
            //ClientDA objClientDA = new ClientDA();
            string dt1 = "", dt2 = "";
            lblFilterError.Text = "";
            if (dpFrom.SelectedDate.ToString() != "")
                dt1 = objUtil.FormDBDate(Convert.ToDateTime(dpFrom.SelectedDate));
            if (dpTo.SelectedDate.ToString() != "")
                dt2 = objUtil.FormDBDate(Convert.ToDateTime(dpTo.SelectedDate));
            if (dt1 != "" && dt2 != "")
            {
                TimeSpan span = (Convert.ToDateTime(dpTo.SelectedDate)).Subtract(Convert.ToDateTime(dpFrom.SelectedDate));
                if (span.Days < 0)
                    errMsg = objError.getMessage("SS0002");
            }

            if (errMsg != "")
            {
                lblFilterError.Text = errMsg;
                //tgrdClientList.DataSource = null;
                //tgrdClientList.DataBind();
            }
            //else
            //{
            objClientBE = objClientDA.GetClientDetailDA(txtSearch.Text.Trim(), rcmbPkgType.SelectedValue, dt1, dt2);
            tgrdClientList.DataSource = objClientBE;
            tgrdClientList.DataBind();
            //}
        }
Esempio n. 3
0
 public void SaveDefaultClientConfigDA(ClientBE objClientBE, int CreatedBy)
 {
     try
     {
         using (MySqlConnection sqlCon = new MySqlConnection(Constant.EBirdConnectionString))
         {
             using (MySqlCommand sqlCmd = new MySqlCommand("spClientDefaultConfigUpdate", sqlCon))
             {
                 sqlCmd.CommandType = CommandType.StoredProcedure;
                 sqlCmd.Parameters.Add(new MySqlParameter("pTimezoneID", objClientBE.TimeZoneID));
                 sqlCmd.Parameters.Add(new MySqlParameter("pLanguageID", objClientBE.LanguageID));
                 sqlCmd.Parameters.Add(new MySqlParameter("pDateFormat", objClientBE.DateFormat));
                 sqlCmd.Parameters.Add(new MySqlParameter("pIsAutoDLSave", objClientBE.isAutoDLSave));
                 sqlCmd.Parameters.Add(new MySqlParameter("pClientID", objClientBE.ClientID));
                 sqlCmd.Parameters.Add(new MySqlParameter("pCreatedBy", CreatedBy));
                 sqlCmd.Connection.Open();
                 sqlCmd.ExecuteNonQuery();
                 sqlCmd.Connection.Close();
             }
         }
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
 }
Esempio n. 4
0
        private void getClientDetail(int clientID)
        {
            string modifiedOn = "";

            List<ClientBE> objClientBE = new List<ClientBE>();
            objClientBE = objClientDA.GetClientDetailDA(clientID);

            if (objClientBE.Count > 0)
            {
                rcmbStatus.Enabled = true;
                hClientID.Value = clientID.ToString();
                txtClientName.Text = objClientBE[0].ClientName;
                txtAddress.Text = objClientBE[0].Address1;
                txtCity.Text = objClientBE[0].City;
                txtNoUsers.Text = objClientBE[0].NoOfUsers.ToString();
                txtPhone.Text = objClientBE[0].Phone;
                txtPostcode.Text = objClientBE[0].PostCode;
                txtState.Text = objClientBE[0].State;
                txtWebsite.Text = objClientBE[0].Website;
                rcmbCountry.SelectedValue = objClientBE[0].CountryID.ToString();
                rcmbIndustry.SelectedValue = objClientBE[0].IndustryID.ToString();
                rcmbRevenue.SelectedValue = objClientBE[0].AnnualRevID.ToString();
                if (chkPackage.Items.Count > 2)
                {
                    chkPackage.Items.RemoveAt(2);
                }
                if (objClientBE[0].CurrentPkgSubscribed == "Custom")
                {
                    chkPackage.Items.Add(new ListItem("Custom", "Custom"));
                }
                chkPackage.SelectedValue = objClientBE[0].CurrentPkgSubscribed;
                rcmbStatus.SelectedValue = objClientBE[0].ClientStatus;
                hCurrStatus.Value = objClientBE[0].ClientStatus;
                modifiedOn = objClientBE[0].LastModified;
                hCurrPkg.Value = objClientBE[0].CurrentPkgSubscribed;

                //dvStep.Visible = true;

                int[] usrCount = objUserDA.GetClientUserCountDA(clientID);
                if (usrCount[0].ToString() == "1")
                    lblActiveUserCnt.Text = " (" + usrCount[0].ToString() + " Active User)";
                else
                    lblActiveUserCnt.Text = " (" + usrCount[0].ToString() + " Active Users)";
                hActiveUserCnt.Value = usrCount[0].ToString();
            }

            List<ContactBE> objContactBE = new List<ContactBE>();
            objContactBE = objClientDA.GetClientContactDA(clientID);
            if (objContactBE.Count > 0)
            {
                hContactID.Value = objContactBE[0].ContactID.ToString();
                txtContactName.Text = objContactBE[0].Contactname;
                txtContactEmail.Text = objContactBE[0].Email;
                txtContactPhone.Text = objContactBE[0].Phone;
                txtContactDepart.Text = objContactBE[0].Department;
                txtJobTitle.Text = objContactBE[0].JobTitle;
            }

            List<UserBE> objUserBE = new List<UserBE>();
            objUserBE = objUserDA.GetPrimaryAdminDA(clientID);
            if (objUserBE.Count > 0)
            {
                hAdminID.Value = objUserBE[0].UserID.ToString();
                txtAdminFName.Text = objUserBE[0].FirstName;
                txtAdminLName.Text = objUserBE[0].LastName;
                txtAdminEmail.Text = objUserBE[0].EmailID;
                txtAdminPhone.Text = objUserBE[0].Telephone;
                txtAdminDept.Text = objUserBE[0].Department;
            }

            if (hCurrStatus.Value == "Inactive")
            {
                dvAlert.Visible = true;
                System.TimeSpan diffResult = DateTime.Now - Convert.ToDateTime(modifiedOn);
                string[] arrValues = new string[1];
                arrValues[0] = Convert.ToString(diffResult.Days);
                lblInactiveMsg.Text = objError.getMessage("SS0001", arrValues);
                btnSave.Visible = false;
                btnActivate.Visible = true;
                //rcmbStatus.Visible = false;
                PlaceHolderReactivate.Visible = true;
                PlaceHolderActive.Visible = false;
            }
            else
            {
                dvAlert.Visible = false;
                btnSave.Visible = true;
                //btnActivate.Visible = false;
                //rcmbStatus.Visible = true;
                PlaceHolderReactivate.Visible = false;
                PlaceHolderActive.Visible = true;
            }
        }
Esempio n. 5
0
        public int SaveClientProfileDA(ClientBE objClientBE)
        {
            int rtnVal = 0;
            try
            {
                using (MySqlConnection sqlCon = new MySqlConnection(Constant.EBirdConnectionString))
                {
                    MySqlCommand sqlCmd = new MySqlCommand("spSaveClientProfile", sqlCon);
                    sqlCon.Open();
                    sqlCmd.CommandType = CommandType.StoredProcedure;

                    sqlCmd.Parameters.Add(new MySqlParameter("pClientName", objClientBE.ClientName));
                    sqlCmd.Parameters.Add(new MySqlParameter("pAddress1", objClientBE.Address1));
                    sqlCmd.Parameters.Add(new MySqlParameter("pAddress2", objClientBE.Address2));
                    sqlCmd.Parameters.Add(new MySqlParameter("pCity", objClientBE.City));
                    sqlCmd.Parameters.Add(new MySqlParameter("pState", objClientBE.State));
                    sqlCmd.Parameters.Add(new MySqlParameter("pCountryID", objClientBE.CountryID));
                    sqlCmd.Parameters.Add(new MySqlParameter("pPostCode", objClientBE.PostCode));
                    sqlCmd.Parameters.Add(new MySqlParameter("pPhone", objClientBE.Phone));
                    sqlCmd.Parameters.Add(new MySqlParameter("pWebsite", objClientBE.Website));
                    sqlCmd.Parameters.Add(new MySqlParameter("pIndustryID", objClientBE.IndustryID));
                    sqlCmd.Parameters.Add(new MySqlParameter("pAnnualRevID", objClientBE.AnnualRevID));
                    sqlCmd.Parameters.Add(new MySqlParameter("pNoOfUsers", objClientBE.NoOfUsers));
                    sqlCmd.Parameters.Add(new MySqlParameter("pClientStatus", objClientBE.ClientStatus));
                    sqlCmd.Parameters.Add(new MySqlParameter("pCurrentPkgSubscribed", objClientBE.CurrentPkgSubscribed));
                    sqlCmd.Parameters.Add(new MySqlParameter("pCreatedBy", objClientBE.CreatedBy));
                    sqlCmd.Parameters.Add(new MySqlParameter("pClientID", objClientBE.ClientID));

                    MySqlDataReader reader = sqlCmd.ExecuteReader();
                    if (reader.HasRows)
                    {
                        reader.Read();
                        rtnVal = Convert.ToInt32(reader[0]);
                    }
                    reader.Close();
                    reader = null;
                    return rtnVal;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }