private void AddStatusDate() { DataTable dt = ObjDAL.GetData(clsUtility.DBName + ".dbo.RegistrationDetails", "PcName='" + Environment.MachineName + "'", "RegistrationID"); if (dt != null && dt.Rows.Count > 0) { DateTime status = Convert.ToDateTime(ObjUtil.Decrypt(dt.Rows[0]["StatusDate"].ToString(), true)); DateTime ExpDate = Convert.ToDateTime(ObjUtil.Decrypt(dt.Rows[0]["ExpiryDate"].ToString(), true)); //if (dt.Rows[0]["StatusDate"] != DBNull.Value && Convert.ToDateTime(dt.Rows[0]["StatusDate"]) <= DateTime.Now && Convert.ToDateTime(dt.Rows[0]["ExpiryDate"]) >= DateTime.Now) if (dt.Rows[0]["StatusDate"] != DBNull.Value && status <= ExpDate) { if (status <= Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd h:mm:ss tt"))) { ObjDAL.UpdateColumnData("StatusDate", SqlDbType.VarChar, ObjUtil.Encrypt(DateTime.Now.ToString(), true)); ObjDAL.UpdateData(clsUtility.DBName + ".dbo.RegistrationDetails", "PcName='" + Environment.MachineName + "'"); } } if (dt.Rows[0]["SoftKey"] == DBNull.Value) { lblStatus.Text = lblStatus.Text + " UnRegistered Version"; } else { lblStatus.Text = lblStatus.Text + " Registered Version"; } } else { lblStatus.Text = lblStatus.Text + " UnRegistered Version"; } }
private void ValidatingExpDate() { DataTable dt = ObjDAL.GetData(clsUtility.DBName + ".dbo.RegistrationDetails", "[PcName]='" + Environment.MachineName + "' and [IsKeyEnter]=1", "RegistrationID"); if (dt != null && dt.Rows.Count > 0) { dDatetimepicker dd = new dDatetimepicker(ValidatingExpDate); if (dtpExpiryDate.InvokeRequired) { this.Invoke(dd, null); } else { dtpExpiryDate.Value = Convert.ToDateTime(Objutil.Decrypt(dt.Rows[0]["ExpiryDate"].ToString(), true)); dtpExpiryDate.Enabled = false; } } else { dDatetimepicker dd = new dDatetimepicker(ValidatingExpDate); if (dtpExpiryDate.InvokeRequired) { this.Invoke(dd, null); } else { dtpExpiryDate.Enabled = true; dtpExpiryDate.MinDate = DateTime.Now; dtpExpiryDate.MaxDate = DateTime.Now.AddYears(1); } } }
private bool CountofAdmin() { DataTable dt = ObjDAL.GetData(DBName + ".dbo.UserManagement", "IsAdmin=1", "UserID"); if (dt != null && dt.Rows.Count > 1) { //grpAccount.Enabled = true; return(true); } else { //grpAccount.Enabled = false; return(false); } }
private void CheckAutobackup() { try { DataTable dt = ObjDAL.GetData(clsUtility.DBName + ".dbo.BackupConfig", "ISNULL(IsAutoBackup,0)=1", "BackupID"); if (ObjUtil.ValidateTable(dt)) { flowLayoutPanel1.Visible = true; btnAutoBackup.Visible = true; lblBackup.Text = "Last Backup Path " + dt.Rows[0]["Path"].ToString() + "" + " On " + Convert.ToDateTime(dt.Rows[0]["Date"]).ToString("dd/MM/yyyy hh:mm:ss tt"); } else { lblBackup.Text = string.Empty; //flowLayoutPanel1.Visible = false; //btnAutoBackup.Visible = false; } } catch (Exception ex) { clsUtility.ShowErrorMessage(ex.ToString(), clsUtility.strProjectTitle); } }