Beispiel #1
0
        // GET: CommonApi
        public JObject OrgTickUntick(int OrgId, bool Status)
        {
            OrgSetting orgSetting = OrgSetting.Getone(OrgId);

            if (orgSetting.id == 0)
            {
                orgSetting.OrgId          = OrgId;
                orgSetting.EnblDeleryChrg = 0;
                orgSetting.MinOrderAmt    = 0;
                orgSetting.DeliveryCharge = 0;
                orgSetting.OrdCanlMinTime = 0;
                orgSetting.ByCash         = 1;
                orgSetting.ByOnline       = 1;
                orgSetting.AcptMinOrd     = 1;
                orgSetting.ContactHead1   = "";
                orgSetting.Contact1       = "";
                orgSetting.ContacHead2    = "";
                orgSetting.Contact2       = "";
                orgSetting.CheckBoxStatus = Status;
                orgSetting.save();
            }
            else
            {
                orgSetting.CheckBoxStatus = Status;
                orgSetting.save();
            }
            JObject jObject = new JObject();

            jObject.Add("Status", 200);
            return(jObject);
        }
        public JsonResult SaveSetting(OrgSetting ObjSetting)
        {
            if (ObjSetting.AcptMinOrd == 0 || ObjSetting.EnblDeleryChrg == 0)
            {
                ObjSetting.DeliveryCharge = 0.00;
            }
            if (ObjSetting.ContactHead1 == null)
            {
                ObjSetting.ContactHead1 = "";
            }
            if (ObjSetting.Contact1 == null)
            {
                ObjSetting.Contact1 = "";
            }
            if (ObjSetting.ContacHead2 == null)
            {
                ObjSetting.ContacHead2 = "";
            }
            if (ObjSetting.Contact2 == null)
            {
                ObjSetting.Contact2 = "";
            }

            ObjSetting.save();
            return(Json(new { data = "1" }, JsonRequestBehavior.AllowGet));
        }