예제 #1
0
        public int UpdateMadarekStatus(FeraghatTahsilDTO oFeraghat, int userID, bool Loan, bool sendSms = true)
        {
            daoFeraghat = new FeraghatTahsilDAO();
            int counter = daoFeraghat.UpdateMadarekStatus(oFeraghat);

            if (counter > 0)
            {
                oFeraghat.Id = counter;
                //if(oFeraghat.GovahiMovaghat==1)
                //setMadrakArchiveCode(oFeraghat.StudentRequestId, 1);
                //if (oFeraghat.DaneshNameh == 1)
                //    setMadrakArchiveCode(oFeraghat.StudentRequestId, 2);
                //if (oFeraghat.RizNomarat == 1)
                //    setMadrakArchiveCode(oFeraghat.StudentRequestId,3);


                try
                {
                    insertVoroodDate(oFeraghat);
                    if (sendSms)
                    {
                        SendSms(oFeraghat, userID, Loan);
                    }
                }
                catch (Exception e)
                {
                    throw;
                }
                return(counter);
            }
            else
            {
                return(0);
            }
        }
예제 #2
0
        private void insertVoroodDate(FeraghatTahsilDTO oFeraghat)
        {
            FeraghatTahsilDAO daoFeraghat = new FeraghatTahsilDAO();

            bool   condition;
            string _dateVoroodDaneshname     = oFeraghat.dateVoroodDaneshname;
            string _dateVoroodRizNomre       = oFeraghat.dateVoroodRizNomre;
            string _dateVoroodGovahiMovaghat = oFeraghat.dateVoroodGovahi;

            condition = oFeraghat.RizNomarat == 1 && (oFeraghat.dateVoroodRizNomre == "" || oFeraghat.dateVoroodRizNomre == "null");

            if (condition)
            {
                _dateVoroodRizNomre = DateTime.Now.ToPeString("yyyy/MM/dd");
            }
            else if (oFeraghat.RizNomarat == 0)
            {
                _dateVoroodRizNomre = "";
            }
            oFeraghat.dateVoroodRizNomre = _dateVoroodRizNomre;


            condition = oFeraghat.DaneshNameh == 1 && (oFeraghat.dateVoroodDaneshname == "" || oFeraghat.dateVoroodDaneshname == "null");

            if (condition)
            {
                _dateVoroodDaneshname = DateTime.Now.ToPeString("yyyy/MM/dd");
            }
            else if (oFeraghat.DaneshNameh == 0)
            {
                _dateVoroodDaneshname = "";
            }
            oFeraghat.dateVoroodDaneshname = _dateVoroodDaneshname;
            condition = oFeraghat.GovahiMovaghat == 1 && (oFeraghat.dateVoroodGovahi == "" || oFeraghat.dateVoroodGovahi == "null");

            if (condition)
            {
                _dateVoroodGovahiMovaghat = DateTime.Now.ToPeString("yyyy/MM/dd");
            }
            else if (oFeraghat.GovahiMovaghat == 0)
            {
                _dateVoroodGovahiMovaghat = "";
            }
            oFeraghat.dateVoroodGovahi = _dateVoroodGovahiMovaghat;


            daoFeraghat.UpdateMadarekStatus(oFeraghat);
        }