Esempio n. 1
0
        public string  GetExistEssencialDecission(int SysID, out EmailInforType.EssencialDecissionType _ExistData)
        {
            _ExistData = new EmailInforType.EssencialDecissionType();
            MySqlCommand oSqlCommand = new MySqlCommand();
            string       sqlQuery    = "Select "
                                       + "SysID,"
                                       + "Department,"
                                       + "FirstPerson,"
                                       + "FirstEmail,"
                                       + "SecondPeson,"
                                       + "SeconfEmail,"
                                       + "Status"
                                       + " from ecoessencialdecission"
                                       + " Where 1=1 and status=1 "
                                       + " and SysID=" + SysID;

            DataRow r = Mycommon.GetDataRow(sqlQuery, "get Email Data");

            if (r != null)
            {
                try
                {
                    bool resp    = false;
                    int  inSysID = 0;
                    resp                   = int.TryParse(r["SysID"].ToString(), out inSysID);
                    _ExistData.SysID       = inSysID;
                    _ExistData.Department  = r["Department"].ToString();
                    _ExistData.FirstPerson = r["FirstPerson"].ToString();
                    _ExistData.FirstEmail  = r["FirstEmail"].ToString();
                    _ExistData.SecondPeson = r["SecondPeson"].ToString();
                    _ExistData.SecondEmail = r["SeconfEmail"].ToString();
                    int inStatus = 0;
                    resp = int.TryParse(r["Status"].ToString(), out inStatus);
                    _ExistData.Status = inStatus;
                    return("True");
                }
                catch (Exception ex)
                {
                    return(ex.Message);
                }
            }
            else
            {
                return("data not found ");
            }
        }
Esempio n. 2
0
        public string GetExistTSMailService(string TimerID, out TSMsilServiceType.TSMailServiceDataType _ExistData)
        {
            _ExistData = new TSMsilServiceType.TSMailServiceDataType();
            MySqlCommand oSqlCommand = new MySqlCommand();
            string       sqlQuery    = "Select "
                                       + "SysID,"
                                       + "TimerID,"
                                       + "Occurence,"
                                       + "TriggerDate,"
                                       + "TriggerTime,"
                                       + "NofTime,"
                                       + "CurrentCount,"
                                       + "TriggerStatus,"
                                       + "SQLStatement,"
                                       + "WhereC0ndition,"
                                       + "SearchText,"
                                       + "SearchValue,"
                                       + "CustomerID,MailListID"
                                       + " from tblservicetimer"
                                       + " Where 1=1 "
                                       + " and TimerID=@TimerID";

            oSqlCommand.Parameters.AddWithValue("@TimerID", TimerID);
            DataRow r = Mycommon.GetDataRow(sqlQuery, oSqlCommand, null, "Get Exist data TSMailService");

            if (r != null)
            {
                try
                {
                    bool resp    = false;
                    int  inSysID = 0;
                    resp                 = int.TryParse(r["SysID"].ToString(), out inSysID);
                    _ExistData.SysID     = inSysID;
                    _ExistData.TimerID   = r["TimerID"].ToString();
                    _ExistData.Occurence = r["Occurence"].ToString();
                    DateTime dtTriggerDate = new DateTime(1900, 1, 1);
                    resp = DateTime.TryParse(r["TriggerDate"].ToString(), out dtTriggerDate);
                    if (resp)
                    {
                        _ExistData.TriggerDate = dtTriggerDate;
                    }
                    else
                    {
                        _ExistData.TriggerDate = new DateTime(1900, 1, 1);
                    }
                    _ExistData.TriggerTime = r["TriggerTime"].ToString();
                    int inNofTime = 0;
                    resp = int.TryParse(r["NofTime"].ToString(), out inNofTime);
                    _ExistData.NofTime = inNofTime;
                    int inCurrentCount = 0;
                    resp = int.TryParse(r["CurrentCount"].ToString(), out inCurrentCount);
                    _ExistData.CurrentCount = inCurrentCount;
                    int inTriggerStatus = 0;
                    resp = int.TryParse(r["TriggerStatus"].ToString(), out inTriggerStatus);
                    _ExistData.TriggerStatus  = inTriggerStatus;
                    _ExistData.SQLStatement   = r["SQLStatement"].ToString();
                    _ExistData.WhereC0ndition = r["WhereC0ndition"].ToString();
                    _ExistData.SearchText     = r["SearchText"].ToString();
                    _ExistData.SearchValue    = r["SearchValue"].ToString();
                    int inCustomerID = 0;
                    resp = int.TryParse(r["CustomerID"].ToString(), out inCustomerID);
                    _ExistData.CustomerID = inCustomerID;
                    _ExistData.MailListID = r["MailListID"].ToString();
                    return("True");
                }
                catch (Exception ex)
                {
                    return(ex.Message);
                }
            }
            else
            {
                return("Data not Found ");
            }
        }
Esempio n. 3
0
        public Boolean ExistUserGroup()
        {
            String  Str1;
            DataRow Mydr;

            Str1 = "Select SysID From tblUserGroup"
                   + " Where UserGroup ='" + _GroupName + "'";
            Mydr = MYCommon.GetDataRow(Str1, "Exist User Group");
            if (Mydr != null)
            {
                if (Mydr.ItemArray.GetValue(0).ToString() != "")
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }