Ejemplo n.º 1
0
        public string SaveObjectUserRoll(ObjectUserRollDataType _SaveData)
        {
            MySqlCommand oSqlCommand = new MySqlCommand();
            string       sqlQuery    = "Insert Into tblobguserprofile ("
                                       + "RollID,"
                                       + "userID,"
                                       + "ObgID,"
                                       + "OView,"
                                       + "OSave,"
                                       + "OUpdate,"
                                       + "Odelete,"
                                       + "OPrint,"
                                       + "OPostToApp,"
                                       + "OPostToAcc)"
                                       + " Values ("
                                       + "@RollID,"
                                       + "@userID,"
                                       + "@ObgID,"
                                       + "@OView,"
                                       + "@OSave,"
                                       + "@OUpdate,"
                                       + "@Odelete,"
                                       + "@OPrint,"
                                       + "@OPostToApp,"
                                       + "@OPostToAcc)";

            try
            {
                oSqlCommand.Parameters.AddWithValue("@RollID", _SaveData.RollID);
                oSqlCommand.Parameters.AddWithValue("@userID", _SaveData.userID);
                oSqlCommand.Parameters.AddWithValue("@ObgID", _SaveData.ObgID);
                oSqlCommand.Parameters.AddWithValue("@OView", _SaveData.OView);
                oSqlCommand.Parameters.AddWithValue("@OSave", _SaveData.OSave);
                oSqlCommand.Parameters.AddWithValue("@OUpdate", _SaveData.OUpdate);
                oSqlCommand.Parameters.AddWithValue("@Odelete", _SaveData.Odelete);
                oSqlCommand.Parameters.AddWithValue("@OPrint", _SaveData.OPrint);
                oSqlCommand.Parameters.AddWithValue("@OPostToApp", _SaveData.OPostToApp);
                oSqlCommand.Parameters.AddWithValue("@OPostToAcc", _SaveData.OPostToAcc);
                string respond = MYCommon.ExicuteAnyCommandAccount(sqlQuery, oSqlCommand, "Save ObjectUserRoll");
                return(respond);
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
Ejemplo n.º 2
0
        public string UpdateObjectUserRoll(ObjectUserRollDataType _Update)
        {
            MySqlCommand oSqlCommand = new MySqlCommand();
            string       sqlQuery    = "Update tblobguserprofile Set "
                                       + "SysID=@SysID,"
                                       + "RollID=@RollID,"
                                       + "userID=@userID,"
                                       + "ObgID=@ObgID,"
                                       + "OView=@OView,"
                                       + "OSave=@OSave,"
                                       + "OUpdate=@OUpdate,"
                                       + "Odelete=@Odelete,"
                                       + "OPrint=@OPrint,"
                                       + "OPostToApp=@OPostToApp,"
                                       + "OPostToAcc=@OPostToAcc"
                                       + " Where 1=1 "
                                       + " and RollID=@RollID"
                                       + " and userID=@userID"
                                       + " and ObgID=@ObgID";

            try
            {
                oSqlCommand.Parameters.AddWithValue("@SysID", _Update.SysID);
                oSqlCommand.Parameters.AddWithValue("@RollID", _Update.RollID);
                oSqlCommand.Parameters.AddWithValue("@userID", _Update.userID);
                oSqlCommand.Parameters.AddWithValue("@ObgID", _Update.ObgID);
                oSqlCommand.Parameters.AddWithValue("@OView", _Update.OView);
                oSqlCommand.Parameters.AddWithValue("@OSave", _Update.OSave);
                oSqlCommand.Parameters.AddWithValue("@OUpdate", _Update.OUpdate);
                oSqlCommand.Parameters.AddWithValue("@Odelete", _Update.Odelete);
                oSqlCommand.Parameters.AddWithValue("@OPrint", _Update.OPrint);
                oSqlCommand.Parameters.AddWithValue("@OPostToApp", _Update.OPostToApp);
                oSqlCommand.Parameters.AddWithValue("@OPostToAcc", _Update.OPostToAcc);
                string respond = MYCommon.ExicuteAnyCommandAccount(sqlQuery, oSqlCommand, "Update ObjectUserRoll");
                return(respond);
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
Ejemplo n.º 3
0
 public string GetExistObjectUserRoll(int RollID, int userID, int ObgID, out ObjectUserRollDataType _ExistData)
     {
     _ExistData = new ObjectUserRollDataType();
     MySqlCommand oSqlCommand = new MySqlCommand();
     string sqlQuery = "Select "
   + "SysID,"
   + "RollID,"
   + "userID,"
   + "ObgID,"
   + "OView,"
   + "OSave,"
   + "OUpdate,"
   + "Odelete,"
   + "OPrint,"
   + "OPostToApp,"
   + "OPostToAcc"
   + " from tblobguserprofile"
   + " Where 1=1 "
         + " and RollID=@RollID"
         + " and userID=@userID"
         + " and ObgID=@ObgID";
     oSqlCommand.Parameters.AddWithValue("@RollID", RollID);
     oSqlCommand.Parameters.AddWithValue("@userID", userID);
     oSqlCommand.Parameters.AddWithValue("@ObgID", ObgID);
     DataRow r = MYCommon.GetDataRowAccount(sqlQuery, oSqlCommand, "Get Exist data ObjectUserRoll");
     if (r != null)
         {
         try
             {
             bool resp = false;
             int inSysID = 0;
             resp = int.TryParse(r["SysID"].ToString(), out inSysID);
             _ExistData.SysID = inSysID;
             int inRollID = 0;
             resp = int.TryParse(r["RollID"].ToString(), out inRollID);
             _ExistData.RollID = inRollID;
             int inuserID = 0;
             resp = int.TryParse(r["userID"].ToString(), out inuserID);
             _ExistData.userID = inuserID;
             int inObgID = 0;
             resp = int.TryParse(r["ObgID"].ToString(), out inObgID);
             _ExistData.ObgID = inObgID;
             int inOView = 0;
             resp = int.TryParse(r["OView"].ToString(), out inOView);
             _ExistData.OView = inOView;
             int inOSave = 0;
             resp = int.TryParse(r["OSave"].ToString(), out inOSave);
             _ExistData.OSave = inOSave;
             int inOUpdate = 0;
             resp = int.TryParse(r["OUpdate"].ToString(), out inOUpdate);
             _ExistData.OUpdate = inOUpdate;
             int inOdelete = 0;
             resp = int.TryParse(r["Odelete"].ToString(), out inOdelete);
             _ExistData.Odelete = inOdelete;
             int inOPrint = 0;
             resp = int.TryParse(r["OPrint"].ToString(), out inOPrint);
             _ExistData.OPrint = inOPrint;
             int inOPostToApp = 0;
             resp = int.TryParse(r["OPostToApp"].ToString(), out inOPostToApp);
             _ExistData.OPostToApp = inOPostToApp;
             int inOPostToAcc = 0;
             resp = int.TryParse(r["OPostToAcc"].ToString(), out inOPostToAcc);
             _ExistData.OPostToAcc = inOPostToAcc;
             return "True";
             }
         catch (Exception ex)
             {
             return ex.Message;
             }
         }
     else
         return "data not found ";
     }
Ejemplo n.º 4
0
 public string UpdateObjectUserRoll(ObjectUserRollDataType _Update)
     {
     MySqlCommand oSqlCommand = new MySqlCommand();
     string sqlQuery = "Update tblobguserprofile Set "
         + "SysID=@SysID,"
         + "RollID=@RollID,"
         + "userID=@userID,"
         + "ObgID=@ObgID,"
         + "OView=@OView,"
         + "OSave=@OSave,"
         + "OUpdate=@OUpdate,"
         + "Odelete=@Odelete,"
         + "OPrint=@OPrint,"
         + "OPostToApp=@OPostToApp,"
         + "OPostToAcc=@OPostToAcc"
         + " Where 1=1 "
         + " and RollID=@RollID"
         + " and userID=@userID"
         + " and ObgID=@ObgID";
     try
         {
         oSqlCommand.Parameters.AddWithValue("@SysID", _Update.SysID);
         oSqlCommand.Parameters.AddWithValue("@RollID", _Update.RollID);
         oSqlCommand.Parameters.AddWithValue("@userID", _Update.userID);
         oSqlCommand.Parameters.AddWithValue("@ObgID", _Update.ObgID);
         oSqlCommand.Parameters.AddWithValue("@OView", _Update.OView);
         oSqlCommand.Parameters.AddWithValue("@OSave", _Update.OSave);
         oSqlCommand.Parameters.AddWithValue("@OUpdate", _Update.OUpdate);
         oSqlCommand.Parameters.AddWithValue("@Odelete", _Update.Odelete);
         oSqlCommand.Parameters.AddWithValue("@OPrint", _Update.OPrint);
         oSqlCommand.Parameters.AddWithValue("@OPostToApp", _Update.OPostToApp);
         oSqlCommand.Parameters.AddWithValue("@OPostToAcc", _Update.OPostToAcc);
         string respond = MYCommon.ExicuteAnyCommandAccount(sqlQuery, oSqlCommand, "Update ObjectUserRoll");
         return respond;
         }
     catch (Exception ex)
         {
         return ex.Message;
         }
     }
Ejemplo n.º 5
0
        public string SaveObjectUserRoll(ObjectUserRollDataType _SaveData)
            {
            MySqlCommand oSqlCommand = new MySqlCommand();
            string sqlQuery = "Insert Into tblobguserprofile ("
          + "RollID,"
          + "userID,"
          + "ObgID,"
          + "OView,"
          + "OSave,"
          + "OUpdate,"
          + "Odelete,"
          + "OPrint,"
          + "OPostToApp,"
          + "OPostToAcc)"
           + " Values ("
           + "@RollID,"
           + "@userID,"
           + "@ObgID,"
           + "@OView,"
           + "@OSave,"
           + "@OUpdate,"
           + "@Odelete,"
           + "@OPrint,"
           + "@OPostToApp,"
           + "@OPostToAcc)";
            try
                {

                oSqlCommand.Parameters.AddWithValue("@RollID", _SaveData.RollID);
                oSqlCommand.Parameters.AddWithValue("@userID", _SaveData.userID);
                oSqlCommand.Parameters.AddWithValue("@ObgID", _SaveData.ObgID);
                oSqlCommand.Parameters.AddWithValue("@OView", _SaveData.OView);
                oSqlCommand.Parameters.AddWithValue("@OSave", _SaveData.OSave);
                oSqlCommand.Parameters.AddWithValue("@OUpdate", _SaveData.OUpdate);
                oSqlCommand.Parameters.AddWithValue("@Odelete", _SaveData.Odelete);
                oSqlCommand.Parameters.AddWithValue("@OPrint", _SaveData.OPrint);
                oSqlCommand.Parameters.AddWithValue("@OPostToApp", _SaveData.OPostToApp);
                oSqlCommand.Parameters.AddWithValue("@OPostToAcc", _SaveData.OPostToAcc);
                string respond = MYCommon.ExicuteAnyCommandAccount(sqlQuery, oSqlCommand, "Save ObjectUserRoll");
                return respond;
                }
            catch (Exception ex)
                {
                return ex.Message;
                }
            }
Ejemplo n.º 6
0
        public string GetExistObjectUserRoll(int RollID, int userID, int ObgID, out ObjectUserRollDataType _ExistData)
        {
            _ExistData = new ObjectUserRollDataType();
            MySqlCommand oSqlCommand = new MySqlCommand();
            string       sqlQuery    = "Select "
                                       + "SysID,"
                                       + "RollID,"
                                       + "userID,"
                                       + "ObgID,"
                                       + "OView,"
                                       + "OSave,"
                                       + "OUpdate,"
                                       + "Odelete,"
                                       + "OPrint,"
                                       + "OPostToApp,"
                                       + "OPostToAcc"
                                       + " from tblobguserprofile"
                                       + " Where 1=1 "
                                       + " and RollID=@RollID"
                                       + " and userID=@userID"
                                       + " and ObgID=@ObgID";

            oSqlCommand.Parameters.AddWithValue("@RollID", RollID);
            oSqlCommand.Parameters.AddWithValue("@userID", userID);
            oSqlCommand.Parameters.AddWithValue("@ObgID", ObgID);
            DataRow r = MYCommon.GetDataRowAccount(sqlQuery, oSqlCommand, "Get Exist data ObjectUserRoll");

            if (r != null)
            {
                try
                {
                    bool resp    = false;
                    int  inSysID = 0;
                    resp             = int.TryParse(r["SysID"].ToString(), out inSysID);
                    _ExistData.SysID = inSysID;
                    int inRollID = 0;
                    resp = int.TryParse(r["RollID"].ToString(), out inRollID);
                    _ExistData.RollID = inRollID;
                    int inuserID = 0;
                    resp = int.TryParse(r["userID"].ToString(), out inuserID);
                    _ExistData.userID = inuserID;
                    int inObgID = 0;
                    resp             = int.TryParse(r["ObgID"].ToString(), out inObgID);
                    _ExistData.ObgID = inObgID;
                    int inOView = 0;
                    resp             = int.TryParse(r["OView"].ToString(), out inOView);
                    _ExistData.OView = inOView;
                    int inOSave = 0;
                    resp             = int.TryParse(r["OSave"].ToString(), out inOSave);
                    _ExistData.OSave = inOSave;
                    int inOUpdate = 0;
                    resp = int.TryParse(r["OUpdate"].ToString(), out inOUpdate);
                    _ExistData.OUpdate = inOUpdate;
                    int inOdelete = 0;
                    resp = int.TryParse(r["Odelete"].ToString(), out inOdelete);
                    _ExistData.Odelete = inOdelete;
                    int inOPrint = 0;
                    resp = int.TryParse(r["OPrint"].ToString(), out inOPrint);
                    _ExistData.OPrint = inOPrint;
                    int inOPostToApp = 0;
                    resp = int.TryParse(r["OPostToApp"].ToString(), out inOPostToApp);
                    _ExistData.OPostToApp = inOPostToApp;
                    int inOPostToAcc = 0;
                    resp = int.TryParse(r["OPostToAcc"].ToString(), out inOPostToAcc);
                    _ExistData.OPostToAcc = inOPostToAcc;
                    return("True");
                }
                catch (Exception ex)
                {
                    return(ex.Message);
                }
            }
            else
            {
                return("data not found ");
            }
        }