Esempio n. 1
0
 public static List <QCProT> GetQCProT(QCProT _QCProT)
 {
     try
     {
         //---
         string        commandtext = string.Format(@"select q.srl,TO_char(q.createddate,'YYYY/MM/DD HH24:MI:SS','nls_calendar=persian') as ProCreatedDateFa,u.userid,u.fname ||'_'|| u.lname as ProCreatedByDesc,c.nasvin as vin,q.createdby,q.Locisvalid  
                                             from QCProT q join qccariddt c on q.vin=c.vin  join qcusert u on u.srl = q.createdby                 
                                             order by srl desc"); //where q.createddate like sysdate
         List <QCProT> lstP        = new List <QCProT>();
         Object[]      obj         = DBHelper.GetDBObjectByObj2_OnLive(new QCProT(), null, commandtext, "inspector");
         lstP = obj.Cast <QCProT>().ToList();
         //---
         if (lstP.Count > 0)
         {
             return(lstP);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception e)
     {
         DBHelper.LogtxtToFile("err_InsertQCProT_" + e.Message.ToString());
         DBHelper.LogFile(e);
         return(null);
     }
 }
Esempio n. 2
0
        public QCProT InsertTST()
        {
            QCProT _qCProT = new QCProT();

            _qCProT.Vin       = "NAS411100G1205275";
            _qCProT.CreatedBy = 6017;
            return(ProtectionUtility.InsertQCProT(_qCProT));
        }
Esempio n. 3
0
 public QCProT GetQCProTOnAutomation([FromBody] QCProT _qCProT)//
 {
     try
     {
         DateTime      Tthen = DateTime.Now;
         QCProT        p     = new QCProT();
         List <QCProT> lstp  = ProtectionUtility.GetQCProT(p);
         string[]      s     = new string[1];
         s[0] = _qCProT.UserId.ToString();
         int i = CommonUtility.SendAutomationAtachExcel("اطلاعات ثبتی حراست", "باسلام و احترام", s, s, DBHelper.ToDataTable(lstp), "ثبت حراست");
         return(_qCProT);
         //return RefQCToday;// (5,82);
         //return l;
         //return GetBonroAuditArchiveStatistics();
     }
     catch (Exception ex)
     {
         DBHelper.LogFile(ex);
         return(null);
     }
 }
Esempio n. 4
0
 public static QCProT InsertQCProT(QCProT _QCProT)
 {
     try
     {
         OracleCommand cmd = new OracleCommand();
         cmd.CommandText = string.Format(@"delete qcprot where vin=  '{0}'", CarUtility.GetVinWithoutChar(_QCProT.Vin), _QCProT.CreatedBy);
         if (DBHelper.LiveDBConnectionIns.State == ConnectionState.Closed)
         {
             DBHelper.LiveDBConnectionIns.ConnectionString = DBHelper.CnStrInsLive;
             DBHelper.LiveDBConnectionIns.Open();
         }
         cmd.Connection = DBHelper.LiveDBConnectionIns;
         cmd.ExecuteNonQuery();
         //----
         cmd.CommandText = string.Format(@"insert into qcprot (vin, createdby, createddate,LocIsValid) VALUES  ('{0}',{1},sysdate,{2})", CarUtility.GetVinWithoutChar(_QCProT.Vin), _QCProT.CreatedBy, _QCProT.LocIsValid);
         if (DBHelper.LiveDBConnectionIns.State == ConnectionState.Closed)
         {
             DBHelper.LiveDBConnectionIns.ConnectionString = DBHelper.CnStrInsLive;
             DBHelper.LiveDBConnectionIns.Open();
         }
         cmd.Connection = DBHelper.LiveDBConnectionIns;
         cmd.ExecuteNonQuery();
         //---
         string commandtext = string.Format(@"select TO_char(p.createddate,'YYYY/MM/DD HH24:MI:SS','nls_calendar=persian') as ProCreatedDateFa
                                                         ,u.UserId,u.fname ||' '|| u.lname as ProCreatedByDesc
                                                         ,p.srl,p.vin,p.createdby,p.LocIsValid
                                                         from qcprot p left join qcusert u on p.createdby = u.srl
                                                         where vin ='{0}'", CarUtility.GetVinWithoutChar(_QCProT.Vin));
         QCProT p           = DBHelper.GetDBObjectByObj2_OnLive(new QCProT(), null, commandtext, "inspector").Cast <QCProT>().ToList()[0];
         return(p);
     }
     catch (Exception e)
     {
         DBHelper.LogtxtToFile("err_InsertQCProT_" + e.Message.ToString());
         DBHelper.LogFile(e);
         return(null);
     }
 }
Esempio n. 5
0
 public QCProT Insert([FromBody]  QCProT _qCProT)
 {
     return(ProtectionUtility.InsertQCProT(_qCProT));
 }