Example #1
0
        public List <tjms1> Get_tjms1_List(tjms request)
        {
            List <tjms1> Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("Yoga"))
                {
                    if (!string.IsNullOrEmpty(request.CustomerCode))
                    {
                        Result = db.Select <tjms1>(
                            "select Top 10 * from tjms1 where isNull(CustomerCode,'')='" + request.CustomerCode + "'"
                            );
                    }
                    else if (!string.IsNullOrEmpty(request.JobNo))
                    {
                        Result = db.Select <tjms1>(
                            "select Top 10 * from tjms1 where isNull(JobNo,'') LIKE  '" + request.JobNo + "%'"
                            );
                    }
                }
            }
            catch { throw; }
            return(Result);
        }
Example #2
0
        public int ConfirmAll_tjms1(tjms request)
        {
            int Result = -1;

            //try
            //{
            //    using (var db = DbConnectionFactory.OpenDbConnection())
            //    {
            //        if (request.confirmAllString != null && request.confirmAllString != "")
            //        {
            //            JArray ja = (JArray)JsonConvert.DeserializeObject(request.confirmAllString);
            //            if (ja != null)
            //            {
            //                for (int i = 0; i < ja.Count(); i++)
            //                {
            //                    string strJobNo = "";
            //                    string strActualArrivalDate = "";
            //                    string strDeliveryDate = "";
            //                    if (ja[i]["JobNo"] != null || ja[i]["JobNo"].ToString() != "")
            //                    strJobNo = ja[i]["JobNo"].ToString();
            //                    strActualArrivalDate = ja[i]["ActualArrivalDate"].ToString();
            //                    strDeliveryDate = ja[i]["DeliveryDate"].ToString();
            //                    if (strJobNo != "")
            //                    {
            //                        if (strActualArrivalDate != "") {
            //                        db.Update("tjms3",
            //                          " DateTime = '" + Modfunction.SQLSafe(strActualArrivalDate) + "'",
            //                          " JobNo='" + strJobNo + "' and Description = 'ACTUAL ARRIVAL DATE'");
            //                        }
            //                        if (strDeliveryDate != "") {
            //                        db.Update("tjms1",
            //                          " DeliveryDateTime = '" + Modfunction.SQLSafe(strDeliveryDate) + "'",
            //                          " JobNo='" + strJobNo + "'");
            //                        }
            //                    }
            //                }
            //                Result = 1;
            //            }
            //        }
            //    }
            //}
            //catch { throw; }
            return(Result);
        }