Ejemplo n.º 1
0
        public string UpdateRecord(Data Obj)
        {
            var DecodedData = Base64Decode(Obj.DetailData);

            ClsDownloadSuccess obj = JsonConvert.DeserializeObject <ClsDownloadSuccess>(DecodedData);

            if (obj != null)
            {
                objUpdateModel                     = new ClsDownloadSuccess();
                objUpdateModel.Ind                 = 2;
                objUpdateModel.OrgID               = obj.OrgID;
                objUpdateModel.BrID                = obj.BrID;
                objUpdateModel.UserName            = obj.UserName;
                objUpdateModel.UserPassword        = obj.UserPassword;
                objUpdateModel.DowinloadSuccessInd = obj.DowinloadSuccessInd;
                ObjOfflineSeriesDA                 = new OfflineSeriesDataAccess();
                DataTable dt = ObjOfflineSeriesDA.UpdateRecord(obj);
                if (dt != null && dt.Rows.Count > 0)
                {
                    respInd = Convert.ToInt32(dt.Rows[0][0].ToString());
                    if (respInd == 8)
                    {
                        objMsg                  = new ClsCommonMsg();
                        objMsg.Code             = 8;
                        objMsg.Msg              = "Successfully Update";
                        objMsg.DownloadLocation = "";
                    }

                    jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(objMsg);
                    resp       = Base64Encode(jsonString);
                    return(resp);
                }
                else
                {
                    resp = Base64Encode("Error");
                }
            }
            else
            {
                //error
                resp = Base64Encode("Error");
            }
            return(resp);
        }
Ejemplo n.º 2
0
        public string GetData(Data Obj)
        {
            var DecodedData = Base64Decode(Obj.DetailData);

            FormEntry obj = JsonConvert.DeserializeObject <FormEntry>(DecodedData);

            if (obj != null)
            {
                objModel                    = new OfflineSeriesModel();
                objModel.Ind                = 1;
                objModel.OrgID              = obj.OrgID;
                objModel.BrID               = obj.BrID;
                objModel.SeriesType         = obj.SeriesType;
                objModel.UserName           = obj.UserName;
                objModel.UserPassword       = obj.UserPassword;
                objModel.MacAddress         = obj.MacAddress;
                objModel.Binding_SeriesList = ToDataTable(obj.Binding_SeriesList);

                ObjOfflineSeriesDA = new OfflineSeriesDataAccess();
                DataTable dt = ObjOfflineSeriesDA.CheckInvoiceSeries(objModel);
                if (dt != null && dt.Rows.Count > 0)
                {
                    respInd = Convert.ToInt32(dt.Rows[0][0].ToString());
                    if (respInd == 1)
                    {
                        objMsg                  = new ClsCommonMsg();
                        objMsg.Code             = 1;
                        objMsg.Msg              = "Successfully Save";
                        objMsg.DownloadLocation = "";
                    }
                    else if (respInd == 2)
                    {
                        objMsg                  = new ClsCommonMsg();
                        objMsg.Code             = 2;
                        objMsg.Msg              = "";
                        objMsg.DownloadLocation = string.Empty;
                    }
                    else if (respInd == 9)
                    {
                        objMsg                  = new ClsCommonMsg();
                        objMsg.Code             = 9;
                        objMsg.Msg              = "";
                        objMsg.DownloadLocation = string.Empty;
                    }

                    jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(objMsg);
                    resp       = Base64Encode(jsonString);
                    return(resp);
                }
                else
                {
                    resp = Base64Encode("Error");
                }
            }
            else
            {
                //error
                resp = Base64Encode("Error");
            }
            return(resp);
        }