Exemplo n.º 1
0
        public void DoAction(WFActivity activity)
        {
            this._activity = activity;
            _mail = new Email();
            foreach (KeyValuePair<string, WFUser> kvUser in activity.WFUsers)
            {
                string mailAddress = String.IsNullOrWhiteSpace(kvUser.Value.Email) ? "" : kvUser.Value.Email.Trim() + ";";
                if (kvUser.Value.IsKeyUser)
                {
                    toUser += kvUser.Value.DisplayName + ",";
                    toMail += mailAddress;
                }
                else if (kvUser.Value.IsApprover && !kvUser.Value.IsKeyUser)
                {
                    continue;
                }
                else
                {
                    ccMail += mailAddress;
                }
            }

            if (AccessControl.IsVendor())
            {
                toUser += AccessControl.CurrentLogonUser.Name + ",";
                toMail += string.IsNullOrEmpty(AccessControl.CurrentLogonUser.Email) ?
                    "" : AccessControl.CurrentLogonUser.Email.Trim() + ";";
            }

            SendMail();
        }
Exemplo n.º 2
0
 public void DoAction(WFActivity activity)
 {
     if (activity.ParentID == activity.Template.ToActivity.ID)
     {
         if (activity.ID == 20202)
         {
             string strSql = String.Format("UPDATE SGP_RFQGeneral SET BOMDateIn = ISNULL(BOMDateIn,GETDATE()) WHERE RFQID = {0}", activity.Template.EntityID);
             DbHelperSQL.ExecuteSql(strSql);
         }
         else if (activity.ID == 20203)
         {
             string strSql = String.Format("UPDATE SGP_RFQGeneral SET AssemblyDateIn = ISNULL(AssemblyDateIn,GETDATE()) WHERE RFQID = {0}", activity.Template.EntityID);
             DbHelperSQL.ExecuteSql(strSql);
         }
     }
     else if (activity.ParentID == activity.Template.FromActivity.ID)
     {
         if (activity.ID == 20202)
         {
             string strSql = String.Format("UPDATE SGP_RFQGeneral SET BOMDateOut = GETDATE() WHERE RFQID = {0}", activity.Template.EntityID);
             DbHelperSQL.ExecuteSql(strSql);
         }
         else if (activity.ID == 20203)
         {
             string strSql = String.Format("UPDATE SGP_RFQGeneral SET AssemblyDateOut = GETDATE() WHERE RFQID = {0}", activity.Template.EntityID);
             DbHelperSQL.ExecuteSql(strSql);
         }
     }
 }
Exemplo n.º 3
0
        public void DoAction(WFActivity activity)
        {
            WFActivity fromActivity = activity.Template.FromActivity;
            WFActivity toActivity = activity.Template.ToActivity;

            if (fromActivity.ID == 1 || fromActivity.ID == 201)
            {
                string strSql = String.Format("UPDATE SGP_RFQGeneral SET RFQDateIn = GETDATE(), RFQDateOut=NULL, QuoteDateIn=NULL,QuoteDateOut=NULL,PriceDateOut=NULL WHERE RFQID = {0}", activity.Template.EntityID);
                DbHelperSQL.ExecuteSql(strSql);
            }

            //RFQ Date Out	Date of Stage 6 Latest Start Time
            if (toActivity != null && (toActivity.ID == 6 || toActivity.ID == 206))
            {
                string strSql = String.Format("UPDATE SGP_RFQGeneral SET RFQDateOut = GETDATE() WHERE RFQID = {0}", activity.Template.EntityID);
                DbHelperSQL.ExecuteSql(strSql);
            }

            //Price Date Out Date of Stage 5 Lastest Start Time
            if (toActivity != null && (toActivity.ID == 5 || toActivity.ID == 205))
            {
                string strSql = String.Format("UPDATE SGP_RFQGeneral SET PriceDateOut = GETDATE() WHERE RFQID = {0}", activity.Template.EntityID);
                DbHelperSQL.ExecuteSql(strSql);
            }

            //Cost Date In 	Date of Stage 2 Start Time
            if (toActivity != null && (toActivity.ID == 2 || toActivity.ID == 202))
            {
                string strSql = String.Format("UPDATE SGP_RFQGeneral SET QuoteDateIn = CASE WHEN QuoteDateIn IS NULL THEN GETDATE() ELSE QuoteDateIn END WHERE RFQID = {0}", activity.Template.EntityID);
                DbHelperSQL.ExecuteSql(strSql);
            }

            //Cost Date Out	Date of Stage 2 Latest End Time
            if (fromActivity != null && (fromActivity.ID == 2 || fromActivity.ID == 202))
            {
                string strSql = String.Format("UPDATE SGP_RFQGeneral SET QuoteDateOut = GETDATE() WHERE RFQID = {0}", activity.Template.EntityID);
                DbHelperSQL.ExecuteSql(strSql);
            }
        }
Exemplo n.º 4
0
        public void DoAction(WFActivity activity)
        {
            string viFromNumber = string.Format("{0}", activity.Template.MasterData["VIForm"]);

            if (string.IsNullOrEmpty(viFromNumber)) return;

            int RFQID=activity.Template.EntityID;

            CopyFile(viFromNumber,RFQID);
        }
Exemplo n.º 5
0
        public void DoActionForVVI(WFActivity activity, string Vendor, string vendormail)
        {
            this._activity = activity;
            _mail = new Email();
            foreach (KeyValuePair<string, WFUser> kvUser in activity.WFUsers)
            {
                string mailAddress = String.IsNullOrWhiteSpace(kvUser.Value.Email) ? "" : kvUser.Value.Email.Trim() + ";";
                if (kvUser.Value.IsKeyUser)
                {
                    toUser += kvUser.Value.DisplayName + ",";
                    toMail += mailAddress;
                }
                else
                {
                    ccMail += mailAddress;
                }
            }

            toUser = Vendor;
            toMail += string.IsNullOrEmpty(vendormail) ?
                "" : vendormail + ";";
            SendMail();
        }