public frmMainMenu()
 {
     InitializeComponent();
     this.subTotal                  = 0;
     btnPaid.Enabled                = false;
     btnChangeGiven.Enabled         = false;
     lblPaymentStatusText.Text      = "Ready! For Next Sale";
     lblPaymentStatusText.ForeColor = Color.Red;
     picNetworkActivity.Image       = null; //global::Shop_Management_Solution.Properties.Resources.loading;
     try
     {
         bool isAvailable = NetworkUtil.isNetworkAvailable();
         if (isAvailable)
         {
             picConnectivity.Image = global::Shop_Management_Solution.Properties.Resources.gnome_network_idle;
         }
         else
         {
             picConnectivity.Image = global::Shop_Management_Solution.Properties.Resources.network_offline;
         }
         NetworkChange.NetworkAvailabilityChanged += AvailabilityChanged;
         UpdateDAL.RegisterClient();
     }
     catch (Exception ex)
     {
         //picConnectivity.Image = global::Shop_Management_Solution.Properties.Resources.network_offline;
         // tipConnectivity.SetToolTip(picConnectivity, "Disconnected");
     }
 }
Exemple #2
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     try
     {
         if (validateCommentData())
         {
             Comment objComment = new Comment();
             objComment.Name     = txtName.Text.ToString();
             objComment.Email    = txtEmail.Text.ToString();
             objComment.Comments = txtComments.Text.ToString();
             objComment.Rating   = cmbRating.SelectedValue.ToString();
             string result = UpdateDAL.postComments(objComment);
             MessageBox.Show(this, result, "Send us feedback", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.Close();
         }
         else
         {
             highlitghtMissingCommentData();
         }
     }
     catch (Exception ex)
     {
         ///
     }
 }
Exemple #3
0
 private void btnReport_Click(object sender, EventArgs e)
 {
     try
     {
         if (validateReportBugData())
         {
             Bug objBug = new Bug();
             objBug.Title       = txtTitle.Text.ToString();
             objBug.Description = txtDescription.Text.ToString();
             objBug.Module      = cmbModule.Text.ToString();
             objBug.Serverity   = cmbSeverity.Text.ToString();
             string result = UpdateDAL.reportABug(objBug);
             MessageBox.Show(this, result, "Report a bug", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.Close();
         }
         else
         {
             highlitghtMissingReportBugData();
         }
     }
     catch (Exception ex)
     {
         ///
     }
 }
 private void mb_update_Click(object sender, EventArgs e)
 {
     try
     {
         picNetworkActivity.Image = global::Shop_Management_Solution.Properties.Resources.loading;
         UpdateDAL.checkForUpdates();
         picNetworkActivity.Image = null;
     }
     catch (Exception ex)
     {
         picNetworkActivity.Image = null;
     }
 }
        private void AvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
        {
            try
            {
                if (e.IsAvailable)
                {
                    picConnectivity.Image = global::Shop_Management_Solution.Properties.Resources.gnome_network_idle;

                    UpdateDAL.RegisterClient();
                }
                else
                {
                    picConnectivity.Image = global::Shop_Management_Solution.Properties.Resources.network_offline;
                }
            }
            catch (Exception ex)
            {
                //picConnectivity.Image = global::Shop_Management_Solution.Properties.Resources.network_offline;
                //tipConnectivity.SetToolTip(picConnectivity, "Disconnected");
            }
        }
Exemple #6
0
        public string UserLogin(object jData)
        {
            //参数赋值
            JObject t           = JObject.Parse(jData.ToString());
            JToken  juser_email = t.SelectToken("UserEmail");//UserEmail与前端保持一致
            JToken  juser_pwd   = t.SelectToken("UserPwd");

            ShiUsers users = QueryDAL.GetModelTowhereExp <ShiUsers>
                                 (u => u.UserEmail == juser_email.ToString() && u.UserPwd == juser_pwd.ToString());

            if (users != null)
            {
                //创建token:根据用户名+时间通过MD5加密后保证唯一性
                DateTime gettime = DateTime.Now;
                users.UserToken    = MD5Encryption.Md5_32(juser_email.ToString() + gettime.ToString());
                users.TokenEndtiem = gettime;
                //更新到数据库,登录成功后每次访问数据都带上token
                UpdateDAL.update_model <ShiUsers>(users);
                return(users.UserToken);
            }
            // return JsonConvert.SerializeObject("-1");
            return("-1");
        }
Exemple #7
0
 public int UpdateAndroidVersion(AndroidVersionInfo versionInfo)
 {
     return(UpdateDAL.UpdateAndroidVersion(versionInfo));
 }
Exemple #8
0
 public AndroidVersionInfo getAndroidVersion()
 {
     return(UpdateDAL.getAndroidVersion());
 }